Python Package

Code-Konsistenz

Einheitliche Coding-Standards und Stil in Python-Projekten durchsetzen.

Früher Zugriff: Bis 2026-12-31

Konsistenz ist in mgpy kein kosmetisches Extra: ein klarer Werkzeug- und Stilpfad reduziert Review-Reibung, False Positives und unstete Reports.

Kernpunkte

  • CLI: Unter Windows zeigen die Beispiele den empfohlenen Aufruf via py -3.12 -m <modul> ... (z.B. py -3.12 -m manifestguard ...). Auf Linux/macOS entspricht das in der Regel python3.12 -m ....
  • Ruff ist der bevorzugte Einzelmotor fuer Linting, Formatierung und Import-Ordnung.
  • Ein gemeinsames pyproject.toml ist belastbarer als viele konkurrierende Tool-Configs.
  • Fixe dieselbe Kategorie von Problemen immer am Root Cause statt per Suppression.

Empfohlener MG-Python-Workflow

  1. Ein gemeinsames Regelset im Repo festlegen und nicht pro Entwickler variieren.
  2. Vor mgpy-Extended-Runs erst Ruff-Fixes und Formatierung stabilisieren.
  3. Danach mgpy laufen lassen, damit Reports auf einem ruhigen Stilfundament entstehen.

Schnellstart

py -3.12 -m ruff check . --fix
py -3.12 -m ruff format .
py -3.12 -m manifestguard check --extended

Voraussetzungen

Spalten
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.