Skip to content

Commit

Permalink
Override manylinux_compatible with --python-platform (#9526)
Browse files Browse the repository at this point in the history
## Summary

Closes #9521.
  • Loading branch information
charliermarsh authored Nov 29, 2024
1 parent b9740d4 commit 57900f3
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 4 deletions.
38 changes: 38 additions & 0 deletions crates/uv-configuration/src/target_triple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,44 @@ impl TargetTriple {
}
}

/// Return `true` if the platform is compatible with manylinux.
pub fn manylinux_compatible(self) -> bool {
match self {
Self::Windows | Self::X8664PcWindowsMsvc => false,
Self::Linux | Self::X8664UnknownLinuxGnu => true,
Self::Macos | Self::Aarch64AppleDarwin => false,
Self::I686PcWindowsMsvc => false,
Self::X8664AppleDarwin => false,
Self::Aarch64UnknownLinuxGnu => true,
Self::Aarch64UnknownLinuxMusl => true,
Self::X8664UnknownLinuxMusl => true,
Self::X8664Manylinux217 => true,
Self::X8664Manylinux228 => true,
Self::X8664Manylinux231 => true,
Self::X8664Manylinux232 => true,
Self::X8664Manylinux233 => true,
Self::X8664Manylinux234 => true,
Self::X8664Manylinux235 => true,
Self::X8664Manylinux236 => true,
Self::X8664Manylinux237 => true,
Self::X8664Manylinux238 => true,
Self::X8664Manylinux239 => true,
Self::X8664Manylinux240 => true,
Self::Aarch64Manylinux217 => true,
Self::Aarch64Manylinux228 => true,
Self::Aarch64Manylinux231 => true,
Self::Aarch64Manylinux232 => true,
Self::Aarch64Manylinux233 => true,
Self::Aarch64Manylinux234 => true,
Self::Aarch64Manylinux235 => true,
Self::Aarch64Manylinux236 => true,
Self::Aarch64Manylinux237 => true,
Self::Aarch64Manylinux238 => true,
Self::Aarch64Manylinux239 => true,
Self::Aarch64Manylinux240 => true,
}
}

/// Return a [`MarkerEnvironment`] compatible with the given [`TargetTriple`], based on
/// a base [`MarkerEnvironment`].
///
Expand Down
8 changes: 4 additions & 4 deletions crates/uv/src/commands/pip/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ pub(crate) fn resolution_tags<'env>(
(python_version.major(), python_version.minor()),
interpreter.implementation_name(),
interpreter.implementation_tuple(),
interpreter.manylinux_compatible(),
python_platform.manylinux_compatible(),
interpreter.gil_disabled(),
)?),
(Some(python_platform), None) => Cow::Owned(Tags::from_env(
&python_platform.platform(),
interpreter.python_tuple(),
interpreter.implementation_name(),
interpreter.implementation_tuple(),
interpreter.manylinux_compatible(),
python_platform.manylinux_compatible(),
interpreter.gil_disabled(),
)?),
(None, Some(python_version)) => Cow::Owned(Tags::from_env(
Expand All @@ -83,15 +83,15 @@ pub(crate) fn resolution_environment(
(python_version.major(), python_version.minor()),
interpreter.implementation_name(),
interpreter.implementation_tuple(),
interpreter.manylinux_compatible(),
python_platform.manylinux_compatible(),
interpreter.gil_disabled(),
)?),
(Some(python_platform), None) => Cow::Owned(Tags::from_env(
&python_platform.platform(),
interpreter.python_tuple(),
interpreter.implementation_name(),
interpreter.implementation_tuple(),
interpreter.manylinux_compatible(),
python_platform.manylinux_compatible(),
interpreter.gil_disabled(),
)?),
(None, Some(python_version)) => Cow::Owned(Tags::from_env(
Expand Down

0 comments on commit 57900f3

Please sign in to comment.