Modern Python patterns make mgpy easier to maintain: fewer legacy exceptions, clearer CLI invocations and less platform-specific branching.
Key points
- CLI: On Windows the examples use the recommended
py -3.12 -m <module> ...form (for examplepy -3.12 -m manifestguard ...). On Linux/macOS this usually maps topython3.12 -m .... - Prefer explicit interpreter invocations (
py -3.12 -m manifestguard ...on Windows,python3.12 -m manifestguard ...on Linux/macOS) over fragile PATH-based command resolution. - Use
pathlib,dataclasses, modern typing syntax and one centralpyproject.toml. - Remove legacy execution paths gradually and document the new reference workflow.
Recommended mgpy workflow
- Unify invocation paths for local development, virtual environments and CI.
- Keep legacy helper scripts only when they still have a real, documented purpose.
- Run mgpy again after modernization to verify packaging, entry points and reports.
Quick start
py -3.12 -m manifestguard --version
py -3.12 -m manifestguard check
py -3.12 -m manifestguard export-metrics --output metrics.json