Skip to content

Config

config

Writable-path resolution for the executor's slice of the global config.yml.

The read/write accessors for the image: section live on ExecutorConfigView — this module holds only the path-resolution helper they call when they need to write.

__all__ = ['writable_config_path'] module-attribute

writable_config_path()

Return the path the next config write should target.

Honours TEROK_CONFIG_FILE when set; otherwise the user-scope file under namespace_config_dir.

Source code in src/terok_executor/config.py
def writable_config_path() -> Path:
    """Return the path the next config write should target.

    Honours ``TEROK_CONFIG_FILE`` when set; otherwise the user-scope
    file under [`namespace_config_dir`][terok_util.paths.namespace_config_dir].
    """
    env = os.getenv("TEROK_CONFIG_FILE")
    if env:
        return Path(env).expanduser()
    return namespace_config_dir() / "config.yml"