mafw.steering.environment
Resolve steering-scoped dotenv files without changing process state.
- Author:
Bulgheroni Antonio
- Description:
Build an isolated environment mapping for one steering file.
Added in version 2.4.
Functions
|
Merge dotenv values and the process environment for one steering file. |
Classes
|
A configured dotenv path and its safe-to-display validation message. |
|
Environment values and path statuses belonging to one steering file. |
Exceptions
Raised when a steering file cannot resolve one of its dotenv files. |
- exception mafw.steering.environment.SteeringEnvironmentError[source]
Bases:
ValueErrorRaised when a steering file cannot resolve one of its dotenv files.
- class mafw.steering.environment.EnvironmentFileStatus(configured_path: str, resolved_path: Path | None, error: str | None = None)[source]
Bases:
objectA configured dotenv path and its safe-to-display validation message.
- class mafw.steering.environment.SteeringEnvironment(values: dict[str, str], files: tuple[EnvironmentFileStatus, ...], errors: tuple[str, ...] = ())[source]
Bases:
objectEnvironment values and path statuses belonging to one steering file.
- mafw.steering.environment.resolve_steering_environment(config: Mapping[str, Any], steering_file: Path | str, *, process_environment: Mapping[str, str] | None = None, strict: bool = True) SteeringEnvironment[source]
Merge dotenv values and the process environment for one steering file.
- Parameters:
config – Raw steering mapping before interpolation.
steering_file – Source TOML path used to resolve relative dotenv paths.
process_environment – Optional environment snapshot; defaults to
os.environ.strict – Raise when any configured entry is invalid; false returns all safe statuses.
- Returns:
Merged values and safe per-file status records.
- Raises:
SteeringEnvironmentError – If the setting or any configured file is invalid.