You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Version ranges: pick the newest release that supports each target's Python #84
Since 0.5.0, numpy>=1.26,<2 checks the newest release matching the range instead of the latest release. But the choice ignores each release's Requires-Python. With -p 3.9, wheelgap can pick a release that requires Python 3.10+, which pip would never install there, and report its (missing) cp39 wheels as gaps.
PyPI's JSON API includes requires_python on every file in releases. pip picks the newest release whose Requires-Python admits the interpreter.
Why it's help wanted: the choice depends on the Python, so one Package can resolve to different versions per target (e.g. 3.9 vs 3.13). Today a package has one version and one file list. Options:
Pick one version that satisfies every target Python (simple, but sometimes wrong).
Resolve per Python version and carry a version per target. This touches Package, fill() in src/wheelgap/pypi.py, the table (the version column) and --json.
Please sketch the design in a comment first. pypi.py changes always get a careful review.
Fix the one-Python case first, which needs no new data model. When every target has the same major.minor (e.g. -p 3.9 alone), _newest_matching in src/wheelgap/pypi.py should skip releases where no non-yanked file's requires_python admits it, as pip does (a missing or invalid one admits everything). Thread an optional python through fill() and fill_all(), passed from main() in cli.py and from check_packages() / check_lockfile() in api.py only in that case.
Not in this PR: several Pythons. That's the per-target design this issue still needs, so keep today's choice there.
Tests in tests/test_pypi.py: add a package to FAKE_INDEX in tests/conftest.py whose newer release has "requires_python": ">=3.10" on its files (entries can already be dicts), then check that -p 3.9 picks the older release and -p 3.13 the newer one.
I’d like to take the one Python first step described above. I’ll pass an optional Python version through fill() and fill_all() from the CLI and Python API when all targets share the same major/minor version.
For version ranges, _newest_matching will skip releases without a non-yanked file whose requires_python permits that Python, treating missing or invalid metadata as unrestricted. Runs targeting multiple Python versions will retain the existing behavior.
I’ll add offline regression tests for older/newer Python selection, metadata edge cases, and the CLI/API paths. Could you assign this to me as well? Thank you!
Go for it, @Swarneil1905! I've assigned this to you, and your PR #156 already covers the one-Python first step, so the 18-hour hold is met. We're reviewing it now. The per-Python resolution for runs with several Pythons stays open here as the next step.
Hi @Swarneil1905, are you still working on the rest of this? Your #156 covered the one-Python case; what's left is picking the newest release that supports each target's Python when several -p versions are checked. If we don't hear from you or see a PR by 18:00 UTC on Thursday 13 Nov, we'll finish it ourselves, with credit to you for the first step. No pressure either way.
Thanks for following up, @patrickballard . Yes, I’m finishing the multi-Python follow-up to #156.
The implementation resolves each range separately for each target Python major/minor, using one shared index response. Distinct resolutions appear as separate report rows with their own version, eligible files, and errors. Targets using another resolution show n/a, preserving the existing JSON structure.
The local test suite passes with 3,203 passed and 61 skipped. I’m reviewing the changes and will open a PR shortly.
Activity
patrickballard commentedon Nov 9, 2026
A good first step
Fix the one-Python case first, which needs no new data model. When every target has the same
major.minor(e.g.-p 3.9alone),_newest_matchinginsrc/wheelgap/pypi.pyshould skip releases where no non-yanked file'srequires_pythonadmits it, as pip does (a missing or invalid one admits everything). Thread an optionalpythonthroughfill()andfill_all(), passed frommain()incli.pyand fromcheck_packages()/check_lockfile()inapi.pyonly in that case.Not in this PR: several Pythons. That's the per-target design this issue still needs, so keep today's choice there.
Tests in
tests/test_pypi.py: add a package toFAKE_INDEXintests/conftest.pywhose newer release has"requires_python": ">=3.10"on its files (entries can already be dicts), then check that-p 3.9picks the older release and-p 3.13the newer one.(Reply assisted by Claude.)
Swarneil1905 commentedon Nov 10, 2026
I’d like to take the one Python first step described above. I’ll pass an optional Python version through
fill()andfill_all()from the CLI and Python API when all targets share the same major/minor version.For version ranges,
_newest_matchingwill skip releases without a non-yanked file whoserequires_pythonpermits that Python, treating missing or invalid metadata as unrestricted. Runs targeting multiple Python versions will retain the existing behavior.I’ll add offline regression tests for older/newer Python selection, metadata edge cases, and the CLI/API paths. Could you assign this to me as well? Thank you!
patrickballard commentedon Nov 10, 2026
Go for it, @Swarneil1905! I've assigned this to you, and your PR #156 already covers the one-Python first step, so the 18-hour hold is met. We're reviewing it now. The per-Python resolution for runs with several Pythons stays open here as the next step.
(Reply assisted by Claude.)
Version ranges: pick the newest release whose Requires-Python admits …
pyproject.toml: review fixes
patrickballard commentedon Nov 12, 2026
Hi @Swarneil1905, are you still working on the rest of this? Your #156 covered the one-Python case; what's left is picking the newest release that supports each target's Python when several
-pversions are checked. If we don't hear from you or see a PR by 18:00 UTC on Thursday 13 Nov, we'll finish it ourselves, with credit to you for the first step. No pressure either way.(Reply assisted by Claude.)
Swarneil1905 commentedon Nov 13, 2026
Thanks for following up, @patrickballard . Yes, I’m finishing the multi-Python follow-up to #156.
The implementation resolves each range separately for each target Python major/minor, using one shared index response. Distinct resolutions appear as separate report rows with their own version, eligible files, and errors. Targets using another resolution show n/a, preserving the existing JSON structure.
The local test suite passes with 3,203 passed and 61 skipped. I’m reviewing the changes and will open a PR shortly.
Docs: ranges now resolve per Python (wheelgap#84)