Support iOS platform tags (#15640)

## Summary
This implements the iOS part of
https://github.com/astral-sh/uv/issues/8029

FYI: @freakboy3742

<!-- What's the purpose of the change? What does it do, and why? -->

## Test Plan
Create a venv with uv and run `cargo run pip install --python-platform
arm64-apple-ios pillow`. Then the iOS binary of pillow should be
installed inside the venv.
This commit is contained in:
timrid 2025-09-04 00:24:48 +02:00 committed by GitHub
parent 50bfa8a689
commit 330e56e778
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 599 additions and 41 deletions

View file

@ -1446,8 +1446,11 @@ pub struct PipCompileArgs {
/// its CPU, vendor, and operating system name, like `x86_64-unknown-linux-gnu` or
/// `aarch64-apple-darwin`.
///
/// When targeting macOS (Darwin), the default minimum version is `12.0`. Use
/// `MACOSX_DEPLOYMENT_TARGET` to specify a different minimum version, e.g., `13.0`.
/// When targeting macOS (Darwin), the default minimum version is `13.0`. Use
/// `MACOSX_DEPLOYMENT_TARGET` to specify a different minimum version, e.g., `14.0`.
///
/// When targeting iOS, the default minimum version is `13.0`. Use
/// `IPHONEOS_DEPLOYMENT_TARGET` to specify a different minimum version, e.g., `14.0`.
///
/// When targeting Android, the default minimum Android API level is `24`. Use
/// `ANDROID_API_LEVEL` to specify a different minimum version, e.g., `26`.
@ -1775,8 +1778,11 @@ pub struct PipSyncArgs {
/// its CPU, vendor, and operating system name, like `x86_64-unknown-linux-gnu` or
/// `aarch64-apple-darwin`.
///
/// When targeting macOS (Darwin), the default minimum version is `12.0`. Use
/// `MACOSX_DEPLOYMENT_TARGET` to specify a different minimum version, e.g., `13.0`.
/// When targeting macOS (Darwin), the default minimum version is `13.0`. Use
/// `MACOSX_DEPLOYMENT_TARGET` to specify a different minimum version, e.g., `14.0`.
///
/// When targeting iOS, the default minimum version is `13.0`. Use
/// `IPHONEOS_DEPLOYMENT_TARGET` to specify a different minimum version, e.g., `14.0`.
///
/// When targeting Android, the default minimum Android API level is `24`. Use
/// `ANDROID_API_LEVEL` to specify a different minimum version, e.g., `26`.
@ -2081,8 +2087,11 @@ pub struct PipInstallArgs {
/// its CPU, vendor, and operating system name, like `x86_64-unknown-linux-gnu` or
/// `aarch64-apple-darwin`.
///
/// When targeting macOS (Darwin), the default minimum version is `12.0`. Use
/// `MACOSX_DEPLOYMENT_TARGET` to specify a different minimum version, e.g., `13.0`.
/// When targeting macOS (Darwin), the default minimum version is `13.0`. Use
/// `MACOSX_DEPLOYMENT_TARGET` to specify a different minimum version, e.g., `14.0`.
///
/// When targeting iOS, the default minimum version is `13.0`. Use
/// `IPHONEOS_DEPLOYMENT_TARGET` to specify a different minimum version, e.g., `14.0`.
///
/// When targeting Android, the default minimum Android API level is `24`. Use
/// `ANDROID_API_LEVEL` to specify a different minimum version, e.g., `26`.
@ -2407,8 +2416,11 @@ pub struct PipCheckArgs {
/// its CPU, vendor, and operating system name, like `x86_64-unknown-linux-gnu` or
/// `aarch64-apple-darwin`.
///
/// When targeting macOS (Darwin), the default minimum version is `12.0`. Use
/// `MACOSX_DEPLOYMENT_TARGET` to specify a different minimum version, e.g., `13.0`.
/// When targeting macOS (Darwin), the default minimum version is `13.0`. Use
/// `MACOSX_DEPLOYMENT_TARGET` to specify a different minimum version, e.g., `14.0`.
///
/// When targeting iOS, the default minimum version is `13.0`. Use
/// `IPHONEOS_DEPLOYMENT_TARGET` to specify a different minimum version, e.g., `14.0`.
///
/// When targeting Android, the default minimum Android API level is `24`. Use
/// `ANDROID_API_LEVEL` to specify a different minimum version, e.g., `26`.
@ -3335,8 +3347,11 @@ pub struct RunArgs {
/// its CPU, vendor, and operating system name, like `x86_64-unknown-linux-gnu` or
/// `aarch64-apple-darwin`.
///
/// When targeting macOS (Darwin), the default minimum version is `12.0`. Use
/// `MACOSX_DEPLOYMENT_TARGET` to specify a different minimum version, e.g., `13.0`.
/// When targeting macOS (Darwin), the default minimum version is `13.0`. Use
/// `MACOSX_DEPLOYMENT_TARGET` to specify a different minimum version, e.g., `14.0`.
///
/// When targeting iOS, the default minimum version is `13.0`. Use
/// `IPHONEOS_DEPLOYMENT_TARGET` to specify a different minimum version, e.g., `14.0`.
///
/// When targeting Android, the default minimum Android API level is `24`. Use
/// `ANDROID_API_LEVEL` to specify a different minimum version, e.g., `26`.
@ -3615,8 +3630,11 @@ pub struct SyncArgs {
/// its CPU, vendor, and operating system name, like `x86_64-unknown-linux-gnu` or
/// `aarch64-apple-darwin`.
///
/// When targeting macOS (Darwin), the default minimum version is `12.0`. Use
/// `MACOSX_DEPLOYMENT_TARGET` to specify a different minimum version, e.g., `13.0`.
/// When targeting macOS (Darwin), the default minimum version is `13.0`. Use
/// `MACOSX_DEPLOYMENT_TARGET` to specify a different minimum version, e.g., `14.0`.
///
/// When targeting iOS, the default minimum version is `13.0`. Use
/// `IPHONEOS_DEPLOYMENT_TARGET` to specify a different minimum version, e.g., `14.0`.
///
/// When targeting Android, the default minimum Android API level is `24`. Use
/// `ANDROID_API_LEVEL` to specify a different minimum version, e.g., `26`.
@ -4641,8 +4659,11 @@ pub struct ToolRunArgs {
/// its CPU, vendor, and operating system name, like `x86_64-unknown-linux-gnu` or
/// `aarch64-apple-darwin`.
///
/// When targeting macOS (Darwin), the default minimum version is `12.0`. Use
/// `MACOSX_DEPLOYMENT_TARGET` to specify a different minimum version, e.g., `13.0`.
/// When targeting macOS (Darwin), the default minimum version is `13.0`. Use
/// `MACOSX_DEPLOYMENT_TARGET` to specify a different minimum version, e.g., `14.0`.
///
/// When targeting iOS, the default minimum version is `13.0`. Use
/// `IPHONEOS_DEPLOYMENT_TARGET` to specify a different minimum version, e.g., `14.0`.
///
/// When targeting Android, the default minimum Android API level is `24`. Use
/// `ANDROID_API_LEVEL` to specify a different minimum version, e.g., `26`.
@ -4766,8 +4787,11 @@ pub struct ToolInstallArgs {
/// its CPU, vendor, and operating system name, like `x86_64-unknown-linux-gnu` or
/// `aarch64-apple-darwin`.
///
/// When targeting macOS (Darwin), the default minimum version is `12.0`. Use
/// `MACOSX_DEPLOYMENT_TARGET` to specify a different minimum version, e.g., `13.0`.
/// When targeting macOS (Darwin), the default minimum version is `13.0`. Use
/// `MACOSX_DEPLOYMENT_TARGET` to specify a different minimum version, e.g., `14.0`.
///
/// When targeting iOS, the default minimum version is `13.0`. Use
/// `IPHONEOS_DEPLOYMENT_TARGET` to specify a different minimum version, e.g., `14.0`.
///
/// When targeting Android, the default minimum Android API level is `24`. Use
/// `ANDROID_API_LEVEL` to specify a different minimum version, e.g., `26`.
@ -4866,8 +4890,11 @@ pub struct ToolUpgradeArgs {
/// its CPU, vendor, and operating system name, like `x86_64-unknown-linux-gnu` or
/// `aarch64-apple-darwin`.
///
/// When targeting macOS (Darwin), the default minimum version is `12.0`. Use
/// `MACOSX_DEPLOYMENT_TARGET` to specify a different minimum version, e.g., `13.0`.
/// When targeting macOS (Darwin), the default minimum version is `13.0`. Use
/// `MACOSX_DEPLOYMENT_TARGET` to specify a different minimum version, e.g., `14.0`.
///
/// When targeting iOS, the default minimum version is `13.0`. Use
/// `IPHONEOS_DEPLOYMENT_TARGET` to specify a different minimum version, e.g., `14.0`.
///
/// When targeting Android, the default minimum Android API level is `24`. Use
/// `ANDROID_API_LEVEL` to specify a different minimum version, e.g., `26`.

View file

@ -257,6 +257,30 @@ pub enum TargetTriple {
/// A wasm32 target using the Pyodide 2024 platform. Meant for use with Python 3.12.
#[cfg_attr(feature = "clap", value(name = "wasm32-pyodide2024"))]
Wasm32Pyodide2024,
/// An ARM64 target for iOS device
///
/// By default, iOS 13.0 is used, but respects the `IPHONEOS_DEPLOYMENT_TARGET`
/// environment variable if set.
#[cfg_attr(feature = "clap", value(name = "arm64-apple-ios"))]
#[serde(rename = "arm64-apple-ios")]
Arm64Ios,
/// An ARM64 target for iOS simulator
///
/// By default, iOS 13.0 is used, but respects the `IPHONEOS_DEPLOYMENT_TARGET`
/// environment variable if set.
#[cfg_attr(feature = "clap", value(name = "arm64-apple-ios-simulator"))]
#[serde(rename = "arm64-apple-ios-simulator")]
Arm64IosSimulator,
/// An `x86_64` target for iOS simulator
///
/// By default, iOS 13.0 is used, but respects the `IPHONEOS_DEPLOYMENT_TARGET`
/// environment variable if set.
#[cfg_attr(feature = "clap", value(name = "x86_64-apple-ios-simulator"))]
#[serde(rename = "x86_64-apple-ios-simulator")]
X8664IosSimulator,
}
impl TargetTriple {
@ -510,6 +534,48 @@ impl TargetTriple {
});
Platform::new(Os::Android { api_level }, Arch::X86_64)
}
Self::Arm64Ios => {
let (major, minor) = ios_deployment_target().map_or((13, 0), |(major, minor)| {
debug!("Found iOS deployment target: {}.{}", major, minor);
(major, minor)
});
Platform::new(
Os::Ios {
major,
minor,
simulator: false,
},
Arch::Aarch64,
)
}
Self::Arm64IosSimulator => {
let (major, minor) = ios_deployment_target().map_or((13, 0), |(major, minor)| {
debug!("Found iOS deployment target: {}.{}", major, minor);
(major, minor)
});
Platform::new(
Os::Ios {
major,
minor,
simulator: true,
},
Arch::Aarch64,
)
}
Self::X8664IosSimulator => {
let (major, minor) = ios_deployment_target().map_or((13, 0), |(major, minor)| {
debug!("Found iOS deployment target: {}.{}", major, minor);
(major, minor)
});
Platform::new(
Os::Ios {
major,
minor,
simulator: true,
},
Arch::X86_64,
)
}
}
}
@ -555,6 +621,9 @@ impl TargetTriple {
Self::Aarch64LinuxAndroid => "aarch64",
Self::X8664LinuxAndroid => "x86_64",
Self::Wasm32Pyodide2024 => "wasm32",
Self::Arm64Ios => "arm64",
Self::Arm64IosSimulator => "arm64",
Self::X8664IosSimulator => "x86_64",
}
}
@ -600,6 +669,9 @@ impl TargetTriple {
Self::Aarch64LinuxAndroid => "Android",
Self::X8664LinuxAndroid => "Android",
Self::Wasm32Pyodide2024 => "Emscripten",
Self::Arm64Ios => "iOS",
Self::Arm64IosSimulator => "iOS",
Self::X8664IosSimulator => "iOS",
}
}
@ -648,6 +720,9 @@ impl TargetTriple {
// https://github.com/emscripten-core/emscripten/blob/4.0.8/system/lib/libc/emscripten_syscall_stubs.c#L63
// It doesn't really seem to mean anything? But for completeness we include it here.
Self::Wasm32Pyodide2024 => "#1",
Self::Arm64Ios => "",
Self::Arm64IosSimulator => "",
Self::X8664IosSimulator => "",
}
}
@ -695,6 +770,9 @@ impl TargetTriple {
// This is the Emscripten compiler version for Pyodide 2024.
// See https://pyodide.org/en/stable/development/abi.html#pyodide-2024-0
Self::Wasm32Pyodide2024 => "3.1.58",
Self::Arm64Ios => "",
Self::Arm64IosSimulator => "",
Self::X8664IosSimulator => "",
}
}
@ -740,6 +818,9 @@ impl TargetTriple {
Self::Aarch64LinuxAndroid => "posix",
Self::X8664LinuxAndroid => "posix",
Self::Wasm32Pyodide2024 => "posix",
Self::Arm64Ios => "posix",
Self::Arm64IosSimulator => "posix",
Self::X8664IosSimulator => "posix",
}
}
@ -785,6 +866,9 @@ impl TargetTriple {
Self::Aarch64LinuxAndroid => "android",
Self::X8664LinuxAndroid => "android",
Self::Wasm32Pyodide2024 => "emscripten",
Self::Arm64Ios => "ios",
Self::Arm64IosSimulator => "ios",
Self::X8664IosSimulator => "ios",
}
}
@ -830,6 +914,9 @@ impl TargetTriple {
Self::Aarch64LinuxAndroid => false,
Self::X8664LinuxAndroid => false,
Self::Wasm32Pyodide2024 => false,
Self::Arm64Ios => false,
Self::Arm64IosSimulator => false,
Self::X8664IosSimulator => false,
}
}
@ -863,6 +950,20 @@ fn macos_deployment_target() -> Option<(u16, u16)> {
Some((major, minor))
}
/// Return the iOS deployment target as parsed from the environment.
fn ios_deployment_target() -> Option<(u16, u16)> {
let version = std::env::var(EnvVars::IPHONEOS_DEPLOYMENT_TARGET).ok()?;
let mut parts = version.split('.');
// Parse the major version (e.g., `12` in `12.0`).
let major = parts.next()?.parse::<u16>().ok()?;
// Parse the minor version (e.g., `0` in `12.0`), with a default of `0`.
let minor = parts.next().unwrap_or("0").parse::<u16>().ok()?;
Some((major, minor))
}
/// Return the Android API level as parsed from the environment.
fn android_api_level() -> Option<u16> {
let api_level_str = std::env::var(EnvVars::ANDROID_API_LEVEL).ok()?;

View file

@ -42,18 +42,50 @@ impl Platform {
#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(tag = "name", rename_all = "lowercase")]
pub enum Os {
Manylinux { major: u16, minor: u16 },
Musllinux { major: u16, minor: u16 },
Manylinux {
major: u16,
minor: u16,
},
Musllinux {
major: u16,
minor: u16,
},
Windows,
Pyodide { major: u16, minor: u16 },
Macos { major: u16, minor: u16 },
FreeBsd { release: String },
NetBsd { release: String },
OpenBsd { release: String },
Dragonfly { release: String },
Illumos { release: String, arch: String },
Haiku { release: String },
Android { api_level: u16 },
Pyodide {
major: u16,
minor: u16,
},
Macos {
major: u16,
minor: u16,
},
FreeBsd {
release: String,
},
NetBsd {
release: String,
},
OpenBsd {
release: String,
},
Dragonfly {
release: String,
},
Illumos {
release: String,
arch: String,
},
Haiku {
release: String,
},
Android {
api_level: u16,
},
Ios {
major: u16,
minor: u16,
simulator: bool,
},
}
impl fmt::Display for Os {
@ -71,6 +103,7 @@ impl fmt::Display for Os {
Self::Haiku { .. } => write!(f, "haiku"),
Self::Android { .. } => write!(f, "android"),
Self::Pyodide { .. } => write!(f, "pyodide"),
Self::Ios { .. } => write!(f, "ios"),
}
}
}

View file

@ -4,6 +4,7 @@ use std::str::FromStr;
use uv_small_str::SmallString;
use crate::tags::AndroidAbi;
use crate::tags::IosMultiarch;
use crate::{Arch, BinaryFormat};
/// A tag to represent the platform compatibility of a Python distribution.
@ -74,6 +75,12 @@ pub enum PlatformTag {
Solaris { release_arch: SmallString },
/// Ex) `pyodide_2024_0_wasm32`
Pyodide { major: u16, minor: u16 },
/// Ex) `ios_13_0_arm64_iphoneos` / `ios_13_0_arm64_iphonesimulator`
Ios {
major: u16,
minor: u16,
multiarch: IosMultiarch,
},
}
impl PlatformTag {
@ -101,6 +108,7 @@ impl PlatformTag {
Self::Illumos { .. } => Some("Illumos"),
Self::Solaris { .. } => Some("Solaris"),
Self::Pyodide { .. } => Some("Pyodide"),
Self::Ios { .. } => Some("iOS"),
}
}
}
@ -178,6 +186,9 @@ impl PlatformTag {
} | Self::Macos {
binary_format: BinaryFormat::Arm64,
..
} | Self::Ios {
multiarch: IosMultiarch::Arm64Device | IosMultiarch::Arm64Simulator,
..
} | Self::WinArm64
| Self::Android {
abi: AndroidAbi::Arm64V8a,
@ -211,6 +222,9 @@ impl PlatformTag {
} | Self::Macos {
binary_format: BinaryFormat::X86_64,
..
} | Self::Ios {
multiarch: IosMultiarch::X86_64Simulator,
..
} | Self::WinAmd64
)
}
@ -277,6 +291,11 @@ impl std::fmt::Display for PlatformTag {
Self::Illumos { release_arch } => write!(f, "illumos_{release_arch}"),
Self::Solaris { release_arch } => write!(f, "solaris_{release_arch}_64bit"),
Self::Pyodide { major, minor } => write!(f, "pyodide_{major}_{minor}_wasm32"),
Self::Ios {
major,
minor,
multiarch,
} => write!(f, "ios_{major}_{minor}_{multiarch}"),
}
}
}
@ -660,6 +679,59 @@ impl FromStr for PlatformTag {
return Ok(Self::Pyodide { major, minor });
}
if let Some(rest) = s.strip_prefix("ios_") {
// Ex) ios_13_0_arm64_iphoneos
let first_underscore = memchr::memchr(b'_', rest.as_bytes()).ok_or_else(|| {
ParsePlatformTagError::InvalidFormat {
platform: "ios",
tag: s.to_string(),
}
})?;
let second_underscore = memchr::memchr(b'_', &rest.as_bytes()[first_underscore + 1..])
.map(|i| i + first_underscore + 1)
.ok_or_else(|| ParsePlatformTagError::InvalidFormat {
platform: "ios",
tag: s.to_string(),
})?;
let major = rest[..first_underscore].parse().map_err(|_| {
ParsePlatformTagError::InvalidMajorVersion {
platform: "ios",
tag: s.to_string(),
}
})?;
let minor = rest[first_underscore + 1..second_underscore]
.parse()
.map_err(|_| ParsePlatformTagError::InvalidMinorVersion {
platform: "ios",
tag: s.to_string(),
})?;
let multiarch_str = &rest[second_underscore + 1..];
if multiarch_str.is_empty() {
return Err(ParsePlatformTagError::InvalidFormat {
platform: "ios",
tag: s.to_string(),
});
}
let multiarch =
multiarch_str
.parse()
.map_err(|_| ParsePlatformTagError::InvalidArch {
platform: "ios",
tag: s.to_string(),
})?;
return Ok(Self::Ios {
major,
minor,
multiarch,
});
}
Err(ParsePlatformTagError::UnknownFormat(s.to_string()))
}
}
@ -686,6 +758,7 @@ mod tests {
use crate::platform_tag::{ParsePlatformTagError, PlatformTag};
use crate::tags::AndroidAbi;
use crate::tags::IosMultiarch;
use crate::{Arch, BinaryFormat};
#[test]
@ -995,6 +1068,44 @@ mod tests {
);
}
#[test]
fn ios_platform() {
let tag = PlatformTag::Ios {
major: 13,
minor: 0,
multiarch: IosMultiarch::Arm64Device,
};
assert_eq!(
PlatformTag::from_str("ios_13_0_arm64_iphoneos").as_ref(),
Ok(&tag)
);
assert_eq!(tag.to_string(), "ios_13_0_arm64_iphoneos");
assert_eq!(
PlatformTag::from_str("ios_x_0_arm64_iphoneos"),
Err(ParsePlatformTagError::InvalidMajorVersion {
platform: "ios",
tag: "ios_x_0_arm64_iphoneos".to_string()
})
);
assert_eq!(
PlatformTag::from_str("ios_13_x_arm64_iphoneos"),
Err(ParsePlatformTagError::InvalidMinorVersion {
platform: "ios",
tag: "ios_13_x_arm64_iphoneos".to_string()
})
);
assert_eq!(
PlatformTag::from_str("ios_13_0_invalid_iphoneos"),
Err(ParsePlatformTagError::InvalidArch {
platform: "ios",
tag: "ios_13_0_invalid_iphoneos".to_string()
})
);
}
#[test]
fn unknown_platform() {
assert_eq!(

View file

@ -633,6 +633,60 @@ fn compatible_tags(platform: &Platform) -> Result<Vec<PlatformTag>, PlatformErro
minor: *minor,
}]
}
(
Os::Ios {
major,
minor,
simulator,
},
arch,
) => {
// Source: https://github.com/pypa/packaging/blob/e9b9d09ebc5992ecad1799da22ee5faefb9cc7cb/src/packaging/tags.py#L484
let mut platform_tags = vec![];
let multiarch = IosMultiarch::from_arch(arch, *simulator)
.map_err(PlatformError::ArchDetectionError)?;
// Consider any iOS major.minor version from the version requested, down to
// 12.0. 12.0 is the first iOS version that is known to have enough features
// to support CPython. Consider every possible minor release up to X.9. The
// highest the minor has ever gone is 8 (14.8 and 15.8) but having some extra
// candidates that won't ever match doesn't really hurt, and it saves us from
// having to keep an explicit list of known iOS versions in the code. Return
// the results descending order of version number.
// If the requested major version is less than 12, there won't be any matches.
if *major < 12 {
return Ok(platform_tags);
}
// Consider the actual X.Y version that was requested.
platform_tags.push(PlatformTag::Ios {
major: *major,
minor: *minor,
multiarch,
});
// Consider every minor version from X.0 to the minor version prior to the
// version requested by the platform.
for min in (0..*minor).rev() {
platform_tags.push(PlatformTag::Ios {
major: *major,
minor: min,
multiarch,
});
}
for maj in (12..*major).rev() {
for min in (0..=9).rev() {
platform_tags.push(PlatformTag::Ios {
major: maj,
minor: min,
multiarch,
});
}
}
platform_tags
}
_ => {
return Err(PlatformError::OsVersionDetectionError(format!(
"Unsupported operating system and architecture combination: {os} {arch}"
@ -834,6 +888,73 @@ impl AndroidAbi {
}
}
#[derive(
Debug,
Copy,
Clone,
Eq,
PartialEq,
Ord,
PartialOrd,
Hash,
rkyv::Archive,
rkyv::Deserialize,
rkyv::Serialize,
)]
#[rkyv(derive(Debug))]
pub enum IosMultiarch {
// Source: https://packaging.python.org/en/latest/specifications/platform-compatibility-tags/#ios
Arm64Device,
Arm64Simulator,
X86_64Simulator,
}
impl std::fmt::Display for IosMultiarch {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
write!(f, "{}", self.name())
}
}
impl FromStr for IosMultiarch {
type Err = String;
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"arm64_iphoneos" => Ok(Self::Arm64Device),
"arm64_iphonesimulator" => Ok(Self::Arm64Simulator),
"x86_64_iphonesimulator" => Ok(Self::X86_64Simulator),
_ => Err(format!("Invalid multiarch format: {s}")),
}
}
}
impl IosMultiarch {
/// Determine the appropriate multiarch for a iOS version.
pub fn from_arch(arch: Arch, simulator: bool) -> Result<Self, String> {
if simulator {
match arch {
Arch::Aarch64 => Ok(Self::Arm64Simulator),
Arch::X86_64 => Ok(Self::X86_64Simulator),
_ => Err(format!("Invalid iOS simulator arch: {arch}")),
}
} else {
match arch {
Arch::Aarch64 => Ok(Self::Arm64Device),
_ => Err(format!("Invalid iOS device arch: {arch}")),
}
}
}
/// Return the canonical name of the binary format.
pub fn name(self) -> &'static str {
match self {
Self::Arm64Device => "arm64_iphoneos",
Self::Arm64Simulator => "arm64_iphonesimulator",
Self::X86_64Simulator => "x86_64_iphonesimulator",
}
}
}
#[cfg(test)]
mod tests {
use insta::{assert_debug_snapshot, assert_snapshot};
@ -1234,6 +1355,98 @@ mod tests {
);
}
#[test]
fn test_platform_tags_ios() {
let tags = compatible_tags(&Platform::new(
Os::Ios {
major: 11,
minor: 0,
simulator: false,
},
Arch::Aarch64,
))
.unwrap();
let tags = tags.iter().map(ToString::to_string).collect::<Vec<_>>();
assert_debug_snapshot!(
tags,
@r###"
[]
"###
);
let tags = compatible_tags(&Platform::new(
Os::Ios {
major: 12,
minor: 3,
simulator: false,
},
Arch::Aarch64,
))
.unwrap();
let tags = tags.iter().map(ToString::to_string).collect::<Vec<_>>();
assert_debug_snapshot!(
tags,
@r###"
[
"ios_12_3_arm64_iphoneos",
"ios_12_2_arm64_iphoneos",
"ios_12_1_arm64_iphoneos",
"ios_12_0_arm64_iphoneos",
]
"###
);
let tags = compatible_tags(&Platform::new(
Os::Ios {
major: 15,
minor: 1,
simulator: false,
},
Arch::Aarch64,
))
.unwrap();
let tags = tags.iter().map(ToString::to_string).collect::<Vec<_>>();
assert_debug_snapshot!(
tags,
@r###"
[
"ios_15_1_arm64_iphoneos",
"ios_15_0_arm64_iphoneos",
"ios_14_9_arm64_iphoneos",
"ios_14_8_arm64_iphoneos",
"ios_14_7_arm64_iphoneos",
"ios_14_6_arm64_iphoneos",
"ios_14_5_arm64_iphoneos",
"ios_14_4_arm64_iphoneos",
"ios_14_3_arm64_iphoneos",
"ios_14_2_arm64_iphoneos",
"ios_14_1_arm64_iphoneos",
"ios_14_0_arm64_iphoneos",
"ios_13_9_arm64_iphoneos",
"ios_13_8_arm64_iphoneos",
"ios_13_7_arm64_iphoneos",
"ios_13_6_arm64_iphoneos",
"ios_13_5_arm64_iphoneos",
"ios_13_4_arm64_iphoneos",
"ios_13_3_arm64_iphoneos",
"ios_13_2_arm64_iphoneos",
"ios_13_1_arm64_iphoneos",
"ios_13_0_arm64_iphoneos",
"ios_12_9_arm64_iphoneos",
"ios_12_8_arm64_iphoneos",
"ios_12_7_arm64_iphoneos",
"ios_12_6_arm64_iphoneos",
"ios_12_5_arm64_iphoneos",
"ios_12_4_arm64_iphoneos",
"ios_12_3_arm64_iphoneos",
"ios_12_2_arm64_iphoneos",
"ios_12_1_arm64_iphoneos",
"ios_12_0_arm64_iphoneos",
]
"###
);
}
/// Ensure the tags returned do not include the `manylinux` tags
/// when `manylinux_incompatible` is set to `false`.
#[test]

