Python Package

Modern Python

Upgrading Python codebases to modern idioms, syntax and standard library patterns.

Early Access: Until 2026-12-31

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 example py -3.12 -m manifestguard ...). On Linux/macOS this usually maps to python3.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 central pyproject.toml.
  • Remove legacy execution paths gradually and document the new reference workflow.

Recommended mgpy workflow

  1. Unify invocation paths for local development, virtual environments and CI.
  2. Keep legacy helper scripts only when they still have a real, documented purpose.
  3. 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