Expand description
Installer guard — structured error handling, logging, progress reporting, and Python version validation.
Ports the core functionality from scripts/lib/installer_guard.sh:
InstallerErrorenum with common failure modes- Structured logging with
[mlstack][LEVEL]format,NO_COLORsupport - Progress reporting with step counting
- Python version validation (3.10+ general, 3.10-3.13 ROCm PyTorch)
§Validation Assertions
- VAL-INFRA-009: InstallerError enum with common failure modes, implements std::error::Error
- VAL-INFRA-010: Structured logging with [mlstack][LEVEL] format, NO_COLOR support
- VAL-INFRA-011: Python version validation (3.10+ general, 3.10-3.13 ROCm PyTorch)
- VAL-INFRA-012: Progress reporting with step counting
Structs§
- Progress
Tracker - Progress tracker for multi-step installation processes.
- Python
Version - Parsed Python version (major.minor).
Enums§
- Installer
Error - Common error types for installer operations.
- LogLevel
- Log level for structured messages.
Constants§
- MAX_
ROCM_ TORCH_ PYTHON - Maximum Python version for ROCm PyTorch wheels (3.13).
- MIN_
PYTHON_ VERSION - Minimum Python version for general ML Stack use (3.10).
Functions§
- detect_
python_ version - Detect the Python version from a binary by running
python3 -c "import sys; ...". - is_
python_ supported - Check if a Python version is supported for general ML Stack use (3.10+).
- is_
python_ supported_ for_ rocm_ torch - Check if a Python version is supported for ROCm PyTorch (3.10-3.13).
- log
- Write a structured log message to stderr.
- log_
colored - Write a log message with optional color support.
- log_
error - Log an error message.
- log_
info - Log an info message.
- log_
warn - Log a warning message.