Wheel admission: verify Requires-Python matches the declared Python support

Aperta
#156 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
45/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python

Direzione di ricerca

Start in scripts/wheel_smoke.py, where inspect_wheel() and smoke() read the wheel metadata, and pass the expected project["requires-python"] value into it. The fixtures in tests/test_wheel_smoke.py need a default Requires-Python header, and the seven admission cases in the issue should be added as controls. Done when those cases pass, the built wheel is checked against the declared requirement, and docs/wheel-verification.md is updated.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Verified packaging-gate gap (2026-11-24)

Pinned release candidate: release/0.6.0@6d935ee111e2efab7a5f7d7c8f8d050af8d35567. Read:

  • pyproject.toml, blob 956baa1de977ebc23e7e27f00f12aeb4a9712e6f: requires-python = ">=3.12", classifiers 3.12/3.13/3.14.
  • scripts/wheel_smoke.py, blob ad7b5f6295a0564d3f9a8410865839e918fe345a: inspect_wheel() validates version, distribution name, dependencies, members and entry point, but not Requires-Python. Its synthetic negative controls omit this field.
  • tests/test_wheel_smoke.py, blob 75c4a63823c50b08042b7815b4e673bbea325093: fixture metadata actually omits the Python requirement.
  • CI wheel job runs only Python 3.12 (source-test matrix is 3.12–3.14).

A wheel with missing, weaker, conflicting or overly restrictive Python metadata passes the static wheel admission. The installed-wheel smoke on 3.12 does not inherently catch a lower minimum or an upper bound excluding 3.13/3.14. Package installers may offer an unusable build to older interpreters or refuse it on otherwise supported interpreters. This is a gap in release assurance, not evidence that the genuine current wheel has wrong metadata.

Bounded executable evidence

On Python 3.13.5, ran the inspected inspect_wheel function body copied into an isolated local script with synthetic ZIP wheels (same member shape as the project's test fixture). All seven cases were accepted by the current function; only one should be admitted:

Requires-Python headers Expected Current Candidate
>=3.12 accept accept accept
absent reject accept reject
>=3.8 reject accept reject
>=3.12,<3.13 reject accept reject
duplicate identical reject accept reject
duplicate conflicting reject accept reject
empty reject accept reject

Current function: 1/7 expected outcomes. Adding the narrow check below: 7/7 expected outcomes. No genuine wheel build/install, package pytest, conformance or hosted CI was run. Local full clone failed DNS resolution.

Focused repair and acceptance

Read the expected value from project["requires-python"] in smoke(), pass it to inspect_wheel and negative_controls, then require exactly one matching metadata header:

require(metadata.get_all("Requires-Python") == [expected_python],
        "wheel/source Python requirement mismatch")

This strict textual check is sufficient for the current single specifier; if the project later permits differently serialized equivalent specifiers, handle that intentionally rather than weakening admission silently. Update existing test fixture to supply the correct header by default; add the six malformed/mismatched controls above, and a negative-control mutation of the real built wheel. Thread the expected requirement through all existing call sites, update the expected control list and docs/wheel-verification.md. Retain all current dependency/version/entry-point checks and #122's separate v2 consumer coverage.

  • All existing and seven new metadata admission cases pass.
  • Actual built wheel metadata agrees with the declared Python requirement, and a modified copy is rejected before installation.
  • Run full pytest, conformance, sample/historical verification and exact integrated-head CI; verify the actual installed wheel on the existing 3.12 gate.
  • No change to minimum Python support, runtime dependencies, policy, research contracts, publishing permissions or release schedule.

Dedup: searched open/closed issues and PRs for Requires-Python / Python metadata / wheel. Closed #84 introduced wheel admission but did not specify this check; #122 covers v2 fixture paths, #24 covers publication. No dedicated metadata issue found.

Provider: andy-zen-dev currently pull=true, push=false, triage=false, maintain=false, admin=false. This is a focused repository handoff, not a source change or release approval. Target a feature PR into the active release branch with independent review.

Lingua principale
Python
Stelle
6
Fork
1
Merge medio
6m
PR unite (30g)
1

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di drevendev/Devostasis

Tutte le issue di drevendev/Devostasis

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.