Skip to content

Prefer stable releases for explicit pre-release requirements - #20302

Merged
charliermarsh merged 6 commits into
charlie/transitive-prerelease-pubgrubfrom
charlie/stable-first-prereleases
Jul 10, 2026
Merged

charliermarsh merged 6 commits into
charlie/transitive-prerelease-pubgrubfrom
charlie/stable-first-prereleases

Conversation

@charliermarsh

@charliermarsh charliermarsh commented Jul 10, 2026 •

Copy link
Copy Markdown
Member

Summary

Stacked on #19993.

The parent PR treats an explicit pre-release specifier as authorization for matching pre-releases to participate in normal version ordering. For example, when c==1.0 and c==2.0a1 are available, c>=0.5a1 can select the newer pre-release even though a compatible stable release exists.

This changes the default and deprecated explicit policies to prefer every compatible stable candidate before falling back to pre-releases. Exact pre-release pins and ranges with no compatible stable candidate still select pre-releases, and the ordering is consistent for direct and transitive requirements regardless of discovery order.

Since explicit requirements no longer change candidate ordering, the pre-release PubGrub proxy and its priority, pinning, and diagnostic plumbing are unnecessary and are removed. The candidate universe remains fixed per package identity: allow uses normal version ordering, disallow excludes pre-releases, and the default policy performs stable and then pre-release passes. Scenario expectations, user-facing documentation, and the generated schema are updated to match.

Comment thread crates/uv-cli/src/lib.rs Resolved

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't have the proxy and the authorization anymore here

@charliermarsh
charliermarsh force-pushed the charlie/transitive-prerelease-pubgrub branch from 4c394d2 to 1a28ba1 Compare July 10, 2026 20:53
@charliermarsh
charliermarsh force-pushed the charlie/stable-first-prereleases branch from 4c67e88 to 5bef129 Compare July 10, 2026 20:59
@astral-sh-bot

astral-sh-bot Bot commented Jul 10, 2026

Copy link
Copy Markdown

uv test inventory changes

This PR changes the tests when compared with the latest charlie/transitive-prerelease-pubgrub baseline.

  • Added tests: 27
  • Removed tests: 25
  • Changed suites: 4
uv::lock: +1 / -1

Added:

  • uv::lock::lock::lock_explicit_prerelease_mode

Removed:

  • uv::lock::lock::lock_legacy_explicit_prerelease_mode
uv::lock_scenarios: +5 / -5

Added:

  • uv::lock_scenarios::lock_scenarios::prerelease_base_marker_stable_preference_explicit_first
  • uv::lock_scenarios::lock_scenarios::prerelease_base_marker_stable_preference_plain_first
  • uv::lock_scenarios::lock_scenarios::prerelease_marker_equivalent_stable_preference
  • uv::lock_scenarios::lock_scenarios::prerelease_marker_stable_preference_backtracks
  • uv::lock_scenarios::lock_scenarios::transitive_prerelease_forks

Removed:

  • uv::lock_scenarios::lock_scenarios::prerelease_base_marker_authorization_explicit_first
  • uv::lock_scenarios::lock_scenarios::prerelease_base_marker_authorization_plain_first
  • uv::lock_scenarios::lock_scenarios::prerelease_marker_authorization_backtracks
  • uv::lock_scenarios::lock_scenarios::prerelease_marker_equivalent_authorization
  • uv::lock_scenarios::lock_scenarios::transitive_prerelease_authorization_forks
uv::pip: +18 / -18

Added:

  • uv::pip::pip_install_scenarios::prerelease_base_extra_stable_preference_after_backtrack
  • uv::pip::pip_install_scenarios::prerelease_base_extra_stable_preference_explicit_first
  • uv::pip::pip_install_scenarios::prerelease_base_extra_stable_preference_plain_first
  • uv::pip::pip_install_scenarios::prerelease_equivalent_stable_preference_explicit_first
  • uv::pip::pip_install_scenarios::prerelease_equivalent_stable_preference_plain_first
  • uv::pip::pip_install_scenarios::prerelease_extra_stable_preference
  • uv::pip::pip_install_scenarios::prerelease_extra_stable_preference_backtracks
  • uv::pip::pip_install_scenarios::prerelease_multiple_redundant_stable_preference
  • uv::pip::pip_install_scenarios::prerelease_multiple_redundant_stable_preference_explicit_first
  • uv::pip::pip_install_scenarios::prerelease_redundant_stable_preference_explicit_first
  • uv::pip::pip_install_scenarios::prerelease_redundant_stable_preference_plain_first
  • uv::pip::pip_install_scenarios::transitive_prerelease_after_decision
  • uv::pip::pip_install_scenarios::transitive_prerelease_backtracks
  • uv::pip::pip_install_scenarios::transitive_prerelease_equivalent_stable_preference_explicit_first
  • uv::pip::pip_install_scenarios::transitive_prerelease_equivalent_stable_preference_plain_first
  • uv::pip::pip_install_scenarios::transitive_prerelease_prefers_stable
  • uv::pip::pip_install_scenarios::transitive_prerelease_redundant_stable_preference_parent_first
  • uv::pip::pip_install_scenarios::transitive_prerelease_redundant_stable_preference_plain_first

