Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

python-support-window

Python package maintainers who ship requires-python, Trove classifiers, tox envlists, and GitHub Actions matrices often drift those declarations apart — PyPI says 3.10–3.12 while CI still runs 3.13, or tox drops a minor the classifier still advertises. python-support-window is a small deterministic CLI that expands requires-python, compares it to Programming Language :: Python :: 3.x classifiers (and optionally tox / Actions), and exits 1 on mismatch. Nearest tools (manual checklist reviews, or ad-hoc check-python-versions scripts) do not give you a single path-safe gate for all three surfaces.

60-second quickstart

bash

# from the repository root
python -m pip install -e ".[dev]"
python-support-window --help
python-support-window fixtures/aligned
python-support-window fixtures/mismatch-classifiers; echo "exit=$?"
python -m pytest -q

PowerShell

# from the repository root
python -m pip install -e ".[dev]"
python-support-window --help
python-support-window fixtures\aligned
python-support-window fixtures\mismatch-classifiers; Write-Host "exit=$LASTEXITCODE"
python -m pytest -q

Aligned fixtures exit 0. Mismatch fixtures exit 1 and print a markdown report of missing/extra minors.

What it checks

  1. Parse pyproject.tomlproject.requires-python (Poetry tool.poetry.dependencies.python as fallback).
  2. Expand the specifier against known CPython minors 3.83.14.
  3. Compare Programming Language :: Python :: 3.x classifiers to that window.
  4. Optionally compare tox.ini envlist / env_list (py310, brace factors, py310-django42).
  5. Optionally compare .github/workflows/*.{yml,yaml} strategy.matrix.python-version (and concrete actions/setup-python python-version values; ${{ }} expressions are ignored).

Tox and CI are skipped when absent unless you pass --require-tox / --require-ci.

CLI

python-support-window [root] [--root DIR] [--report FILE] [--quiet]
                      [--require-tox] [--require-ci] [--help] [--version]
Exit Meaning
0 Windows agree
1 Mismatch or missing required contract
2 Runtime / I/O error

Fixtures

Fixture Expected
fixtures/aligned exit 0 — classifiers, tox, and CI match >=3.10,<3.13
fixtures/mismatch-classifiers exit 1 — classifier missing 3.12
fixtures/mismatch-tox exit 1 — tox missing 3.12
fixtures/mismatch-ci exit 1 — CI has 3.13 instead of 3.12

Install in CI

- run: python -m pip install python-support-window
- run: python-support-window .

Or use this repository’s workflow at .github/workflows/ci.yml as a template.

v0.2 limitations (honest)

  • Candidate pool is fixed at 3.83.14; newer minors need a release bump.
  • Does not resolve python-version-file (.python-version / .tool-versions) yet.
  • Tox brace expansion is intentionally naive (one-level {a,b}); complex generative envlists may need hand-tuning.
  • Does not read Nox, Hatch env matrices, or Azure Pipelines.
  • Poetry-only projects without PEP 621 classifiers still need classifiers in [project] (or migrate metadata) for the classifier check.

License

MIT

About

Python package maintainers who ship `requires-python`, Trove classifiers, tox envlists, and GitHub Actions matrices o...

Topics

Resources

Stars

10 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages