Python Package

Portable Paths

Cross-platform path handling in Python, avoiding hard-coded separators and OS assumptions.

Early Access: Until 2026-12-31

mgpy should behave predictably on local machines, in CI and on customer environments across platforms. Hardcoded paths and OS assumptions break that promise first.

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 ....
  • Use pathlib and configurable base directories instead of wired-in Windows or Unix paths.
  • CLI calls should run through the Python interpreter rather than accidental file associations.
  • Temporary data, reports and license home directories must be intentionally placeable.

Recommended mgpy workflow

  1. Inventory platform-specific path manipulation and replace it with central helpers.
  2. Run smoke checks on at least two platform classes with the same CLI commands.
  3. If a local override is required, feed the path through a flag or config instead of a code edit.

Quick start

py -3.12 -m manifestguard --version
py -3.12 -m manifestguard license --home /tmp/mg_home status
py -3.12 -m manifestguard check