Repository navigation
fix: version range resolution to account for Python compatibility - #156
Conversation
…elgap#156) pip compares the interpreter's full version, so a target "3.8" stands for a current 3.8.x: `>=3.8.1` (flake8 6, langchain 0.1) must admit it, and `!=3.9.0` must admit 3.9. Adds tests for patch-level specifiers. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Merged, thanks @Swarneil1905! Scoping this to the one-Python first step was the right call, and filtering file by file matches how pip reads We changed one thing before merging. #84 stays open for per-Python resolution. If you'd like something new, #20 ( (Review assisted by Claude.) |
- recheck_lock takes simple_index (the merge with main called it with one). - Version ranges on the simple index apply Requires-Python like fill() (wheelgap#156), reading PEP 691's requires-python key; parity tests run with a Python. - --index-url must be https, except for localhost. - [tool.wheelgap] index-url refuses credentials: pyproject.toml is committed. - Accept text/html at q=0.01 so an HTML-only index gets the clear error, not a 406. - CHANGELOG credit, ruff format. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Part of #84
What this changes
Version ranges could select a release that requires a newer Python than the target, causing wheelgap to report gaps for a release an installer would reject.
This implements the single-Python first step described in the issue. When all targets share the same Python major/minor version, range resolution chooses the newest matching release with a non-yanked file whose
Requires-Pythonpermits that interpreter. For example, a Python 3.9 run skips a newer release requiring Python 3.10 and selects the older compatible release.An optional Python version is passed through
fill()andfill_all()from the CLI and Python API. Incompatible files are excluded from the selected release. Missing or invalidRequires-Pythonmetadata is treated as unrestricted.Regular and free-threaded targets sharing the same major/minor use the same compatibility filter. Runs checking different Python versions retain their existing selection behavior; per-target version resolution remains separate work for #84. Exact pins and bare package names are unchanged.
Adds 24 offline tests covering release selection, CLI/API integration, metadata edge cases, yanked files, mirror fallback, and existing behavior. README documentation explains the scope and limitations.
Validated on Windows with Python 3.13.14: 700 tests passed, 1 skipped. Ruff formatting, lint, mypy, and
git diff --checkpassed.AI tools used: OpenAI Codex assisted with implementation, tests, documentation, and review. I reviewed the changes and ran the validation commands locally.
Checklist
fake_pypior mocked index responsesuv run --group dev ruff format .anduv run --group dev ruff check .passuv run --group dev mypyanduv run --group dev pytestpassCHANGELOG.mdupdated under## Unreleasedwith PR fix: version range resolution to account for Python compatibility #156