Skip to content

Support installing local wheel variants - #22720

Merged
konstin merged 1 commit into
mainfrom
konsti/local-variant-wheels
Nov 5, 2026
Merged

konstin merged 1 commit into
mainfrom
konsti/local-variant-wheels

Conversation

@konstin

@konstin konstin commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Allow installing variant wheels specified from a local path, not only from the index as previously.

This change only support platform-specific resolutions, that is pip install/pip compile, but not pip compile --universal. This matches the current level of index support, universal resolution will follow separately. More broadyl, universal resolution, pylock.toml, installed-wheel invalidation, direct HTTP/Git wheel references, and arbitrary provider plugins are outside of the scope of this PR.

@konstin konstin added the preview Experimental behavior label Oct 19, 2026
@konstin
konstin requested a review from zsol October 19, 2026 10:16
@codspeed

codspeed Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

1 warning

⚠️ 7 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

✅ 89 untouched benchmarks
⏩ 84 skipped benchmarks1


Comparing konsti/local-variant-wheels (590e359) with main (68cde08)

Open in CodSpeed

Footnotes

  1. 84 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/local-variant-wheels branch from 123961b to 19c554c Compare October 19, 2026 11:36
@konstin
konstin force-pushed the konsti/local-variant-wheels branch from 19c554c to 3920fe5 Compare October 19, 2026 13:14
@konstin
konstin force-pushed the konsti/local-variant-wheels branch from 3920fe5 to 081f4cf Compare October 19, 2026 15:02
@konstin
konstin force-pushed the konsti/local-variant-wheels branch from 081f4cf to 461c40e Compare October 20, 2026 07:57
@konstin
konstin force-pushed the konsti/local-variant-wheels branch from 461c40e to 1fef26e Compare October 20, 2026 10:43
@konstin
konstin added this pull request to stack #22757 October 20, 2026 11:05
@konstin
konstin force-pushed the konsti/local-variant-wheels branch from 1fef26e to 92328bb Compare October 20, 2026 11:18
@konstin
konstin force-pushed the konsti/local-variant-wheels branch from 92328bb to 82f48af Compare October 20, 2026 11:29
@konstin
konstin force-pushed the konsti/local-variant-wheels branch from 82f48af to 194321a Compare October 20, 2026 11:39
@konstin
konstin removed this pull request from stack #22974 October 31, 2026 01:25
@konstin
konstin added this pull request to stack #23024 October 31, 2026 01:25
@konstin
konstin marked this pull request as ready for review October 31, 2026 01:29
@konstin
konstin requested a review from zsol October 31, 2026 01:29
@konstin
konstin force-pushed the konsti/local-variant-wheels branch from 1bc2cf6 to 8d3a915 Compare November 3, 2026 11:50
@konstin
konstin force-pushed the konsti/local-variant-wheels branch from 8d3a915 to b049443 Compare November 4, 2026 10:24
@konstin
konstin force-pushed the konsti/local-variant-wheels branch from b049443 to 37646df Compare November 5, 2026 10:39
pub async fn read_archive_wheel_variant(
filename: &WheelFilename,
path: &Path,
label: &VariantLabel,

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.

could we get the label from filename here? let's not give a chance for the caller to mess up

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.

At this stage, we're in a path that has to send back the contents as response to the request, but the variant in the filename is optional, so we'd have to introduce another error variant to send back.

Comment on lines +1911 to +1915
if filename.variant().is_some() {
return Err(PylockTomlErrorKind::ArchivePathWheelVariantUnsupported(
filename,
));
}

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.

do we have a pip sync test for a valid -null.whl in packages.archive.path (with variants enabled)?

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.

I'm punting on pylock.toml support altogether, I'll add support for the extended pylock.toml format separately, after uv.lock, for now I've updated the stack to reject variant wheels from there consistently.

This branch was previously deployed

1 inactive deployment
automations — 590e3596 Deployed Nov 5, 2026 by konstin via review | security / security review #53415
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