View file

@ -107,6 +107,9 @@ impl From<&uv_platform_tags::Os> for Os {
uv_platform_tags::Os::Pyodide { .. } => {
Self::new(target_lexicon::OperatingSystem::Emscripten)
}
uv_platform_tags::Os::Ios { .. } => {
Self::new(target_lexicon::OperatingSystem::IOS(None))
}
}
}
}

View file

@ -531,6 +531,12 @@ impl EnvVars {
/// Defaults to `13.0`, the least-recent non-EOL macOS version at time of writing.
pub const MACOSX_DEPLOYMENT_TARGET: &'static str = "MACOSX_DEPLOYMENT_TARGET";
/// Used with `--python-platform arm64-apple-ios` and related variants to set the
/// deployment target (i.e., the minimum supported iOS version).
///
/// Defaults to `13.0`.
pub const IPHONEOS_DEPLOYMENT_TARGET: &'static str = "IPHONEOS_DEPLOYMENT_TARGET";
/// Used with `--python-platform aarch64-linux-android` and related variants to set the
/// Android API level. (i.e., the minimum supported Android API level).
///

View file

@ -339,7 +339,8 @@ impl TorchStrategy {
| Os::Illumos { .. }
| Os::Haiku { .. }
| Os::Android { .. }
| Os::Pyodide { .. } => {
| Os::Pyodide { .. }
| Os::Ios { .. } => {
Either::Right(Either::Left(std::iter::once(TorchBackend::Cpu.index_url())))
}
}
@ -369,7 +370,8 @@ impl TorchStrategy {
| Os::Illumos { .. }
| Os::Haiku { .. }
| Os::Android { .. }
| Os::Pyodide { .. } => {
| Os::Pyodide { .. }
| Os::Ios { .. } => {
Either::Right(Either::Left(std::iter::once(TorchBackend::Cpu.index_url())))
}
},
@ -387,7 +389,8 @@ impl TorchStrategy {
| Os::Illumos { .. }
| Os::Haiku { .. }
| Os::Android { .. }
| Os::Pyodide { .. } => {
| Os::Pyodide { .. }
| Os::Ios { .. } => {
Either::Right(Either::Left(std::iter::once(TorchBackend::Cpu.index_url())))
}
},

View file

@ -537,7 +537,8 @@ used.</p>
<p>See <a href="#uv-python">uv python</a> to view supported request formats.</p>
<p>May also be set with the <code>UV_PYTHON</code> environment variable.</p></dd><dt id="uv-run--python-platform"><a href="#uv-run--python-platform"><code>--python-platform</code></a> <i>python-platform</i></dt><dd><p>The platform for which requirements should be installed.</p>
<p>Represented as a &quot;target triple&quot;, a string that describes the target platform in terms of its CPU, vendor, and operating system name, like <code>x86_64-unknown-linux-gnu</code> or <code>aarch64-apple-darwin</code>.</p>
<p>When targeting macOS (Darwin), the default minimum version is <code>12.0</code>. Use <code>MACOSX_DEPLOYMENT_TARGET</code> to specify a different minimum version, e.g., <code>13.0</code>.</p>
<p>When targeting macOS (Darwin), the default minimum version is <code>13.0</code>. Use <code>MACOSX_DEPLOYMENT_TARGET</code> to specify a different minimum version, e.g., <code>14.0</code>.</p>
<p>When targeting iOS, the default minimum version is <code>13.0</code>. Use <code>IPHONEOS_DEPLOYMENT_TARGET</code> to specify a different minimum version, e.g., <code>14.0</code>.</p>
<p>When targeting Android, the default minimum Android API level is <code>24</code>. Use <code>ANDROID_API_LEVEL</code> to specify a different minimum version, e.g., <code>26</code>.</p>
<p>WARNING: When specified, uv will select wheels that are compatible with the <em>target</em> platform; as a result, the installed distributions may not be compatible with the <em>current</em> platform. Conversely, any distributions that are built from source may be incompatible with the <em>target</em> platform, as they will be built for the <em>current</em> platform. The <code>--python-platform</code> option is intended for advanced use cases.</p>
<p>Possible values:</p>
@ -584,6 +585,9 @@ used.</p>
<li><code>aarch64-linux-android</code>: An ARM64 Android target</li>
<li><code>x86_64-linux-android</code>: An <code>x86_64</code> Android target</li>
<li><code>wasm32-pyodide2024</code>: A wasm32 target using the Pyodide 2024 platform. Meant for use with Python 3.12</li>
<li><code>arm64-apple-ios</code>: An ARM64 target for iOS device</li>
<li><code>arm64-apple-ios-simulator</code>: An ARM64 target for iOS simulator</li>
<li><code>x86_64-apple-ios-simulator</code>: An <code>x86_64</code> target for iOS simulator</li>
</ul></dd><dt id="uv-run--quiet"><a href="#uv-run--quiet"><code>--quiet</code></a>, <code>-q</code></dt><dd><p>Use quiet output.</p>
<p>Repeating this option, e.g., <code>-qq</code>, will enable a silent mode in which uv will write no output to stdout.</p>
</dd><dt id="uv-run--refresh"><a href="#uv-run--refresh"><code>--refresh</code></a></dt><dd><p>Refresh all cached data</p>
@ -1533,7 +1537,8 @@ environment in the project.</p>
<p>See <a href="#uv-python">uv python</a> for details on Python discovery and supported request formats.</p>
<p>May also be set with the <code>UV_PYTHON</code> environment variable.</p></dd><dt id="uv-sync--python-platform"><a href="#uv-sync--python-platform"><code>--python-platform</code></a> <i>python-platform</i></dt><dd><p>The platform for which requirements should be installed.</p>
<p>Represented as a &quot;target triple&quot;, a string that describes the target platform in terms of its CPU, vendor, and operating system name, like <code>x86_64-unknown-linux-gnu</code> or <code>aarch64-apple-darwin</code>.</p>
<p>When targeting macOS (Darwin), the default minimum version is <code>12.0</code>. Use <code>MACOSX_DEPLOYMENT_TARGET</code> to specify a different minimum version, e.g., <code>13.0</code>.</p>
<p>When targeting macOS (Darwin), the default minimum version is <code>13.0</code>. Use <code>MACOSX_DEPLOYMENT_TARGET</code> to specify a different minimum version, e.g., <code>14.0</code>.</p>
<p>When targeting iOS, the default minimum version is <code>13.0</code>. Use <code>IPHONEOS_DEPLOYMENT_TARGET</code> to specify a different minimum version, e.g., <code>14.0</code>.</p>
<p>When targeting Android, the default minimum Android API level is <code>24</code>. Use <code>ANDROID_API_LEVEL</code> to specify a different minimum version, e.g., <code>26</code>.</p>
<p>WARNING: When specified, uv will select wheels that are compatible with the <em>target</em> platform; as a result, the installed distributions may not be compatible with the <em>current</em> platform. Conversely, any distributions that are built from source may be incompatible with the <em>target</em> platform, as they will be built for the <em>current</em> platform. The <code>--python-platform</code> option is intended for advanced use cases.</p>
<p>Possible values:</p>
@ -1580,6 +1585,9 @@ environment in the project.</p>
<li><code>aarch64-linux-android</code>: An ARM64 Android target</li>
<li><code>x86_64-linux-android</code>: An <code>x86_64</code> Android target</li>
<li><code>wasm32-pyodide2024</code>: A wasm32 target using the Pyodide 2024 platform. Meant for use with Python 3.12</li>
<li><code>arm64-apple-ios</code>: An ARM64 target for iOS device</li>
<li><code>arm64-apple-ios-simulator</code>: An ARM64 target for iOS simulator</li>
<li><code>x86_64-apple-ios-simulator</code>: An <code>x86_64</code> target for iOS simulator</li>
</ul></dd><dt id="uv-sync--quiet"><a href="#uv-sync--quiet"><code>--quiet</code></a>, <code>-q</code></dt><dd><p>Use quiet output.</p>
<p>Repeating this option, e.g., <code>-qq</code>, will enable a silent mode in which uv will write no output to stdout.</p>
</dd><dt id="uv-sync--refresh"><a href="#uv-sync--refresh"><code>--refresh</code></a></dt><dd><p>Refresh all cached data</p>
@ -2183,6 +2191,9 @@ interpreter. Use <code>--universal</code> to display the tree for all platforms,
<li><code>aarch64-linux-android</code>: An ARM64 Android target</li>
<li><code>x86_64-linux-android</code>: An <code>x86_64</code> Android target</li>
<li><code>wasm32-pyodide2024</code>: A wasm32 target using the Pyodide 2024 platform. Meant for use with Python 3.12</li>
<li><code>arm64-apple-ios</code>: An ARM64 target for iOS device</li>
<li><code>arm64-apple-ios-simulator</code>: An ARM64 target for iOS simulator</li>
<li><code>x86_64-apple-ios-simulator</code>: An <code>x86_64</code> target for iOS simulator</li>
</ul></dd><dt id="uv-tree--python-version"><a href="#uv-tree--python-version"><code>--python-version</code></a> <i>python-version</i></dt><dd><p>The Python version to use when filtering the tree.</p>
<p>For example, pass <code>--python-version 3.10</code> to display the dependencies that would be included when installing on Python 3.10.</p>
<p>Defaults to the version of the discovered Python interpreter.</p>
@ -2464,7 +2475,8 @@ uv tool run [OPTIONS] [COMMAND]
<p>See <a href="#uv-python">uv python</a> for details on Python discovery and supported request formats.</p>
<p>May also be set with the <code>UV_PYTHON</code> environment variable.</p></dd><dt id="uv-tool-run--python-platform"><a href="#uv-tool-run--python-platform"><code>--python-platform</code></a> <i>python-platform</i></dt><dd><p>The platform for which requirements should be installed.</p>
<p>Represented as a &quot;target triple&quot;, a string that describes the target platform in terms of its CPU, vendor, and operating system name, like <code>x86_64-unknown-linux-gnu</code> or <code>aarch64-apple-darwin</code>.</p>
<p>When targeting macOS (Darwin), the default minimum version is <code>12.0</code>. Use <code>MACOSX_DEPLOYMENT_TARGET</code> to specify a different minimum version, e.g., <code>13.0</code>.</p>
<p>When targeting macOS (Darwin), the default minimum version is <code>13.0</code>. Use <code>MACOSX_DEPLOYMENT_TARGET</code> to specify a different minimum version, e.g., <code>14.0</code>.</p>
<p>When targeting iOS, the default minimum version is <code>13.0</code>. Use <code>IPHONEOS_DEPLOYMENT_TARGET</code> to specify a different minimum version, e.g., <code>14.0</code>.</p>
<p>When targeting Android, the default minimum Android API level is <code>24</code>. Use <code>ANDROID_API_LEVEL</code> to specify a different minimum version, e.g., <code>26</code>.</p>
<p>WARNING: When specified, uv will select wheels that are compatible with the <em>target</em> platform; as a result, the installed distributions may not be compatible with the <em>current</em> platform. Conversely, any distributions that are built from source may be incompatible with the <em>target</em> platform, as they will be built for the <em>current</em> platform. The <code>--python-platform</code> option is intended for advanced use cases.</p>
<p>Possible values:</p>
@ -2511,6 +2523,9 @@ uv tool run [OPTIONS] [COMMAND]
<li><code>aarch64-linux-android</code>: An ARM64 Android target</li>
<li><code>x86_64-linux-android</code>: An <code>x86_64</code> Android target</li>
<li><code>wasm32-pyodide2024</code>: A wasm32 target using the Pyodide 2024 platform. Meant for use with Python 3.12</li>
<li><code>arm64-apple-ios</code>: An ARM64 target for iOS device</li>
<li><code>arm64-apple-ios-simulator</code>: An ARM64 target for iOS simulator</li>
<li><code>x86_64-apple-ios-simulator</code>: An <code>x86_64</code> target for iOS simulator</li>
</ul></dd><dt id="uv-tool-run--quiet"><a href="#uv-tool-run--quiet"><code>--quiet</code></a>, <code>-q</code></dt><dd><p>Use quiet output.</p>
<p>Repeating this option, e.g., <code>-qq</code>, will enable a silent mode in which uv will write no output to stdout.</p>
</dd><dt id="uv-tool-run--refresh"><a href="#uv-tool-run--refresh"><code>--refresh</code></a></dt><dd><p>Refresh all cached data</p>
@ -2687,7 +2702,8 @@ uv tool install [OPTIONS] <PACKAGE>
<p>See <a href="#uv-python">uv python</a> for details on Python discovery and supported request formats.</p>
<p>May also be set with the <code>UV_PYTHON</code> environment variable.</p></dd><dt id="uv-tool-install--python-platform"><a href="#uv-tool-install--python-platform"><code>--python-platform</code></a> <i>python-platform</i></dt><dd><p>The platform for which requirements should be installed.</p>
<p>Represented as a &quot;target triple&quot;, a string that describes the target platform in terms of its CPU, vendor, and operating system name, like <code>x86_64-unknown-linux-gnu</code> or <code>aarch64-apple-darwin</code>.</p>
<p>When targeting macOS (Darwin), the default minimum version is <code>12.0</code>. Use <code>MACOSX_DEPLOYMENT_TARGET</code> to specify a different minimum version, e.g., <code>13.0</code>.</p>
<p>When targeting macOS (Darwin), the default minimum version is <code>13.0</code>. Use <code>MACOSX_DEPLOYMENT_TARGET</code> to specify a different minimum version, e.g., <code>14.0</code>.</p>
<p>When targeting iOS, the default minimum version is <code>13.0</code>. Use <code>IPHONEOS_DEPLOYMENT_TARGET</code> to specify a different minimum version, e.g., <code>14.0</code>.</p>
<p>When targeting Android, the default minimum Android API level is <code>24</code>. Use <code>ANDROID_API_LEVEL</code> to specify a different minimum version, e.g., <code>26</code>.</p>
<p>WARNING: When specified, uv will select wheels that are compatible with the <em>target</em> platform; as a result, the installed distributions may not be compatible with the <em>current</em> platform. Conversely, any distributions that are built from source may be incompatible with the <em>target</em> platform, as they will be built for the <em>current</em> platform. The <code>--python-platform</code> option is intended for advanced use cases.</p>
<p>Possible values:</p>
@ -2734,6 +2750,9 @@ uv tool install [OPTIONS] <PACKAGE>
<li><code>aarch64-linux-android</code>: An ARM64 Android target</li>
<li><code>x86_64-linux-android</code>: An <code>x86_64</code> Android target</li>
<li><code>wasm32-pyodide2024</code>: A wasm32 target using the Pyodide 2024 platform. Meant for use with Python 3.12</li>
<li><code>arm64-apple-ios</code>: An ARM64 target for iOS device</li>
<li><code>arm64-apple-ios-simulator</code>: An ARM64 target for iOS simulator</li>
<li><code>x86_64-apple-ios-simulator</code>: An <code>x86_64</code> target for iOS simulator</li>
</ul></dd><dt id="uv-tool-install--quiet"><a href="#uv-tool-install--quiet"><code>--quiet</code></a>, <code>-q</code></dt><dd><p>Use quiet output.</p>
<p>Repeating this option, e.g., <code>-qq</code>, will enable a silent mode in which uv will write no output to stdout.</p>
</dd><dt id="uv-tool-install--refresh"><a href="#uv-tool-install--refresh"><code>--refresh</code></a></dt><dd><p>Refresh all cached data</p>
@ -2901,7 +2920,8 @@ Use with <code>--all</code> to apply to all tools.</p>
<p>See <a href="#uv-python">uv python</a> for details on Python discovery and supported request formats.</p>
<p>May also be set with the <code>UV_PYTHON</code> environment variable.</p></dd><dt id="uv-tool-upgrade--python-platform"><a href="#uv-tool-upgrade--python-platform"><code>--python-platform</code></a> <i>python-platform</i></dt><dd><p>The platform for which requirements should be installed.</p>
<p>Represented as a &quot;target triple&quot;, a string that describes the target platform in terms of its CPU, vendor, and operating system name, like <code>x86_64-unknown-linux-gnu</code> or <code>aarch64-apple-darwin</code>.</p>
<p>When targeting macOS (Darwin), the default minimum version is <code>12.0</code>. Use <code>MACOSX_DEPLOYMENT_TARGET</code> to specify a different minimum version, e.g., <code>13.0</code>.</p>
<p>When targeting macOS (Darwin), the default minimum version is <code>13.0</code>. Use <code>MACOSX_DEPLOYMENT_TARGET</code> to specify a different minimum version, e.g., <code>14.0</code>.</p>
<p>When targeting iOS, the default minimum version is <code>13.0</code>. Use <code>IPHONEOS_DEPLOYMENT_TARGET</code> to specify a different minimum version, e.g., <code>14.0</code>.</p>
<p>When targeting Android, the default minimum Android API level is <code>24</code>. Use <code>ANDROID_API_LEVEL</code> to specify a different minimum version, e.g., <code>26</code>.</p>
<p>WARNING: When specified, uv will select wheels that are compatible with the <em>target</em> platform; as a result, the installed distributions may not be compatible with the <em>current</em> platform. Conversely, any distributions that are built from source may be incompatible with the <em>target</em> platform, as they will be built for the <em>current</em> platform. The <code>--python-platform</code> option is intended for advanced use cases.</p>
<p>Possible values:</p>
@ -2948,6 +2968,9 @@ Use with <code>--all</code> to apply to all tools.</p>
<li><code>aarch64-linux-android</code>: An ARM64 Android target</li>
<li><code>x86_64-linux-android</code>: An <code>x86_64</code> Android target</li>
<li><code>wasm32-pyodide2024</code>: A wasm32 target using the Pyodide 2024 platform. Meant for use with Python 3.12</li>
<li><code>arm64-apple-ios</code>: An ARM64 target for iOS device</li>
<li><code>arm64-apple-ios-simulator</code>: An ARM64 target for iOS simulator</li>
<li><code>x86_64-apple-ios-simulator</code>: An <code>x86_64</code> target for iOS simulator</li>
</ul></dd><dt id="uv-tool-upgrade--quiet"><a href="#uv-tool-upgrade--quiet"><code>--quiet</code></a>, <code>-q</code></dt><dd><p>Use quiet output.</p>
<p>Repeating this option, e.g., <code>-qq</code>, will enable a silent mode in which uv will write no output to stdout.</p>
</dd><dt id="uv-tool-upgrade--reinstall"><a href="#uv-tool-upgrade--reinstall"><code>--reinstall</code></a>, <code>--force-reinstall</code></dt><dd><p>Reinstall all packages, regardless of whether they're already installed. Implies <code>--refresh</code></p>
@ -4144,7 +4167,8 @@ by <code>--python-version</code>.</p>
<p>See <a href="#uv-python">uv python</a> for details on Python discovery and supported request formats.</p>
</dd><dt id="uv-pip-compile--python-platform"><a href="#uv-pip-compile--python-platform"><code>--python-platform</code></a> <i>python-platform</i></dt><dd><p>The platform for which requirements should be resolved.</p>
<p>Represented as a &quot;target triple&quot;, a string that describes the target platform in terms of its CPU, vendor, and operating system name, like <code>x86_64-unknown-linux-gnu</code> or <code>aarch64-apple-darwin</code>.</p>
<p>When targeting macOS (Darwin), the default minimum version is <code>12.0</code>. Use <code>MACOSX_DEPLOYMENT_TARGET</code> to specify a different minimum version, e.g., <code>13.0</code>.</p>
<p>When targeting macOS (Darwin), the default minimum version is <code>13.0</code>. Use <code>MACOSX_DEPLOYMENT_TARGET</code> to specify a different minimum version, e.g., <code>14.0</code>.</p>
<p>When targeting iOS, the default minimum version is <code>13.0</code>. Use <code>IPHONEOS_DEPLOYMENT_TARGET</code> to specify a different minimum version, e.g., <code>14.0</code>.</p>
<p>When targeting Android, the default minimum Android API level is <code>24</code>. Use <code>ANDROID_API_LEVEL</code> to specify a different minimum version, e.g., <code>26</code>.</p>
<p>Possible values:</p>
<ul>
@ -4190,6 +4214,9 @@ by <code>--python-version</code>.</p>
<li><code>aarch64-linux-android</code>: An ARM64 Android target</li>
<li><code>x86_64-linux-android</code>: An <code>x86_64</code> Android target</li>
<li><code>wasm32-pyodide2024</code>: A wasm32 target using the Pyodide 2024 platform. Meant for use with Python 3.12</li>
<li><code>arm64-apple-ios</code>: An ARM64 target for iOS device</li>
<li><code>arm64-apple-ios-simulator</code>: An ARM64 target for iOS simulator</li>
<li><code>x86_64-apple-ios-simulator</code>: An <code>x86_64</code> target for iOS simulator</li>
</ul></dd><dt id="uv-pip-compile--python-version"><a href="#uv-pip-compile--python-version"><code>--python-version</code></a> <i>python-version</i></dt><dd><p>The Python version to use for resolution.</p>
<p>For example, <code>3.8</code> or <code>3.8.17</code>.</p>
<p>Defaults to the version of the Python interpreter used for resolution.</p>
@ -4418,7 +4445,8 @@ be used with caution, as it can modify the system Python installation.</p>
<p>See <a href="#uv-python">uv python</a> for details on Python discovery and supported request formats.</p>
<p>May also be set with the <code>UV_PYTHON</code> environment variable.</p></dd><dt id="uv-pip-sync--python-platform"><a href="#uv-pip-sync--python-platform"><code>--python-platform</code></a> <i>python-platform</i></dt><dd><p>The platform for which requirements should be installed.</p>
<p>Represented as a &quot;target triple&quot;, a string that describes the target platform in terms of its CPU, vendor, and operating system name, like <code>x86_64-unknown-linux-gnu</code> or <code>aarch64-apple-darwin</code>.</p>
<p>When targeting macOS (Darwin), the default minimum version is <code>12.0</code>. Use <code>MACOSX_DEPLOYMENT_TARGET</code> to specify a different minimum version, e.g., <code>13.0</code>.</p>
<p>When targeting macOS (Darwin), the default minimum version is <code>13.0</code>. Use <code>MACOSX_DEPLOYMENT_TARGET</code> to specify a different minimum version, e.g., <code>14.0</code>.</p>
<p>When targeting iOS, the default minimum version is <code>13.0</code>. Use <code>IPHONEOS_DEPLOYMENT_TARGET</code> to specify a different minimum version, e.g., <code>14.0</code>.</p>
<p>When targeting Android, the default minimum Android API level is <code>24</code>. Use <code>ANDROID_API_LEVEL</code> to specify a different minimum version, e.g., <code>26</code>.</p>
<p>WARNING: When specified, uv will select wheels that are compatible with the <em>target</em> platform; as a result, the installed distributions may not be compatible with the <em>current</em> platform. Conversely, any distributions that are built from source may be incompatible with the <em>target</em> platform, as they will be built for the <em>current</em> platform. The <code>--python-platform</code> option is intended for advanced use cases.</p>
<p>Possible values:</p>
@ -4465,6 +4493,9 @@ be used with caution, as it can modify the system Python installation.</p>
<li><code>aarch64-linux-android</code>: An ARM64 Android target</li>
<li><code>x86_64-linux-android</code>: An <code>x86_64</code> Android target</li>
<li><code>wasm32-pyodide2024</code>: A wasm32 target using the Pyodide 2024 platform. Meant for use with Python 3.12</li>
<li><code>arm64-apple-ios</code>: An ARM64 target for iOS device</li>
<li><code>arm64-apple-ios-simulator</code>: An ARM64 target for iOS simulator</li>
<li><code>x86_64-apple-ios-simulator</code>: An <code>x86_64</code> target for iOS simulator</li>
</ul></dd><dt id="uv-pip-sync--python-version"><a href="#uv-pip-sync--python-version"><code>--python-version</code></a> <i>python-version</i></dt><dd><p>The minimum Python version that should be supported by the requirements (e.g., <code>3.7</code> or <code>3.7.9</code>).</p>
<p>If a patch version is omitted, the minimum patch version is assumed. For example, <code>3.7</code> is mapped to <code>3.7.0</code>.</p>
</dd><dt id="uv-pip-sync--quiet"><a href="#uv-pip-sync--quiet"><code>--quiet</code></a>, <code>-q</code></dt><dd><p>Use quiet output.</p>
@ -4711,7 +4742,8 @@ should be used with caution, as it can modify the system Python installation.</p
<p>See <a href="#uv-python">uv python</a> for details on Python discovery and supported request formats.</p>
<p>May also be set with the <code>UV_PYTHON</code> environment variable.</p></dd><dt id="uv-pip-install--python-platform"><a href="#uv-pip-install--python-platform"><code>--python-platform</code></a> <i>python-platform</i></dt><dd><p>The platform for which requirements should be installed.</p>
<p>Represented as a &quot;target triple&quot;, a string that describes the target platform in terms of its CPU, vendor, and operating system name, like <code>x86_64-unknown-linux-gnu</code> or <code>aarch64-apple-darwin</code>.</p>
<p>When targeting macOS (Darwin), the default minimum version is <code>12.0</code>. Use <code>MACOSX_DEPLOYMENT_TARGET</code> to specify a different minimum version, e.g., <code>13.0</code>.</p>
<p>When targeting macOS (Darwin), the default minimum version is <code>13.0</code>. Use <code>MACOSX_DEPLOYMENT_TARGET</code> to specify a different minimum version, e.g., <code>14.0</code>.</p>
<p>When targeting iOS, the default minimum version is <code>13.0</code>. Use <code>IPHONEOS_DEPLOYMENT_TARGET</code> to specify a different minimum version, e.g., <code>14.0</code>.</p>
<p>When targeting Android, the default minimum Android API level is <code>24</code>. Use <code>ANDROID_API_LEVEL</code> to specify a different minimum version, e.g., <code>26</code>.</p>
<p>WARNING: When specified, uv will select wheels that are compatible with the <em>target</em> platform; as a result, the installed distributions may not be compatible with the <em>current</em> platform. Conversely, any distributions that are built from source may be incompatible with the <em>target</em> platform, as they will be built for the <em>current</em> platform. The <code>--python-platform</code> option is intended for advanced use cases.</p>
<p>Possible values:</p>
@ -4758,6 +4790,9 @@ should be used with caution, as it can modify the system Python installation.</p
<li><code>aarch64-linux-android</code>: An ARM64 Android target</li>
<li><code>x86_64-linux-android</code>: An <code>x86_64</code> Android target</li>
<li><code>wasm32-pyodide2024</code>: A wasm32 target using the Pyodide 2024 platform. Meant for use with Python 3.12</li>
<li><code>arm64-apple-ios</code>: An ARM64 target for iOS device</li>
<li><code>arm64-apple-ios-simulator</code>: An ARM64 target for iOS simulator</li>
<li><code>x86_64-apple-ios-simulator</code>: An <code>x86_64</code> target for iOS simulator</li>
</ul></dd><dt id="uv-pip-install--python-version"><a href="#uv-pip-install--python-version"><code>--python-version</code></a> <i>python-version</i></dt><dd><p>The minimum Python version that should be supported by the requirements (e.g., <code>3.7</code> or <code>3.7.9</code>).</p>
<p>If a patch version is omitted, the minimum patch version is assumed. For example, <code>3.7</code> is mapped to <code>3.7.0</code>.</p>
</dd><dt id="uv-pip-install--quiet"><a href="#uv-pip-install--quiet"><code>--quiet</code></a>, <code>-q</code></dt><dd><p>Use quiet output.</p>
@ -5345,7 +5380,8 @@ Python environment if no virtual environment is found.</p>
<p>May also be set with the <code>UV_PYTHON</code> environment variable.</p></dd><dt id="uv-pip-check--python-platform"><a href="#uv-pip-check--python-platform"><code>--python-platform</code></a> <i>python-platform</i></dt><dd><p>The platform for which packages should be checked.</p>
<p>By default, the installed packages are checked against the platform of the current interpreter.</p>
<p>Represented as a &quot;target triple&quot;, a string that describes the target platform in terms of its CPU, vendor, and operating system name, like <code>x86_64-unknown-linux-gnu</code> or <code>aarch64-apple-darwin</code>.</p>
<p>When targeting macOS (Darwin), the default minimum version is <code>12.0</code>. Use <code>MACOSX_DEPLOYMENT_TARGET</code> to specify a different minimum version, e.g., <code>13.0</code>.</p>
<p>When targeting macOS (Darwin), the default minimum version is <code>13.0</code>. Use <code>MACOSX_DEPLOYMENT_TARGET</code> to specify a different minimum version, e.g., <code>14.0</code>.</p>
<p>When targeting iOS, the default minimum version is <code>13.0</code>. Use <code>IPHONEOS_DEPLOYMENT_TARGET</code> to specify a different minimum version, e.g., <code>14.0</code>.</p>
<p>When targeting Android, the default minimum Android API level is <code>24</code>. Use <code>ANDROID_API_LEVEL</code> to specify a different minimum version, e.g., <code>26</code>.</p>
<p>Possible values:</p>
<ul>
@ -5391,6 +5427,9 @@ Python environment if no virtual environment is found.</p>
<li><code>aarch64-linux-android</code>: An ARM64 Android target</li>
<li><code>x86_64-linux-android</code>: An <code>x86_64</code> Android target</li>
<li><code>wasm32-pyodide2024</code>: A wasm32 target using the Pyodide 2024 platform. Meant for use with Python 3.12</li>
<li><code>arm64-apple-ios</code>: An ARM64 target for iOS device</li>
<li><code>arm64-apple-ios-simulator</code>: An ARM64 target for iOS simulator</li>
<li><code>x86_64-apple-ios-simulator</code>: An <code>x86_64</code> target for iOS simulator</li>
</ul></dd><dt id="uv-pip-check--python-version"><a href="#uv-pip-check--python-version"><code>--python-version</code></a> <i>python-version</i></dt><dd><p>The Python version against which packages should be checked.</p>
<p>By default, the installed packages are checked against the version of the current interpreter.</p>
</dd><dt id="uv-pip-check--quiet"><a href="#uv-pip-check--quiet"><code>--quiet</code></a>, <code>-q</code></dt><dd><p>Use quiet output.</p>

View file

@ -633,6 +633,13 @@ Proxy for HTTP requests.
Timeout (in seconds) for HTTP requests. Equivalent to `UV_HTTP_TIMEOUT`.
### `IPHONEOS_DEPLOYMENT_TARGET`
Used with `--python-platform arm64-apple-ios` and related variants to set the
deployment target (i.e., the minimum supported iOS version).
Defaults to `13.0`.
### `JPY_SESSION_NAME`
Used to detect when running inside a Jupyter notebook.

15
uv.schema.json generated
View file

@ -2440,6 +2440,21 @@
"description": "A wasm32 target using the Pyodide 2024 platform. Meant for use with Python 3.12.",
"type": "string",
"const": "wasm32-pyodide2024"
},
{
"description": "An ARM64 target for iOS device\n\nBy default, iOS 13.0 is used, but respects the `IPHONEOS_DEPLOYMENT_TARGET`\nenvironment variable if set.",
"type": "string",
"const": "arm64-apple-ios"
},
{
"description": "An ARM64 target for iOS simulator\n\nBy default, iOS 13.0 is used, but respects the `IPHONEOS_DEPLOYMENT_TARGET`\nenvironment variable if set.",
"type": "string",
"const": "arm64-apple-ios-simulator"
},
{
"description": "An `x86_64` target for iOS simulator\n\nBy default, iOS 13.0 is used, but respects the `IPHONEOS_DEPLOYMENT_TARGET`\nenvironment variable if set.",
"type": "string",
"const": "x86_64-apple-ios-simulator"
}
]
},