hatch.env.collectors.plugin.interface.EnvironmentCollectorInterface¶
- class hatch.env.collectors.plugin.interface.EnvironmentCollectorInterface(root, config)¶
Bases:
object
Example usage:
- ```python tab=”plugin.py”
from hatch.env.collectors.plugin.interface import EnvironmentCollectorInterface
- class SpecialEnvironmentCollector(EnvironmentCollectorInterface):
PLUGIN_NAME = ‘special’ …
- ```python tab=”hooks.py”
from hatchling.plugin import hookimpl
from .plugin import SpecialEnvironmentCollector
@hookimpl def hatch_register_environment_collector():
return SpecialEnvironmentCollector
- __init__(root, config)¶
Methods
__init__
(root, config)finalize_config
(config)Finalizes configuration for environments keyed by the environment or matrix name.
finalize_environments
(config)Finalizes configuration for environments keyed by the environment name.
Returns configuration for environments keyed by the environment or matrix name.
Attributes
The name used for selection.
`toml config-example [tool.hatch.env.collectors.<PLUGIN_NAME>] `
The root of the project tree as a path-like object.
- PLUGIN_NAME = ''¶
The name used for selection.
- property config: dict¶
`toml config-example [tool.hatch.env.collectors.<PLUGIN_NAME>] `
- finalize_config(config: dict[str, dict])¶
Finalizes configuration for environments keyed by the environment or matrix name. This will override any user-defined settings and any collectors that ran before this call.
This is called before matrices are turned into concrete environments.
- finalize_environments(config: dict[str, dict])¶
Finalizes configuration for environments keyed by the environment name. This will override any user-defined settings and any collectors that ran before this call.
This is called after matrices are turned into concrete environments.
- get_initial_config() dict[str, dict] ¶
Returns configuration for environments keyed by the environment or matrix name.
- property root¶
The root of the project tree as a path-like object.