Skip to content

Revert "Prefer the greater metadata directory when a path supplies several" - #552

Merged
jaraco merged 1 commit into
mainfrom
debt/revert-prefer-greater-version
Oct 23, 2026
Merged

jaraco merged 1 commit into
mainfrom
debt/revert-prefer-greater-version

Conversation

@jaraco

@jaraco jaraco commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

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.0 still sorts above foo-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 MultipleVersionsTests included test_validity_preferred_to_version, a guard for #489. That condition is already covered independently by test_valid_dists_preferred, which is untouched, so the revert drops no unique coverage.

tox passes: 257 passed, 1 skipped, 41 subtests; mypy and ruff clean; perf within noise.

🤖 Generated with Claude Code

…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 <[email protected]>
@jaraco
jaraco force-pushed the debt/revert-prefer-greater-version branch from b03103e to 7e162d8 Compare October 23, 2026 21:43
@jaraco
jaraco merged commit 60bbaca into main Oct 23, 2026
30 of 32 checks passed
@jaraco
jaraco deleted the debt/revert-prefer-greater-version branch October 23, 2026 21:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant