conan-io/hooks

Handle configurations of hooks

Open

#32 geöffnet am 31. Jan. 2019

Auf GitHub ansehen
 (9 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Python (45 Forks)auto 404
help wanted

Repository-Metriken

Stars
 (34 Stars)
PR-Merge-Metriken
 (PR-Metriken ausstehend)

Beschreibung

As soon as hooks start to proliferate there will be more and more environment variables to configure them, I think we should consider that risk and think about alternatives, there could be a better approach. It is time for brainstorming:

  • Do nothing, hooks will start to introduce env variables (there are already some of them), I think it could be a mess in the long term

  • Use a json file to handle the configuration of all the hooks (shareable with a conan config install), the HookManager could pass those variables in every function call:

    hooks_config.json

    {
        "hook_name_1": {
            "key1": "value",
            "key2": "value"
        },
        "hook_name_2": {
            "...": "..."
        }
    }
    

    hooks/hook_name_1.py

    ...
    def pre_export(..., config):
        assert config == {"key1": "value", "key2": "value"}
        ...
    
    def post_package(..., config):
        ...
    
  • add them to conan.conf file inside the cache

  • ...more ideas?

Contributor Guide