mirror of
https://github.com/astral-sh/uv.git
synced 2025-11-20 11:56:03 +00:00
Reject already-installed wheels that don't match the target platform (#15484)
## Summary We've received several requests to validate that installed wheels match the current Python platform. This isn't _super_ common, since it requires that your platform changes in some meaningful way (e.g., you switch from x86 to ARM), though in practice, it sounds like it _can_ happen in HPC environments. This seems like a good thing to do regardless, so we now validate that the tags (as recoded in `WHEEL`) are consistent with the current platform during installs. Closes https://github.com/astral-sh/uv/issues/15035.
This commit is contained in:
parent
563adb8904
commit
be4d5b72aa
25 changed files with 751 additions and 63 deletions
|
|
@ -5270,18 +5270,14 @@ impl WheelTagHint {
|
|||
fn python_tags<'a>(
|
||||
filenames: impl Iterator<Item = &'a WheelFilename> + 'a,
|
||||
) -> impl Iterator<Item = LanguageTag> + 'a {
|
||||
filenames
|
||||
.flat_map(uv_distribution_filename::WheelFilename::python_tags)
|
||||
.copied()
|
||||
filenames.flat_map(WheelFilename::python_tags).copied()
|
||||
}
|
||||
|
||||
/// Returns an iterator over the compatible Python tags of the available wheels.
|
||||
fn abi_tags<'a>(
|
||||
filenames: impl Iterator<Item = &'a WheelFilename> + 'a,
|
||||
) -> impl Iterator<Item = AbiTag> + 'a {
|
||||
filenames
|
||||
.flat_map(uv_distribution_filename::WheelFilename::abi_tags)
|
||||
.copied()
|
||||
filenames.flat_map(WheelFilename::abi_tags).copied()
|
||||
}
|
||||
|
||||
/// Returns the set of platform tags for the distribution that are ABI-compatible with the given
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue