Skip to content

Select wheel variants without required properties - #22535

Merged
konstin merged 1 commit into
mainfrom
konsti/wheel-variant-compatibility
Oct 21, 2026
Merged

konstin merged 1 commit into
mainfrom
konsti/wheel-variant-compatibility

Conversation

@konstin

@konstin konstin commented Oct 14, 2026

Copy link
Copy Markdown
Member

Use index-level variant metadata to select wheels whose variant requires no properties, including the null variant. With wheel-variants enabled, these wheels are preferred over ordinary wheels after checking their platform tags and hashes.

Variant wheels requiring properties remain incompatible. Selection currently requires index-level variant metadata and applies to platform-specific resolutions; direct wheel URLs and universal lockfiles do not yet support variants.

Stacked on #22512.

@konstin
konstin force-pushed the konsti/wheel-variant-compatibility branch from 67accb0 to 5251cf2 Compare October 14, 2026 12:10
@codspeed

codspeed Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

2 warnings

⚠️ Unable to measure the execution of 1 benchmark

This benchmark measured no execution time, so its result is not comparable and counts as unchanged. This usually happens when the compiler removes the code under test.

Prevent compiler optimizations

See affected benchmarks

⚠️ 8 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

✅ 119 untouched benchmarks
⏩ 54 skipped benchmarks1


Comparing konsti/wheel-variant-compatibility (19556e6) with main (43001eb)

Open in CodSpeed

Footnotes

  1. 54 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. ↩

@konstin
konstin force-pushed the konsti/wheel-variant-compatibility branch from 3665e2d to 5566b42 Compare October 14, 2026 14:23
@konstin
konstin force-pushed the konsti/wheel-variant-compatibility branch from 5566b42 to 3b4589a Compare October 15, 2026 07:53
@konstin
konstin force-pushed the konsti/wheel-variant-compatibility branch from 3b4589a to a3fb5d3 Compare October 15, 2026 12:45
@konstin
konstin force-pushed the konsti/wheel-variant-compatibility branch from 12860ea to dcf9b78 Compare October 16, 2026 12:04
@konstin
konstin force-pushed the konsti/wheel-variant-compatibility branch from dcf9b78 to 969d516 Compare October 16, 2026 12:53
@konstin
konstin force-pushed the konsti/wheel-variant-compatibility branch from 969d516 to 1eff8eb Compare October 16, 2026 13:01
@konstin
konstin force-pushed the konsti/wheel-variant-compatibility branch from fbe4dc8 to bf1b253 Compare October 19, 2026 13:14
@konstin
konstin force-pushed the konsti/wheel-variant-compatibility branch from bf1b253 to c35364b Compare October 19, 2026 15:02
@konstin
konstin force-pushed the konsti/wheel-variant-compatibility branch from c35364b to 92f8570 Compare October 20, 2026 07:57
@konstin
konstin added this pull request to stack #22757 October 20, 2026 11:05
@konstin
konstin force-pushed the konsti/wheel-variant-compatibility branch from 92f8570 to afbb230 Compare October 20, 2026 11:18
@konstin
konstin force-pushed the konsti/wheel-variant-compatibility branch from afbb230 to f2b8da5 Compare October 20, 2026 11:29
Base automatically changed from konsti/wheel-variant-metadata to main October 20, 2026 11:39
@konstin
konstin force-pushed the konsti/wheel-variant-compatibility branch from f2b8da5 to f769ca5 Compare October 20, 2026 11:39
@astral-sh-bot

astral-sh-bot Bot commented Oct 20, 2026

Copy link
Copy Markdown

uv test inventory changes

This PR changes the tests when compared with the main base revision.

  • Added tests: 3
  • Removed tests: 0
  • Changed suites: 1
uv::pip_install: +3 / -0

Added:

  • uv::pip_install::wheel_variant_compatibility::pylock_rejects_selected_wheel_variant
  • uv::pip_install::wheel_variant_compatibility::streamed_variant_metadata_requires_one_dist_info_directory
  • uv::pip_install::wheel_variant_compatibility::sync_keeps_installed_variant

Removed: none

Comment on lines +1365 to +1371
// Select a variant only for a specific environment and an installable candidate.
// TODO(konsti): Check variant compatibility before reusing an installed candidate.
let variant = if env.marker_environment().is_some()
&& uv_preview::is_enabled(PreviewFeature::WheelVariants)
&& let Some(prioritized) = candidate.prioritized()
{
self.select_wheel_variant(candidate.version(), prioritized, version_maps, requests)?

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.

what should happen when a variant wheel is older than an --exclude-newer cutoff, but a regular wheel is newer?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Added this as a TODO in #22043, ideally that's too much of an edge case to run into it at all but we should bring it at least to the level we already support before stabilization.

This branch was previously deployed

1 inactive deployment
automations — 19556e66 Deployed Oct 21, 2026 by konstin via review / security review #52046
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

preview Experimental behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants