Repository navigation
Revert "Prefer the greater metadata directory when a path supplies several" - #552
Merged
Merged
Conversation
…veral." The ordering was lexicographic on the directory name and not on the parsed version, so it only approximated a preference for the newer version and did not resolve every instance of the reported condition. This reverts commit 6a8b861. Ref python/cpython#100666. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
jaraco
force-pushed
the
debt/revert-prefer-greater-version
branch
from
October 23, 2026 21:43
b03103e to
7e162d8
Compare
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.
Reverts #550.
That change had
Lookup.__init__consider a path's children in reverse lexicographic order so that, where an unclean upgrade left more than one metadata directory for a distribution, the greater one was found first.The ordering is lexicographic on the directory name rather than on the parsed version, so it only approximates a preference for the newer version —
foo-1.9.0still sorts abovefoo-1.13.1— and so does not resolve every instance of python/cpython#100666.The behavior shipped in v9.1.0, so the revert gets a news fragment.
Tests
The reverted
MultipleVersionsTestsincludedtest_validity_preferred_to_version, a guard for #489. That condition is already covered independently bytest_valid_dists_preferred, which is untouched, so the revert drops no unique coverage.toxpasses: 257 passed, 1 skipped, 41 subtests; mypy and ruff clean; perf within noise.🤖 Generated with Claude Code