From 330e56e778cb5313a8ddb84cace8ce32e87a944b Mon Sep 17 00:00:00 2001
From: timrid <6593626+timrid@users.noreply.github.com>
Date: Thu, 4 Sep 2025 00:24:48 +0200
Subject: [PATCH] Support iOS platform tags (#15640)
## Summary
This implements the iOS part of
https://github.com/astral-sh/uv/issues/8029
FYI: @freakboy3742
## 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.
---
crates/uv-cli/src/lib.rs | 63 ++++--
crates/uv-configuration/src/target_triple.rs | 101 +++++++++
crates/uv-platform-tags/src/platform.rs | 55 ++++-
crates/uv-platform-tags/src/platform_tag.rs | 111 ++++++++++
crates/uv-platform-tags/src/tags.rs | 213 +++++++++++++++++++
crates/uv-platform/src/os.rs | 3 +
crates/uv-static/src/env_vars.rs | 6 +
crates/uv-torch/src/backend.rs | 9 +-
docs/reference/cli.md | 57 ++++-
docs/reference/environment.md | 7 +
uv.schema.json | 15 ++
11 files changed, 599 insertions(+), 41 deletions(-)
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::
See uv python to view supported request formats.
May also be set with the UV_PYTHON environment variable.
--python-platform python-platformThe 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 targetx86_64-linux-android: An x86_64 Android targetwasm32-pyodide2024: A wasm32 target using the Pyodide 2024 platform. Meant for use with Python 3.12arm64-apple-ios: An ARM64 target for iOS devicearm64-apple-ios-simulator: An ARM64 target for iOS simulatorx86_64-apple-ios-simulator: An x86_64 target for iOS simulator--quiet, -qUse quiet output.
Repeating this option, e.g., -qq, will enable a silent mode in which uv will write no output to stdout.
--refreshRefresh 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-platformThe 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 targetx86_64-linux-android: An x86_64 Android targetwasm32-pyodide2024: A wasm32 target using the Pyodide 2024 platform. Meant for use with Python 3.12arm64-apple-ios: An ARM64 target for iOS devicearm64-apple-ios-simulator: An ARM64 target for iOS simulatorx86_64-apple-ios-simulator: An x86_64 target for iOS simulator--quiet, -qUse quiet output.
Repeating this option, e.g., -qq, will enable a silent mode in which uv will write no output to stdout.
--refreshRefresh all cached data
@@ -2183,6 +2191,9 @@ interpreter. Use--universal to display the tree for all platforms,
aarch64-linux-android: An ARM64 Android targetx86_64-linux-android: An x86_64 Android targetwasm32-pyodide2024: A wasm32 target using the Pyodide 2024 platform. Meant for use with Python 3.12arm64-apple-ios: An ARM64 target for iOS devicearm64-apple-ios-simulator: An ARM64 target for iOS simulatorx86_64-apple-ios-simulator: An x86_64 target for iOS simulator--python-version python-versionThe 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-platformThe 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 targetx86_64-linux-android: An x86_64 Android targetwasm32-pyodide2024: A wasm32 target using the Pyodide 2024 platform. Meant for use with Python 3.12arm64-apple-ios: An ARM64 target for iOS devicearm64-apple-ios-simulator: An ARM64 target for iOS simulatorx86_64-apple-ios-simulator: An x86_64 target for iOS simulator--quiet, -qUse quiet output.
Repeating this option, e.g., -qq, will enable a silent mode in which uv will write no output to stdout.
--refreshRefresh 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-platformThe 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 targetx86_64-linux-android: An x86_64 Android targetwasm32-pyodide2024: A wasm32 target using the Pyodide 2024 platform. Meant for use with Python 3.12arm64-apple-ios: An ARM64 target for iOS devicearm64-apple-ios-simulator: An ARM64 target for iOS simulatorx86_64-apple-ios-simulator: An x86_64 target for iOS simulator--quiet, -qUse quiet output.
Repeating this option, e.g., -qq, will enable a silent mode in which uv will write no output to stdout.
--refreshRefresh 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-platformThe 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 targetx86_64-linux-android: An x86_64 Android targetwasm32-pyodide2024: A wasm32 target using the Pyodide 2024 platform. Meant for use with Python 3.12arm64-apple-ios: An ARM64 target for iOS devicearm64-apple-ios-simulator: An ARM64 target for iOS simulatorx86_64-apple-ios-simulator: An x86_64 target for iOS simulator--quiet, -qUse quiet output.
Repeating this option, e.g., -qq, will enable a silent mode in which uv will write no output to stdout.
--reinstall, --force-reinstallReinstall all packages, regardless of whether they're already installed. Implies --refresh
--python-version.
See uv python for details on Python discovery and supported request formats.
--python-platform python-platformThe 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:
--python-version.
aarch64-linux-android: An ARM64 Android targetx86_64-linux-android: An x86_64 Android targetwasm32-pyodide2024: A wasm32 target using the Pyodide 2024 platform. Meant for use with Python 3.12arm64-apple-ios: An ARM64 target for iOS devicearm64-apple-ios-simulator: An ARM64 target for iOS simulatorx86_64-apple-ios-simulator: An x86_64 target for iOS simulator--python-version python-versionThe 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-platformThe 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 targetx86_64-linux-android: An x86_64 Android targetwasm32-pyodide2024: A wasm32 target using the Pyodide 2024 platform. Meant for use with Python 3.12arm64-apple-ios: An ARM64 target for iOS devicearm64-apple-ios-simulator: An ARM64 target for iOS simulatorx86_64-apple-ios-simulator: An x86_64 target for iOS simulator--python-version python-versionThe 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, -qUse 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-platformThe 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 targetwasm32-pyodide2024: A wasm32 target using the Pyodide 2024 platform. Meant for use with Python 3.12arm64-apple-ios: An ARM64 target for iOS devicearm64-apple-ios-simulator: An ARM64 target for iOS simulatorx86_64-apple-ios-simulator: An x86_64 target for iOS simulator--python-version python-versionThe 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, -qUse 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-platformThe 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:
aarch64-linux-android: An ARM64 Android targetx86_64-linux-android: An x86_64 Android targetwasm32-pyodide2024: A wasm32 target using the Pyodide 2024 platform. Meant for use with Python 3.12arm64-apple-ios: An ARM64 target for iOS devicearm64-apple-ios-simulator: An ARM64 target for iOS simulatorx86_64-apple-ios-simulator: An x86_64 target for iOS simulator--python-version python-versionThe Python version against which packages should be checked.
By default, the installed packages are checked against the version of the current interpreter.
--quiet, -qUse 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" } ] },