diff --git a/crates/uv-cli/src/lib.rs b/crates/uv-cli/src/lib.rs index 8ed260aca..358634477 100644 --- a/crates/uv-cli/src/lib.rs +++ b/crates/uv-cli/src/lib.rs @@ -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`. diff --git a/crates/uv-configuration/src/target_triple.rs b/crates/uv-configuration/src/target_triple.rs index 1fd01c1a7..479de159f 100644 --- a/crates/uv-configuration/src/target_triple.rs +++ b/crates/uv-configuration/src/target_triple.rs @@ -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::().ok()?; + + // Parse the minor version (e.g., `0` in `12.0`), with a default of `0`. + let minor = parts.next().unwrap_or("0").parse::().ok()?; + + Some((major, minor)) +} + /// Return the Android API level as parsed from the environment. fn android_api_level() -> Option { let api_level_str = std::env::var(EnvVars::ANDROID_API_LEVEL).ok()?; diff --git a/crates/uv-platform-tags/src/platform.rs b/crates/uv-platform-tags/src/platform.rs index 62b05afe9..02a2e52ce 100644 --- a/crates/uv-platform-tags/src/platform.rs +++ b/crates/uv-platform-tags/src/platform.rs @@ -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"), } } } diff --git a/crates/uv-platform-tags/src/platform_tag.rs b/crates/uv-platform-tags/src/platform_tag.rs index bb043b2ff..73523bf37 100644 --- a/crates/uv-platform-tags/src/platform_tag.rs +++ b/crates/uv-platform-tags/src/platform_tag.rs @@ -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!( diff --git a/crates/uv-platform-tags/src/tags.rs b/crates/uv-platform-tags/src/tags.rs index 531b3c782..1c29d1b4d 100644 --- a/crates/uv-platform-tags/src/tags.rs +++ b/crates/uv-platform-tags/src/tags.rs @@ -633,6 +633,60 @@ fn compatible_tags(platform: &Platform) -> Result, 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 { + 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 { + 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::>(); + 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::>(); + 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::>(); + 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] diff --git a/crates/uv-platform/src/os.rs b/crates/uv-platform/src/os.rs index 95372bed9..b064d1f50 100644 --- a/crates/uv-platform/src/os.rs +++ b/crates/uv-platform/src/os.rs @@ -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)) + } } } } diff --git a/crates/uv-static/src/env_vars.rs b/crates/uv-static/src/env_vars.rs index e57cce0ef..47879b488 100644 --- a/crates/uv-static/src/env_vars.rs +++ b/crates/uv-static/src/env_vars.rs @@ -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). /// diff --git a/crates/uv-torch/src/backend.rs b/crates/uv-torch/src/backend.rs index 12e69c181..3ad4a62ac 100644 --- a/crates/uv-torch/src/backend.rs +++ b/crates/uv-torch/src/backend.rs @@ -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()))) } }, diff --git a/docs/reference/cli.md b/docs/reference/cli.md index 601edb742..5044de637 100644 --- a/docs/reference/cli.md +++ b/docs/reference/cli.md @@ -537,7 +537,8 @@ used.

See uv python to view supported request formats.

May also be set with the UV_PYTHON environment variable.

--python-platform python-platform

The platform for which requirements should be installed.

Represented as a "target triple", a string that describes the target platform in terms of 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.

WARNING: When specified, uv will select wheels that are compatible with the target platform; as a result, the installed distributions may not be compatible with the current platform. Conversely, any distributions that are built from source may be incompatible with the target platform, as they will be built for the current platform. The --python-platform option is intended for advanced use cases.

Possible values:

@@ -584,6 +585,9 @@ used.

  • aarch64-linux-android: An ARM64 Android target
  • x86_64-linux-android: An x86_64 Android target
  • wasm32-pyodide2024: A wasm32 target using the Pyodide 2024 platform. Meant for use with Python 3.12
  • +
  • arm64-apple-ios: An ARM64 target for iOS device
  • +
  • arm64-apple-ios-simulator: An ARM64 target for iOS simulator
  • +
  • x86_64-apple-ios-simulator: An x86_64 target for iOS simulator
  • --quiet, -q

    Use quiet output.

    Repeating this option, e.g., -qq, will enable a silent mode in which uv will write no output to stdout.

    --refresh

    Refresh all cached data

    @@ -1533,7 +1537,8 @@ environment in the project.

    See uv python for details on Python discovery and supported request formats.

    May also be set with the UV_PYTHON environment variable.

    --python-platform python-platform

    The platform for which requirements should be installed.

    Represented as a "target triple", a string that describes the target platform in terms of 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.

    WARNING: When specified, uv will select wheels that are compatible with the target platform; as a result, the installed distributions may not be compatible with the current platform. Conversely, any distributions that are built from source may be incompatible with the target platform, as they will be built for the current platform. The --python-platform option is intended for advanced use cases.

    Possible values:

    @@ -1580,6 +1585,9 @@ environment in the project.

  • aarch64-linux-android: An ARM64 Android target
  • x86_64-linux-android: An x86_64 Android target
  • wasm32-pyodide2024: A wasm32 target using the Pyodide 2024 platform. Meant for use with Python 3.12
  • +
  • arm64-apple-ios: An ARM64 target for iOS device
  • +
  • arm64-apple-ios-simulator: An ARM64 target for iOS simulator
  • +
  • x86_64-apple-ios-simulator: An x86_64 target for iOS simulator
  • --quiet, -q

    Use quiet output.

    Repeating this option, e.g., -qq, will enable a silent mode in which uv will write no output to stdout.

    --refresh

    Refresh all cached data

    @@ -2183,6 +2191,9 @@ interpreter. Use --universal to display the tree for all platforms,
  • aarch64-linux-android: An ARM64 Android target
  • x86_64-linux-android: An x86_64 Android target
  • wasm32-pyodide2024: A wasm32 target using the Pyodide 2024 platform. Meant for use with Python 3.12
  • +
  • arm64-apple-ios: An ARM64 target for iOS device
  • +
  • arm64-apple-ios-simulator: An ARM64 target for iOS simulator
  • +
  • x86_64-apple-ios-simulator: An x86_64 target for iOS simulator
  • --python-version python-version

    The Python version to use when filtering the tree.

    For example, pass --python-version 3.10 to display the dependencies that would be included when installing on Python 3.10.

    Defaults to the version of the discovered Python interpreter.

    @@ -2464,7 +2475,8 @@ uv tool run [OPTIONS] [COMMAND]

    See uv python for details on Python discovery and supported request formats.

    May also be set with the UV_PYTHON environment variable.

    --python-platform python-platform

    The platform for which requirements should be installed.

    Represented as a "target triple", a string that describes the target platform in terms of 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.

    WARNING: When specified, uv will select wheels that are compatible with the target platform; as a result, the installed distributions may not be compatible with the current platform. Conversely, any distributions that are built from source may be incompatible with the target platform, as they will be built for the current platform. The --python-platform option is intended for advanced use cases.

    Possible values:

    @@ -2511,6 +2523,9 @@ uv tool run [OPTIONS] [COMMAND]
  • aarch64-linux-android: An ARM64 Android target
  • x86_64-linux-android: An x86_64 Android target
  • wasm32-pyodide2024: A wasm32 target using the Pyodide 2024 platform. Meant for use with Python 3.12
  • +
  • arm64-apple-ios: An ARM64 target for iOS device
  • +
  • arm64-apple-ios-simulator: An ARM64 target for iOS simulator
  • +
  • x86_64-apple-ios-simulator: An x86_64 target for iOS simulator
  • --quiet, -q

    Use quiet output.

    Repeating this option, e.g., -qq, will enable a silent mode in which uv will write no output to stdout.

    --refresh

    Refresh all cached data

    @@ -2687,7 +2702,8 @@ uv tool install [OPTIONS]

    See uv python for details on Python discovery and supported request formats.

    May also be set with the UV_PYTHON environment variable.

    --python-platform python-platform

    The platform for which requirements should be installed.

    Represented as a "target triple", a string that describes the target platform in terms of 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.

    WARNING: When specified, uv will select wheels that are compatible with the target platform; as a result, the installed distributions may not be compatible with the current platform. Conversely, any distributions that are built from source may be incompatible with the target platform, as they will be built for the current platform. The --python-platform option is intended for advanced use cases.

    Possible values:

    @@ -2734,6 +2750,9 @@ uv tool install [OPTIONS]
  • aarch64-linux-android: An ARM64 Android target
  • x86_64-linux-android: An x86_64 Android target
  • wasm32-pyodide2024: A wasm32 target using the Pyodide 2024 platform. Meant for use with Python 3.12
  • +
  • arm64-apple-ios: An ARM64 target for iOS device
  • +
  • arm64-apple-ios-simulator: An ARM64 target for iOS simulator
  • +
  • x86_64-apple-ios-simulator: An x86_64 target for iOS simulator
  • --quiet, -q

    Use quiet output.

    Repeating this option, e.g., -qq, will enable a silent mode in which uv will write no output to stdout.

    --refresh

    Refresh all cached data

    @@ -2901,7 +2920,8 @@ Use with --all to apply to all tools.

    See uv python for details on Python discovery and supported request formats.

    May also be set with the UV_PYTHON environment variable.

    --python-platform python-platform

    The platform for which requirements should be installed.

    Represented as a "target triple", a string that describes the target platform in terms of 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.

    WARNING: When specified, uv will select wheels that are compatible with the target platform; as a result, the installed distributions may not be compatible with the current platform. Conversely, any distributions that are built from source may be incompatible with the target platform, as they will be built for the current platform. The --python-platform option is intended for advanced use cases.

    Possible values:

    @@ -2948,6 +2968,9 @@ Use with --all to apply to all tools.

  • aarch64-linux-android: An ARM64 Android target
  • x86_64-linux-android: An x86_64 Android target
  • wasm32-pyodide2024: A wasm32 target using the Pyodide 2024 platform. Meant for use with Python 3.12
  • +
  • arm64-apple-ios: An ARM64 target for iOS device
  • +
  • arm64-apple-ios-simulator: An ARM64 target for iOS simulator
  • +
  • x86_64-apple-ios-simulator: An x86_64 target for iOS simulator
  • --quiet, -q

    Use quiet output.

    Repeating this option, e.g., -qq, will enable a silent mode in which uv will write no output to stdout.

    --reinstall, --force-reinstall

    Reinstall all packages, regardless of whether they're already installed. Implies --refresh

    @@ -4144,7 +4167,8 @@ by --python-version.

    See uv python for details on Python discovery and supported request formats.

    --python-platform python-platform

    The platform for which requirements should be resolved.

    Represented as a "target triple", a string that describes the target platform in terms of 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.

    Possible values:

      @@ -4190,6 +4214,9 @@ by --python-version.

    • aarch64-linux-android: An ARM64 Android target
    • x86_64-linux-android: An x86_64 Android target
    • wasm32-pyodide2024: A wasm32 target using the Pyodide 2024 platform. Meant for use with Python 3.12
    • +
    • arm64-apple-ios: An ARM64 target for iOS device
    • +
    • arm64-apple-ios-simulator: An ARM64 target for iOS simulator
    • +
    • x86_64-apple-ios-simulator: An x86_64 target for iOS simulator
    --python-version python-version

    The Python version to use for resolution.

    For example, 3.8 or 3.8.17.

    Defaults to the version of the Python interpreter used for resolution.

    @@ -4418,7 +4445,8 @@ be used with caution, as it can modify the system Python installation.

    See uv python for details on Python discovery and supported request formats.

    May also be set with the UV_PYTHON environment variable.

    --python-platform python-platform

    The platform for which requirements should be installed.

    Represented as a "target triple", a string that describes the target platform in terms of 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.

    WARNING: When specified, uv will select wheels that are compatible with the target platform; as a result, the installed distributions may not be compatible with the current platform. Conversely, any distributions that are built from source may be incompatible with the target platform, as they will be built for the current platform. The --python-platform option is intended for advanced use cases.

    Possible values:

    @@ -4465,6 +4493,9 @@ be used with caution, as it can modify the system Python installation.

  • aarch64-linux-android: An ARM64 Android target
  • x86_64-linux-android: An x86_64 Android target
  • wasm32-pyodide2024: A wasm32 target using the Pyodide 2024 platform. Meant for use with Python 3.12
  • +
  • arm64-apple-ios: An ARM64 target for iOS device
  • +
  • arm64-apple-ios-simulator: An ARM64 target for iOS simulator
  • +
  • x86_64-apple-ios-simulator: An x86_64 target for iOS simulator
  • --python-version python-version

    The minimum Python version that should be supported by the requirements (e.g., 3.7 or 3.7.9).

    If a patch version is omitted, the minimum patch version is assumed. For example, 3.7 is mapped to 3.7.0.

    --quiet, -q

    Use quiet output.

    @@ -4711,7 +4742,8 @@ should be used with caution, as it can modify the system Python installation.

    See uv python for details on Python discovery and supported request formats.

    May also be set with the UV_PYTHON environment variable.

    --python-platform python-platform

    The platform for which requirements should be installed.

    Represented as a "target triple", a string that describes the target platform in terms of 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.

    WARNING: When specified, uv will select wheels that are compatible with the target platform; as a result, the installed distributions may not be compatible with the current platform. Conversely, any distributions that are built from source may be incompatible with the target platform, as they will be built for the current platform. The --python-platform option is intended for advanced use cases.

    Possible values:

    @@ -4758,6 +4790,9 @@ should be used with caution, as it can modify the system Python installation.

    aarch64-linux-android: An ARM64 Android target
  • x86_64-linux-android: An x86_64 Android target
  • wasm32-pyodide2024: A wasm32 target using the Pyodide 2024 platform. Meant for use with Python 3.12
  • +
  • arm64-apple-ios: An ARM64 target for iOS device
  • +
  • arm64-apple-ios-simulator: An ARM64 target for iOS simulator
  • +
  • x86_64-apple-ios-simulator: An x86_64 target for iOS simulator
  • --python-version python-version

    The minimum Python version that should be supported by the requirements (e.g., 3.7 or 3.7.9).

    If a patch version is omitted, the minimum patch version is assumed. For example, 3.7 is mapped to 3.7.0.

    --quiet, -q

    Use quiet output.

    @@ -5345,7 +5380,8 @@ Python environment if no virtual environment is found.

    May also be set with the UV_PYTHON environment variable.

    --python-platform python-platform

    The platform for which packages should be checked.

    By default, the installed packages are checked against the platform of the current interpreter.

    Represented as a "target triple", a string that describes the target platform in terms of 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.

    Possible values:

      @@ -5391,6 +5427,9 @@ Python environment if no virtual environment is found.

    • aarch64-linux-android: An ARM64 Android target
    • x86_64-linux-android: An x86_64 Android target
    • wasm32-pyodide2024: A wasm32 target using the Pyodide 2024 platform. Meant for use with Python 3.12
    • +
    • arm64-apple-ios: An ARM64 target for iOS device
    • +
    • arm64-apple-ios-simulator: An ARM64 target for iOS simulator
    • +
    • x86_64-apple-ios-simulator: An x86_64 target for iOS simulator
    --python-version python-version

    The Python version against which packages should be checked.

    By default, the installed packages are checked against the version of the current interpreter.

    --quiet, -q

    Use quiet output.

    diff --git a/docs/reference/environment.md b/docs/reference/environment.md index 1364175f3..2f40cc923 100644 --- a/docs/reference/environment.md +++ b/docs/reference/environment.md @@ -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. diff --git a/uv.schema.json b/uv.schema.json index d87b50480..c1c158121 100644 --- a/uv.schema.json +++ b/uv.schema.json @@ -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" } ] },