feat: Distinguish file-level vs release-level yanking (PEP 592)#13784
Open
Ashutosh0x wants to merge 9 commits intopypa:mainfrom
Open
feat: Distinguish file-level vs release-level yanking (PEP 592)#13784Ashutosh0x wants to merge 9 commits intopypa:mainfrom
Ashutosh0x wants to merge 9 commits intopypa:mainfrom
Conversation
notatallshaw
reviewed
Feb 1, 2026
news/13755.feature.rst
Outdated
Comment on lines
1
to
10
Member
There was a problem hiding this comment.
This news item is way too long, keep it to one or two short sentances.
Member
|
I was inspired to write up #13755 because of the following bug:
The point is to make sure this bug is fixed and yanking follows the specification. Please, at a minimum, add this test case. |
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.
Summary
This PR implements proper distinction between file-level and release-level yanking as specified in PEP 592, addressing #13755.
Changes
Core Logic (
src/pip/_internal/resolution/resolvelib/factory.py)The yanking logic has been updated to properly handle two distinct scenarios:
File-level yanking: When individual files are yanked but not all files for a version, only those specific yanked files are excluded. Other non-yanked files from the same version can still be selected.
Release-level yanking: When ALL files for a version are yanked, the version is considered "yanked" and the pinned version exception (
==or===) applies.Implementation Details
yanked_versionsset to identify release-level yanked versionsall_versions_yankedto handle the edge case where all available versions are yankedTests
Added comprehensive unit tests in
tests/unit/test_yanking.pycovering:Test Data
Added test index
tests/data/indexes/partial_yanked/with scenarios for:Fixes
Closes #13755
References