Python Package

Type Hints

Python-Typannotatiounen dobäisetzen a validéieren, fir d statesch Analyse ze verbesseren.

Fréien Zougang: Bis 2026-12-31

Type Hints maachen mgpy-Reports méi präzis, well ëffentlech API-Grenzen, Return-Wäerter an Date-Modeller méi kloer validéiert kënne ginn.

Kaerpunkten

  • CLI: Ënner Windows weisen d'Beispiller de recommandéierte Start iwwer py -3.12 -m <modul> ... (z.B. py -3.12 -m manifestguard ...). Ënner Linux/macOS ass dat normalerweis python3.12 -m ....
  • Als éischt ëffentlech Funktiounen, Date-Modeller a Return-Objekter annotéieren.
  • Type Hints mat kloeren Docstrings kombinéieren amplaz duebel an widderspréchlech Informatioun ze pflegen.
  • Wann e Package als typéiert Code konsuméiert soll ginn, gehéieren py.typed a stabil Imports zur kompletter Léisung.

Recommandeierte mgpy-Workflow

  1. Mat den Haapt-Entrée- an Austrëttspunkten vun der Bibliothéik ufänken.
  2. No all Annotatiouns-Ronn MyPy oder eng gläichwäerteg Typprüfung géint reell Usage-Pfade lafen loossen.
  3. Duerno mgpy ausféieren, fir Packaging an API-Kontrakter openeen ofzestëmmen.

Schnellstart

python -m mypy src
py -3.12 -m manifestguard check --extended
py -3.12 -m manifestguard schema --output openapi.json

Viraussetzungen

Kolonnen
Installation interpreter
Python 3.12 + pip
Recommended default path for installation and CLI calls.
Project target versions
Python 3.8 to 3.12
These are the project/runtime targets mgpy can analyze.
mgpy runtime
Validated on Python 3.10 to 3.13
The tool runtime itself is covered for this range.
CLI invocation
Windows: py -3.12 -m manifestguard
Linux/macOS usually maps to python3.12 -m manifestguard.
Runtime packages
tomlkit, click, pydantic, packaging, watchdog, PyNaCl, rfc8785
tomli is only added for Python below 3.11.
Offline / wheel install
Optional via pip --no-index or wheel
Useful for air-gapped or approved bundle distribution paths.