Type hints make mgpy reports more precise because public API boundaries, return values and data models become easier to validate.
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 .... - Annotate public functions, data models and return objects first.
- Combine type hints with clear docstrings instead of maintaining duplicate and conflicting information.
- If the package should be consumed as typed code,
py.typedand stable imports belong to the complete solution.
Recommended mgpy workflow
- Start with the main entry points and exit points of the library.
- After each annotation batch, run MyPy or an equivalent type checker against real usage paths.
- Run mgpy afterwards so packaging and API contracts stay aligned.
Quick start
python -m mypy src
py -3.12 -m manifestguard check --extended
py -3.12 -m manifestguard schema --output openapi.json