ml.utils.staging
Functions for staging environments.
Staged environments freeze a copy of the current Python codebase that can be run in a separate process without worrying that changes to the current codebase will affect the staged environment.
To save space, it basically copies over whatever modules are in the current environment (which are a subset of the codebase) to a new directory.
- ml.utils.staging.stage_environment(project_roots: str | Path | Sequence[str | Path], stage_dir: Path, date_format: str = '%Y-%m-%d') Path [source]
Stages the current environment to a root directory.
- Parameters:
project_roots – The root directory of the project.
stage_dir – The root directory for staging environments.
date_format – The date format to use for the staging directory.
- Returns:
The stage environment path
- Raises:
ValueError – If no project root is found.