Removed:

  • uv::pip::pip_install_scenarios::prerelease_base_extra_authorization_after_backtrack
  • uv::pip::pip_install_scenarios::prerelease_base_extra_authorization_explicit_first
  • uv::pip::pip_install_scenarios::prerelease_base_extra_authorization_plain_first
  • uv::pip::pip_install_scenarios::prerelease_equivalent_authorization_explicit_first
  • uv::pip::pip_install_scenarios::prerelease_equivalent_authorization_plain_first
  • uv::pip::pip_install_scenarios::prerelease_extra_authorization
  • uv::pip::pip_install_scenarios::prerelease_extra_authorization_backtracks
  • uv::pip::pip_install_scenarios::prerelease_multiple_redundant_authorization
  • uv::pip::pip_install_scenarios::prerelease_multiple_redundant_authorization_explicit_first
  • uv::pip::pip_install_scenarios::prerelease_redundant_authorization_explicit_first
  • uv::pip::pip_install_scenarios::prerelease_redundant_authorization_plain_first
  • uv::pip::pip_install_scenarios::transitive_prerelease_authorization_after_decision
  • uv::pip::pip_install_scenarios::transitive_prerelease_authorization_backtracks
  • uv::pip::pip_install_scenarios::transitive_prerelease_authorizes_newer_prerelease
  • uv::pip::pip_install_scenarios::transitive_prerelease_equivalent_authorization_explicit_first
  • uv::pip::pip_install_scenarios::transitive_prerelease_equivalent_authorization_plain_first
  • uv::pip::pip_install_scenarios::transitive_prerelease_redundant_authorization_parent_first
  • uv::pip::pip_install_scenarios::transitive_prerelease_redundant_authorization_plain_first
uv::pip_install: +3 / -1

Added:

  • uv::pip_install::pip_install::explicit_prerelease_allows_direct_marker
  • uv::pip_install::pip_install::explicit_prerelease_disallows_transitive_marker
  • uv::pip_install::pip_install::explicit_prerelease_does_not_fall_back_if_necessary

Removed:

  • uv::pip_install::pip_install::legacy_explicit_prerelease_falls_back_if_necessary

@charliermarsh
charliermarsh marked this pull request as ready for review July 10, 2026 22:47
@charliermarsh
charliermarsh force-pushed the charlie/stable-first-prereleases branch from f862b05 to 7944399 Compare July 10, 2026 22:58
@charliermarsh
charliermarsh merged commit 3e9e4a0 into charlie/transitive-prerelease-pubgrub Jul 10, 2026
55 checks passed
@charliermarsh
charliermarsh deleted the charlie/stable-first-prereleases branch July 10, 2026 23:16
@codspeed

codspeed Bot commented Jul 10, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

❌ 1 regressed benchmark
✅ 20 untouched benchmarks
⏩ 6 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
❌ WallTime resolve_warm_jupyter_universal 114.3 ms 119.6 ms -4.48%

Tip

Investigate this regression with the CodSpeed MCP and your agent.


Comparing charlie/stable-first-prereleases (6384d5a) with charlie/transitive-prerelease-pubgrub (414d2a1)

Open in CodSpeed

Footnotes

  1. 6 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

charliermarsh added a commit that referenced this pull request Jul 14, 2026
## Summary

Stacked on #19993.

The parent PR treats an explicit pre-release specifier as authorization
for matching pre-releases to participate in normal version ordering. For
example, when `c==1.0` and `c==2.0a1` are available, `c>=0.5a1` can
select the newer pre-release even though a compatible stable release
exists.

This changes the default and deprecated `explicit` policies to prefer
every compatible stable candidate before falling back to pre-releases.
Exact pre-release pins and ranges with no compatible stable candidate
still select pre-releases, and the ordering is consistent for direct and
transitive requirements regardless of discovery order.

Since explicit requirements no longer change candidate ordering, the
pre-release PubGrub proxy and its priority, pinning, and diagnostic
plumbing are unnecessary and are removed. The candidate universe remains
fixed per package identity: `allow` uses normal version ordering,
`disallow` excludes pre-releases, and the default policy performs stable
and then pre-release passes. Scenario expectations, user-facing
documentation, and the generated schema are updated to match.
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.

2 participants