Repository navigation
Fix interpreter-bound wheels treated as portable (#1048) - #1053
Merged
Mikola Lysenko (mikolalysenko) merged 4 commits intoOct 8, 2026
Merged
Conversation
Assisted-by: Claude Code:claude-opus-5-5
A patched wheel tagged cp311-none-any installs only on CPython 3.11, but the portability check looked at the ABI and platform tags and ignored the python tag. Hosted scan pinned such a wheel into Pipfile.lock (and every other PyPI lock) with no warning, so installs on any other Python version failed. Vendored mode gave no vendor_platform_locked advisory for it either. A wheel now counts as portable only when its python tag set holds a generic Python 3 tag (py3 or py3<minor>). cpXY / ppXY and py2-only wheels get redirect_pypi_platform_wheel in hosted mode and the vendor_platform_locked advisory in vendored mode, like ABI- and platform-tagged wheels already did. Fixes #1048 Assisted-by: Claude Code:claude-opus-5-5
Adds a CLI-level regression test for #1048: a hosted scan of a Pipenv project granted a cp311-none-any wheel leaves Pipfile.lock and requirements.txt untouched, exits 0 and attests nothing. Assisted-by: Claude Code:claude-opus-5-5
Mikola Lysenko (mikolalysenko)
marked this pull request as ready for review
October 7, 2026 16:50
Collaborator
Author
|
BugBot review Generated by Claude Code |
Collaborator
Author
|
[agent] Status on 0c7a92c:
Generated by Claude Code |
Tanmay Singla (Tanmay182003)
approved these changes
Oct 7, 2026
Collaborator
Author
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 6bff12d. Configure here.
Collaborator
Author
|
[agent] Ready for review at 6bff12d.
Generated by Claude Code |
Mikola Lysenko (mikolalysenko)
deleted the
agent/fix-pypi-interpreter-bound-wheel
branch
October 8, 2026 02:16
This was referenced Oct 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
LLM Description written by Claude Code:claude-opus-5-5
Fixes #1048
Summary
Hosted scan no longer pins a patched wheel that only one Python interpreter can install (e.g.
six-1.16.0-cp311-none-any.whl) into Pipfile.lock or any other PyPI lock. Such a wheel is now withheld withredirect_pypi_platform_wheel, like ABI- and platform-tagged wheels already were. Vendored mode now gives it thevendor_platform_lockedadvisory.Root cause
vendor::pypi_distribution::tag_is_platform_specificdecided portability from the ABI and platform tags only ([_py, abi, plat] => abi != "none" || plat != "any") and never looked at the python tag. So a wheel bound to one interpreter version (cp311-none-any,pp310-none-any), or one that excludes Python 3 (py2-none-any), counted as portable. Both the hosted refusal (pypi_platform_wheel_refusal) and vendored mode use this rule, so hosted mode narrowed a cross-version lock to that wheel and reported success.pipenv syncthen failed on every other CPython minor.Fix
A wheel is portable only when its ABI is
none, its platform isany, and its (possibly compressed,.-separated) python tag set contains a generic Python 3 tag:py3orpy3<minor>. pip accepts those on any later 3.x. As the issue's table notes,py311-none-anystays portable. The warning text now says "interpreter- or platform-specific", and CLI_CONTRACT.md documents the rule.py3-none-any,py2.py3-none-any,py311-none-any,cp311.py3-none-anycp311-none-any,pp310-none-any,cp311.cp312-none-anypy2-none-any*-abi3-*,*-manylinux*,*-win_amd64Tests (red → green)
All of these failed on
mainand pass with the fix:patch::redirect::platform_wheel_tests::*: every hosted lane (uv.lock CRLF/LF, PEP 723 script lock, pylock.toml, Pipfile.lock across Pipenv majors, requirements.txt, poetry.lock, pdm.lock, Hatch) now also asserts acp311-none-anywheel is withheld, warned about once with the tag named, and not confirmed. The tag table test addspy3,py311,cp311.py3(portable) andcp311,pp310,py2,cp311.cp312(withheld).vendor::pypi::tests::platform_specific_tag_detectionandwheel_platform_filename_fallback_is_fail_closed: unit coverage for the tag rule.vendor::pypi::tests::interpreter_bound_tag_sets_platform_locked_and_warns: vendored build from aTag: cp311-none-anydist recordsplatform_lockedand warns.in_process_redirect_pipenv::interpreter_bound_wheel_is_not_pinned_into_the_lock: the end-to-end hosted Pipenv scan from the issue leaves Pipfile.lock and requirements.txt untouched, exits 0, and a same-run VEX attests nothing. I confirmed it fails with the oldpypi_distribution.rsand passes with the fix.Per-issue checklist:
cp311-none-anypatched wheel into Pipfile.lock with no warning, sopipenv syncfails on every other Python version (gap in the #932 fix) #1048 hosted Pipenv:in_process_redirect_pipenv::interpreter_bound_wheel_is_not_pinned_into_the_lock,platform_wheel_tests::pipfile_lock_refuses_a_platform_wheelcp311-none-anypatched wheel into Pipfile.lock with no warning, sopipenv syncfails on every other Python version (gap in the #932 fix) #1048 other hosted PyPI lanes:platform_wheel_tests::*cp311-none-anypatched wheel into Pipfile.lock with no warning, sopipenv syncfails on every other Python version (gap in the #932 fix) #1048 vendored (the issue's "very likely commits such a wheel too"):interpreter_bound_tag_sets_platform_locked_and_warnsCommands run locally:
cargo clippy --workspace --all-features -- -D warnings: clean.cargo test -p socket-patch-core --all-features: 5586 passed, 4 failed. The 4 are chmod-based write-failure tests that can't fail as intended as root in this sandbox (wire_failure_rolls_back_already_written_files,wire_write_failure_maps_error_and_leaves_lock_untouched,an_unremovable_hidden_lock_keeps_every_store_entry,relax_loop_must_not_traverse_symlinked_root), unrelated to this change.cargo test -p socket-patch-cli --all-featuresforin_process_redirect_pipenv,in_process_vendor,mode_migration_pypi,e2e_vex_vendor,in_process_redirect_pdm: all pass.covgap_commands_vendor51/54; the 3 failures are the same root-only*_state_write_failure_*class.cargo fmt --all -- --checkis not clean onmainitself (CI doesn't run it), so I formatted only the lines this PR changes.🤖 Generated with Claude Code
https://claude.ai/code/session_01WjTGVb5owoBCsFnVKYUJLP
Note
Medium Risk
Changes shared wheel-tag logic for all hosted PyPI redirects and vendored PyPI flows; behavior shifts for previously “portable”
cpXY-none-anywheels but is intentionally fail-closed to avoid broken cross-interpreter lockfiles.Overview
Fixes #1048: wheels that only one Python interpreter can install (e.g.
cp311-none-any) are no longer treated as portable when classifying patch artifacts.tag_is_platform_specificinpypi_distribution.rsnow requires ABInone, platformany, and a generic Python 3 python tag (py3/py3<minor>in the compressed tag set). Interpreter-bound tags (cp311,pp310), Python-2-only tags, and existing ABI/platform locks still trigger refusal. Hosted PyPI redirect continues to skip pinning viaredirect_pypi_platform_wheel; vendored mode surfacesvendor_platform_lockedwith updated “interpreter- or platform-specific” copy. CLI_CONTRACT.md documents the broader rule.Tests cover all hosted PyPI lanes (including Pipenv e2e), vendored
platform_locked, and expanded tag tables.Reviewed by Cursor Bugbot for commit 6bff12d. Configure here.