From 4168d9b320aaa14083bc424d3e5f159a20267277 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Thu, 28 Aug 2025 20:51:39 -0400 Subject: [PATCH] Add `--python-platform` to `uv run` and `uv tool` (#15515) ## Summary Closes https://github.com/astral-sh/uv/issues/11120. --- crates/uv-cli/src/lib.rs | 68 +++++++ crates/uv-installer/src/satisfies.rs | 8 - crates/uv/src/commands/project/environment.rs | 4 +- crates/uv/src/commands/project/mod.rs | 25 +-- crates/uv/src/commands/project/run.rs | 9 +- crates/uv/src/commands/project/sync.rs | 1 + crates/uv/src/commands/tool/install.rs | 89 ++++++--- crates/uv/src/commands/tool/run.rs | 14 +- crates/uv/src/commands/tool/upgrade.rs | 7 +- crates/uv/src/lib.rs | 4 + crates/uv/src/settings.rs | 12 ++ crates/uv/tests/it/show_settings.rs | 1 + crates/uv/tests/it/tool_install.rs | 55 +++++ docs/reference/cli.md | 188 +++++++++++++++++- 14 files changed, 428 insertions(+), 57 deletions(-) diff --git a/crates/uv-cli/src/lib.rs b/crates/uv-cli/src/lib.rs index 3c5a0ac5a..1a2770e52 100644 --- a/crates/uv-cli/src/lib.rs +++ b/crates/uv-cli/src/lib.rs @@ -3308,6 +3308,23 @@ pub struct RunArgs { /// If uv reaches the maximum recursion depth, it will exit with an error. #[arg(long, hide = true, env = EnvVars::UV_RUN_MAX_RECURSION_DEPTH)] pub max_recursion_depth: Option, + + /// 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`. + /// + /// 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. + #[arg(long)] + pub python_platform: Option, } #[derive(Args)] @@ -4565,6 +4582,23 @@ pub struct ToolRunArgs { #[arg(long, env = EnvVars::UV_SHOW_RESOLUTION, value_parser = clap::builder::BoolishValueParser::new(), hide = true)] pub show_resolution: bool, + /// 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`. + /// + /// 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. + #[arg(long)] + pub python_platform: Option, + #[arg(long, hide = true)] pub generate_shell_completion: Option, } @@ -4669,6 +4703,23 @@ pub struct ToolInstallArgs { value_parser = parse_maybe_string, )] pub python: Option>, + + /// 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`. + /// + /// 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. + #[arg(long)] + pub python_platform: Option, } #[derive(Args)] @@ -4750,6 +4801,23 @@ pub struct ToolUpgradeArgs { )] pub python: Option>, + /// 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`. + /// + /// 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. + #[arg(long)] + pub python_platform: Option, + // The following is equivalent to flattening `ResolverInstallerArgs`, with the `--upgrade`, and // `--upgrade-package` options hidden, and the `--no-upgrade` option removed. /// Allow package upgrades, ignoring pinned versions in any existing output file. Implies diff --git a/crates/uv-installer/src/satisfies.rs b/crates/uv-installer/src/satisfies.rs index 9c3cc00cd..ca8f75b35 100644 --- a/crates/uv-installer/src/satisfies.rs +++ b/crates/uv-installer/src/satisfies.rs @@ -308,14 +308,6 @@ impl RequirementSatisfaction { return Self::CacheInvalid; } } - - // If the distribution isn't compatible with the current platform, it is a mismatch. - if let Ok(Some(wheel_tags)) = distribution.read_tags() { - if !wheel_tags.is_compatible(tags) { - debug!("Platform tags mismatch for {name}: {distribution}"); - return Self::Mismatch; - } - } } } diff --git a/crates/uv/src/commands/project/environment.rs b/crates/uv/src/commands/project/environment.rs index 732b83b56..16ee3cede 100644 --- a/crates/uv/src/commands/project/environment.rs +++ b/crates/uv/src/commands/project/environment.rs @@ -12,7 +12,7 @@ use crate::settings::{NetworkSettings, ResolverInstallerSettings}; use uv_cache::{Cache, CacheBucket}; use uv_cache_key::{cache_digest, hash_digest}; -use uv_configuration::{Concurrency, Constraints}; +use uv_configuration::{Concurrency, Constraints, TargetTriple}; use uv_distribution_types::{Name, Resolution}; use uv_fs::PythonExt; use uv_preview::Preview; @@ -111,6 +111,7 @@ impl CachedEnvironment { spec: EnvironmentSpecification<'_>, build_constraints: Constraints, interpreter: &Interpreter, + python_platform: Option<&TargetTriple>, settings: &ResolverInstallerSettings, network_settings: &NetworkSettings, state: &PlatformState, @@ -129,6 +130,7 @@ impl CachedEnvironment { resolve_environment( spec, &interpreter, + python_platform, build_constraints.clone(), &settings.resolver, network_settings, diff --git a/crates/uv/src/commands/project/mod.rs b/crates/uv/src/commands/project/mod.rs index ea83db0a2..1bf706827 100644 --- a/crates/uv/src/commands/project/mod.rs +++ b/crates/uv/src/commands/project/mod.rs @@ -13,7 +13,7 @@ use uv_cache_key::cache_digest; use uv_client::{BaseClientBuilder, FlatIndexClient, RegistryClientBuilder}; use uv_configuration::{ Concurrency, Constraints, DependencyGroupsWithDefaults, DryRun, ExtrasSpecification, Reinstall, - Upgrade, + TargetTriple, Upgrade, }; use uv_dispatch::{BuildDispatch, SharedState}; use uv_distribution::{DistributionDatabase, LoweredExtraBuildDependencies, LoweredRequirement}; @@ -1849,6 +1849,7 @@ impl<'lock> EnvironmentSpecification<'lock> { pub(crate) async fn resolve_environment( spec: EnvironmentSpecification<'_>, interpreter: &Interpreter, + python_platform: Option<&TargetTriple>, build_constraints: Constraints, settings: &ResolverSettings, network_settings: &NetworkSettings, @@ -1899,8 +1900,8 @@ pub(crate) async fn resolve_environment( .allow_insecure_host(network_settings.allow_insecure_host.clone()); // Determine the tags, markers, and interpreter to use for resolution. - let tags = interpreter.tags()?; - let marker_env = interpreter.resolver_marker_environment(); + let tags = pip::resolution_tags(None, python_platform, interpreter)?; + let marker_env = pip::resolution_markers(None, python_platform, interpreter); let python_requirement = PythonRequirement::from_interpreter(interpreter); index_locations.cache_index_credentials(); @@ -1973,7 +1974,7 @@ pub(crate) async fn resolve_environment( let entries = client .fetch_all(index_locations.flat_indexes().map(Index::url)) .await?; - FlatIndex::from_entries(entries, Some(tags), &hasher, build_options) + FlatIndex::from_entries(entries, Some(&tags), &hasher, build_options) }; let workspace_cache = WorkspaceCache::default(); @@ -2024,7 +2025,7 @@ pub(crate) async fn resolve_environment( &hasher, &reinstall, &upgrade, - Some(tags), + Some(&tags), ResolverEnvironment::specific(marker_env), python_requirement, interpreter.markers(), @@ -2207,6 +2208,7 @@ pub(crate) async fn update_environment( venv: PythonEnvironment, spec: RequirementsSpecification, modifications: Modifications, + python_platform: Option<&TargetTriple>, build_constraints: Constraints, extra_build_requires: ExtraBuildRequires, settings: &ResolverInstallerSettings, @@ -2268,8 +2270,8 @@ pub(crate) async fn update_environment( // Determine markers and tags to use for resolution. let interpreter = venv.interpreter(); - let marker_env = venv.interpreter().resolver_marker_environment(); - let tags = venv.interpreter().tags()?; + let marker_env = pip::resolution_markers(None, python_platform, interpreter); + let tags = pip::resolution_tags(None, python_platform, interpreter)?; // Check if the current environment satisfies the requirements let site_packages = SitePackages::from_environment(&venv)?; @@ -2283,7 +2285,7 @@ pub(crate) async fn update_environment( &constraints, &overrides, &marker_env, - tags, + &tags, config_setting, config_settings_package, &extra_build_requires, @@ -2354,7 +2356,6 @@ pub(crate) async fn update_environment( let preferences = Vec::default(); // Determine the tags to use for resolution. - let tags = venv.interpreter().tags()?; let python_requirement = PythonRequirement::from_interpreter(interpreter); // Resolve the flat indexes from `--find-links`. @@ -2363,7 +2364,7 @@ pub(crate) async fn update_environment( let entries = client .fetch_all(index_locations.flat_indexes().map(Index::url)) .await?; - FlatIndex::from_entries(entries, Some(tags), &hasher, build_options) + FlatIndex::from_entries(entries, Some(&tags), &hasher, build_options) }; // Create a build dispatch. @@ -2407,7 +2408,7 @@ pub(crate) async fn update_environment( &hasher, reinstall, upgrade, - Some(tags), + Some(&tags), ResolverEnvironment::specific(marker_env.clone()), python_requirement, venv.interpreter().markers(), @@ -2437,7 +2438,7 @@ pub(crate) async fn update_environment( *link_mode, *compile_bytecode, &hasher, - tags, + &tags, &client, state.in_flight(), concurrency, diff --git a/crates/uv/src/commands/project/run.rs b/crates/uv/src/commands/project/run.rs index 1043c10a8..e7a418b37 100644 --- a/crates/uv/src/commands/project/run.rs +++ b/crates/uv/src/commands/project/run.rs @@ -19,7 +19,7 @@ use uv_cli::ExternalCommand; use uv_client::BaseClientBuilder; use uv_configuration::{ Concurrency, Constraints, DependencyGroups, DryRun, EditableMode, ExtrasSpecification, - InstallOptions, + InstallOptions, TargetTriple, }; use uv_distribution::LoweredExtraBuildDependencies; use uv_distribution_types::Requirement; @@ -96,6 +96,7 @@ pub(crate) async fn run( editable: EditableMode, modifications: Modifications, python: Option, + python_platform: Option, install_mirrors: PythonInstallMirrors, settings: ResolverInstallerSettings, network_settings: NetworkSettings, @@ -319,7 +320,7 @@ hint: If you are running a script with `{}` in the shebang, you may need to incl editable, install_options, modifications, - None, + python_platform.as_ref(), (&settings).into(), &network_settings, &sync_state, @@ -421,6 +422,7 @@ hint: If you are running a script with `{}` in the shebang, you may need to incl environment, spec, modifications, + python_platform.as_ref(), build_constraints.unwrap_or_default(), script_extra_build_requires, &settings, @@ -837,7 +839,7 @@ hint: If you are running a script with `{}` in the shebang, you may need to incl editable, install_options, modifications, - None, + python_platform.as_ref(), (&settings).into(), &network_settings, &sync_state, @@ -998,6 +1000,7 @@ hint: If you are running a script with `{}` in the shebang, you may need to incl spec, build_constraints.unwrap_or_default(), &base_interpreter, + python_platform.as_ref(), &settings, &network_settings, &sync_state, diff --git a/crates/uv/src/commands/project/sync.rs b/crates/uv/src/commands/project/sync.rs index 1d22b852c..709c72756 100644 --- a/crates/uv/src/commands/project/sync.rs +++ b/crates/uv/src/commands/project/sync.rs @@ -253,6 +253,7 @@ pub(crate) async fn sync( environment.clone(), spec, modifications, + python_platform.as_ref(), build_constraints.unwrap_or_default(), script_extra_build_requires, &settings, diff --git a/crates/uv/src/commands/tool/install.rs b/crates/uv/src/commands/tool/install.rs index 43e627ffe..40c7658d6 100644 --- a/crates/uv/src/commands/tool/install.rs +++ b/crates/uv/src/commands/tool/install.rs @@ -8,11 +8,13 @@ use tracing::{debug, trace}; use uv_cache::{Cache, Refresh}; use uv_cache_info::Timestamp; use uv_client::BaseClientBuilder; -use uv_configuration::{Concurrency, Constraints, DryRun, Reinstall, Upgrade}; +use uv_configuration::{Concurrency, Constraints, DryRun, Reinstall, TargetTriple, Upgrade}; +use uv_distribution::LoweredExtraBuildDependencies; use uv_distribution_types::{ ExtraBuildRequires, NameRequirementSpecification, Requirement, RequirementSource, UnresolvedRequirementSpecification, }; +use uv_installer::{SatisfiesResult, SitePackages}; use uv_normalize::PackageName; use uv_pep440::{VersionSpecifier, VersionSpecifiers}; use uv_pep508::MarkerTree; @@ -29,6 +31,7 @@ use uv_workspace::WorkspaceCache; use crate::commands::ExitStatus; use crate::commands::pip::loggers::{DefaultInstallLogger, DefaultResolveLogger}; use crate::commands::pip::operations::{self, Modifications}; +use crate::commands::pip::{resolution_markers, resolution_tags}; use crate::commands::project::{ EnvironmentSpecification, PlatformState, ProjectError, resolve_environment, resolve_names, sync_environment, update_environment, @@ -53,6 +56,7 @@ pub(crate) async fn install( build_constraints: &[RequirementsSource], entrypoints: &[PackageName], python: Option, + python_platform: Option, install_mirrors: PythonInstallMirrors, force: bool, options: ResolverInstallerOptions, @@ -374,38 +378,70 @@ pub(crate) async fn install( }); // If the requested and receipt requirements are the same... - if existing_environment - .as_ref() - .filter(|_| { - // And the user didn't request a reinstall or upgrade... - !request.is_latest() - && settings.reinstall.is_none() - && settings.resolver.upgrade.is_none() - }) - .is_some() - { + if let Some(environment) = existing_environment.as_ref().filter(|_| { + // And the user didn't request a reinstall or upgrade... + !request.is_latest() && settings.reinstall.is_none() && settings.resolver.upgrade.is_none() + }) { if let Some(tool_receipt) = existing_tool_receipt.as_ref() { if requirements == tool_receipt.requirements() && constraints == tool_receipt.constraints() && overrides == tool_receipt.overrides() && build_constraints == tool_receipt.build_constraints() { - if *tool_receipt.options() != options { - // ...but the options differ, we need to update the receipt. - installed_tools.add_tool_receipt( - package_name, - tool_receipt.clone().with_options(options), + let ResolverInstallerSettings { + resolver: + ResolverSettings { + config_setting, + config_settings_package, + extra_build_dependencies, + extra_build_variables, + .. + }, + .. + } = &settings; + + // Lower the extra build dependencies, if any. + let extra_build_requires = LoweredExtraBuildDependencies::from_non_lowered( + extra_build_dependencies.clone(), + ) + .into_inner(); + + // Determine the markers and tags to use for the resolution. + let markers = resolution_markers(None, python_platform.as_ref(), &interpreter); + let tags = resolution_tags(None, python_platform.as_ref(), &interpreter)?; + + // Check if the installed packages meet the requirements. + let site_packages = SitePackages::from_environment(environment)?; + if matches!( + site_packages.satisfies_requirements( + requirements.iter(), + constraints.iter(), + overrides.iter(), + &markers, + &tags, + config_setting, + config_settings_package, + &extra_build_requires, + extra_build_variables, + ), + Ok(SatisfiesResult::Fresh { .. }) + ) { + // Then we're done! Though we might need to update the receipt. + if *tool_receipt.options() != options { + installed_tools.add_tool_receipt( + package_name, + tool_receipt.clone().with_options(options), + )?; + } + + writeln!( + printer.stderr(), + "`{}` is already installed", + requirement.cyan() )?; + + return Ok(ExitStatus::Success); } - - // We're done, though we might need to update the receipt. - writeln!( - printer.stderr(), - "`{}` is already installed", - requirement.cyan() - )?; - - return Ok(ExitStatus::Success); } } } @@ -439,6 +475,7 @@ pub(crate) async fn install( environment, spec, Modifications::Exact, + python_platform.as_ref(), Constraints::from_requirements(build_constraints.iter().cloned()), ExtraBuildRequires::default(), &settings, @@ -480,6 +517,7 @@ pub(crate) async fn install( let resolution = resolve_environment( spec.clone(), &interpreter, + python_platform.as_ref(), Constraints::from_requirements(build_constraints.iter().cloned()), &settings.resolver, &network_settings, @@ -534,6 +572,7 @@ pub(crate) async fn install( match resolve_environment( spec, &interpreter, + python_platform.as_ref(), Constraints::from_requirements(build_constraints.iter().cloned()), &settings.resolver, &network_settings, diff --git a/crates/uv/src/commands/tool/run.rs b/crates/uv/src/commands/tool/run.rs index aa6415962..194ae0e16 100644 --- a/crates/uv/src/commands/tool/run.rs +++ b/crates/uv/src/commands/tool/run.rs @@ -18,6 +18,7 @@ use uv_cli::ExternalCommand; use uv_client::BaseClientBuilder; use uv_configuration::Concurrency; use uv_configuration::Constraints; +use uv_configuration::TargetTriple; use uv_distribution::LoweredExtraBuildDependencies; use uv_distribution_types::InstalledDist; use uv_distribution_types::{ @@ -45,6 +46,7 @@ use uv_workspace::WorkspaceCache; use crate::child::run_to_completion; use crate::commands::ExitStatus; +use crate::commands::pip; use crate::commands::pip::loggers::{ DefaultInstallLogger, DefaultResolveLogger, SummaryInstallLogger, SummaryResolveLogger, }; @@ -89,6 +91,7 @@ pub(crate) async fn run( build_constraints: &[RequirementsSource], show_resolution: bool, python: Option, + python_platform: Option, install_mirrors: PythonInstallMirrors, options: ResolverInstallerOptions, settings: ResolverInstallerSettings, @@ -267,6 +270,7 @@ pub(crate) async fn run( build_constraints, show_resolution, python.as_deref(), + python_platform, install_mirrors, options, &settings, @@ -677,6 +681,7 @@ async fn get_or_create_environment( build_constraints: &[RequirementsSource], show_resolution: bool, python: Option<&str>, + python_platform: Option, install_mirrors: PythonInstallMirrors, options: ResolverInstallerOptions, settings: &ResolverInstallerSettings, @@ -966,8 +971,9 @@ async fn get_or_create_environment( .into_inner(); // Determine the markers and tags to use for the resolution. - let markers = interpreter.resolver_marker_environment(); - let tags = interpreter.tags()?; + let markers = + pip::resolution_markers(None, python_platform.as_ref(), &interpreter); + let tags = pip::resolution_tags(None, python_platform.as_ref(), &interpreter)?; // Check if the installed packages meet the requirements. let site_packages = SitePackages::from_environment(&environment)?; @@ -977,7 +983,7 @@ async fn get_or_create_environment( constraints.iter(), overrides.iter(), &markers, - tags, + &tags, config_setting, config_settings_package, &extra_build_requires, @@ -1025,6 +1031,7 @@ async fn get_or_create_environment( spec.clone(), build_constraints.clone(), &interpreter, + python_platform.as_ref(), settings, network_settings, &state, @@ -1084,6 +1091,7 @@ async fn get_or_create_environment( spec, build_constraints, &interpreter, + python_platform.as_ref(), settings, network_settings, &state, diff --git a/crates/uv/src/commands/tool/upgrade.rs b/crates/uv/src/commands/tool/upgrade.rs index b84aca3e8..88045074a 100644 --- a/crates/uv/src/commands/tool/upgrade.rs +++ b/crates/uv/src/commands/tool/upgrade.rs @@ -8,7 +8,7 @@ use tracing::{debug, trace}; use uv_cache::Cache; use uv_client::BaseClientBuilder; -use uv_configuration::{Concurrency, Constraints, DryRun}; +use uv_configuration::{Concurrency, Constraints, DryRun, TargetTriple}; use uv_distribution_types::{ExtraBuildRequires, Requirement}; use uv_fs::CWD; use uv_normalize::PackageName; @@ -40,6 +40,7 @@ use crate::settings::{NetworkSettings, ResolverInstallerSettings}; pub(crate) async fn upgrade( names: Vec, python: Option, + python_platform: Option, install_mirrors: PythonInstallMirrors, args: ResolverInstallerOptions, filesystem: ResolverInstallerOptions, @@ -125,6 +126,7 @@ pub(crate) async fn upgrade( name, constraints, interpreter.as_ref(), + python_platform.as_ref(), printer, &installed_tools, &args, @@ -210,6 +212,7 @@ async fn upgrade_tool( name: &PackageName, constraints: &[Requirement], interpreter: Option<&Interpreter>, + python_platform: Option<&TargetTriple>, printer: Printer, installed_tools: &InstalledTools, args: &ResolverInstallerOptions, @@ -296,6 +299,7 @@ async fn upgrade_tool( let resolution = resolve_environment( spec.into(), interpreter, + python_platform, build_constraints.clone(), &settings.resolver, network_settings, @@ -339,6 +343,7 @@ async fn upgrade_tool( environment, spec, Modifications::Exact, + python_platform, build_constraints, ExtraBuildRequires::default(), &settings, diff --git a/crates/uv/src/lib.rs b/crates/uv/src/lib.rs index 6175ee2c1..74878af61 100644 --- a/crates/uv/src/lib.rs +++ b/crates/uv/src/lib.rs @@ -1198,6 +1198,7 @@ async fn run(mut cli: Cli) -> Result { &build_constraints, args.show_resolution || globals.verbose > 0, args.python, + args.python_platform, args.install_mirrors, args.options, args.settings, @@ -1286,6 +1287,7 @@ async fn run(mut cli: Cli) -> Result { &build_constraints, &entrypoints, args.python, + args.python_platform, args.install_mirrors, args.force, args.options, @@ -1334,6 +1336,7 @@ async fn run(mut cli: Cli) -> Result { Box::pin(commands::tool_upgrade( args.names, args.python, + args.python_platform, args.install_mirrors, args.args, args.filesystem, @@ -1779,6 +1782,7 @@ async fn run_project( args.editable, args.modifications, args.python, + args.python_platform, args.install_mirrors, args.settings, globals.network_settings, diff --git a/crates/uv/src/settings.rs b/crates/uv/src/settings.rs index 7e45bff9b..119338d22 100644 --- a/crates/uv/src/settings.rs +++ b/crates/uv/src/settings.rs @@ -337,6 +337,7 @@ pub(crate) struct RunSettings { pub(crate) active: Option, pub(crate) no_sync: bool, pub(crate) python: Option, + pub(crate) python_platform: Option, pub(crate) install_mirrors: PythonInstallMirrors, pub(crate) refresh: Refresh, pub(crate) settings: ResolverInstallerSettings, @@ -391,6 +392,7 @@ impl RunSettings { package, no_project, python, + python_platform, show_resolution, env_file, no_env_file, @@ -450,6 +452,7 @@ impl RunSettings { no_sync, active: flag(active, no_active, "active"), python: python.and_then(Maybe::into_option), + python_platform, refresh: Refresh::from(refresh), settings: ResolverInstallerSettings::combine( resolver_installer_options(installer, build), @@ -477,6 +480,7 @@ pub(crate) struct ToolRunSettings { pub(crate) isolated: bool, pub(crate) show_resolution: bool, pub(crate) python: Option, + pub(crate) python_platform: Option, pub(crate) install_mirrors: PythonInstallMirrors, pub(crate) refresh: Refresh, pub(crate) options: ResolverInstallerOptions, @@ -510,6 +514,7 @@ impl ToolRunSettings { build, refresh, python, + python_platform, generate_shell_completion: _, } = args; @@ -585,6 +590,7 @@ impl ToolRunSettings { isolated, show_resolution, python: python.and_then(Maybe::into_option), + python_platform, refresh: Refresh::from(refresh), settings, options, @@ -608,6 +614,7 @@ pub(crate) struct ToolInstallSettings { pub(crate) overrides: Vec, pub(crate) build_constraints: Vec, pub(crate) python: Option, + pub(crate) python_platform: Option, pub(crate) refresh: Refresh, pub(crate) options: ResolverInstallerOptions, pub(crate) settings: ResolverInstallerSettings, @@ -636,6 +643,7 @@ impl ToolInstallSettings { build, refresh, python, + python_platform, } = args; let options = @@ -686,6 +694,7 @@ impl ToolInstallSettings { .filter_map(Maybe::into_option) .collect(), python: python.and_then(Maybe::into_option), + python_platform, force, editable, refresh: Refresh::from(refresh), @@ -701,6 +710,7 @@ impl ToolInstallSettings { pub(crate) struct ToolUpgradeSettings { pub(crate) names: Vec, pub(crate) python: Option, + pub(crate) python_platform: Option, pub(crate) install_mirrors: PythonInstallMirrors, pub(crate) args: ResolverInstallerOptions, pub(crate) filesystem: ResolverInstallerOptions, @@ -712,6 +722,7 @@ impl ToolUpgradeSettings { let ToolUpgradeArgs { name, python, + python_platform, upgrade, upgrade_package, index_args, @@ -789,6 +800,7 @@ impl ToolUpgradeSettings { Self { names: if all { vec![] } else { name }, python: python.and_then(Maybe::into_option), + python_platform, args, filesystem: top_level, install_mirrors, diff --git a/crates/uv/tests/it/show_settings.rs b/crates/uv/tests/it/show_settings.rs index abf5589f0..487534b42 100644 --- a/crates/uv/tests/it/show_settings.rs +++ b/crates/uv/tests/it/show_settings.rs @@ -3464,6 +3464,7 @@ fn resolve_tool() -> anyhow::Result<()> { overrides: [], build_constraints: [], python: None, + python_platform: None, refresh: None( Timestamp( SystemTime { diff --git a/crates/uv/tests/it/tool_install.rs b/crates/uv/tests/it/tool_install.rs index 848694d6c..793d1f6be 100644 --- a/crates/uv/tests/it/tool_install.rs +++ b/crates/uv/tests/it/tool_install.rs @@ -3968,3 +3968,58 @@ fn tool_install_with_executables_from_no_entrypoints() { Installed 1 executable: flask "###); } + +#[test] +fn tool_install_python_platform() { + let context = TestContext::new("3.12") + .with_filtered_counts() + .with_filtered_exe_suffix(); + let tool_dir = context.temp_dir.child("tools"); + let bin_dir = context.temp_dir.child("bin"); + + // Install `black` for macos. + uv_snapshot!(context.filters(), context.tool_install() + .arg("black") + .arg("--python-platform") + .arg("macos") + .env(EnvVars::UV_TOOL_DIR, tool_dir.as_os_str()) + .env(EnvVars::XDG_BIN_HOME, bin_dir.as_os_str()) + .env(EnvVars::PATH, bin_dir.as_os_str()), @r" + success: true + exit_code: 0 + ----- stdout ----- + + ----- stderr ----- + Resolved [N] packages in [TIME] + Prepared [N] packages in [TIME] + Installed [N] packages in [TIME] + + black==24.3.0 + + click==8.1.7 + + mypy-extensions==1.0.0 + + packaging==24.0 + + pathspec==0.12.1 + + platformdirs==4.2.0 + Installed 2 executables: black, blackd + "); + + // Install `black` for Linux. + uv_snapshot!(context.filters(), context.tool_install() + .arg("black") + .arg("--python-platform") + .arg("linux") + .env(EnvVars::UV_TOOL_DIR, tool_dir.as_os_str()) + .env(EnvVars::XDG_BIN_HOME, bin_dir.as_os_str()) + .env(EnvVars::PATH, bin_dir.as_os_str()), @r" + success: true + exit_code: 0 + ----- stdout ----- + + ----- stderr ----- + Resolved [N] packages in [TIME] + Prepared [N] packages in [TIME] + Uninstalled [N] packages in [TIME] + Installed [N] packages in [TIME] + ~ black==24.3.0 + Installed 2 executables: black, blackd + "); +} diff --git a/docs/reference/cli.md b/docs/reference/cli.md index 1a1d597bc..ebefb5433 100644 --- a/docs/reference/cli.md +++ b/docs/reference/cli.md @@ -233,7 +233,52 @@ uv run [OPTIONS] [COMMAND]

If the interpreter request is satisfied by a discovered environment, the environment will be used.

See uv python to view supported request formats.

-

May also be set with the UV_PYTHON environment variable.

--quiet, -q

Use quiet output.

+

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.

+

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:

+
    +
  • windows: An alias for x86_64-pc-windows-msvc, the default target for Windows
  • +
  • linux: An alias for x86_64-unknown-linux-gnu, the default target for Linux
  • +
  • macos: An alias for aarch64-apple-darwin, the default target for macOS
  • +
  • x86_64-pc-windows-msvc: A 64-bit x86 Windows target
  • +
  • aarch64-pc-windows-msvc: An ARM64 Windows target
  • +
  • i686-pc-windows-msvc: A 32-bit x86 Windows target
  • +
  • x86_64-unknown-linux-gnu: An x86 Linux target. Equivalent to x86_64-manylinux_2_28
  • +
  • aarch64-apple-darwin: An ARM-based macOS target, as seen on Apple Silicon devices
  • +
  • x86_64-apple-darwin: An x86 macOS target
  • +
  • aarch64-unknown-linux-gnu: An ARM64 Linux target. Equivalent to aarch64-manylinux_2_28
  • +
  • aarch64-unknown-linux-musl: An ARM64 Linux target
  • +
  • x86_64-unknown-linux-musl: An x86_64 Linux target
  • +
  • x86_64-manylinux2014: An x86_64 target for the manylinux2014 platform. Equivalent to x86_64-manylinux_2_17
  • +
  • x86_64-manylinux_2_17: An x86_64 target for the manylinux_2_17 platform
  • +
  • x86_64-manylinux_2_28: An x86_64 target for the manylinux_2_28 platform
  • +
  • x86_64-manylinux_2_31: An x86_64 target for the manylinux_2_31 platform
  • +
  • x86_64-manylinux_2_32: An x86_64 target for the manylinux_2_32 platform
  • +
  • x86_64-manylinux_2_33: An x86_64 target for the manylinux_2_33 platform
  • +
  • x86_64-manylinux_2_34: An x86_64 target for the manylinux_2_34 platform
  • +
  • x86_64-manylinux_2_35: An x86_64 target for the manylinux_2_35 platform
  • +
  • x86_64-manylinux_2_36: An x86_64 target for the manylinux_2_36 platform
  • +
  • x86_64-manylinux_2_37: An x86_64 target for the manylinux_2_37 platform
  • +
  • x86_64-manylinux_2_38: An x86_64 target for the manylinux_2_38 platform
  • +
  • x86_64-manylinux_2_39: An x86_64 target for the manylinux_2_39 platform
  • +
  • x86_64-manylinux_2_40: An x86_64 target for the manylinux_2_40 platform
  • +
  • aarch64-manylinux2014: An ARM64 target for the manylinux2014 platform. Equivalent to aarch64-manylinux_2_17
  • +
  • aarch64-manylinux_2_17: An ARM64 target for the manylinux_2_17 platform
  • +
  • aarch64-manylinux_2_28: An ARM64 target for the manylinux_2_28 platform
  • +
  • aarch64-manylinux_2_31: An ARM64 target for the manylinux_2_31 platform
  • +
  • aarch64-manylinux_2_32: An ARM64 target for the manylinux_2_32 platform
  • +
  • aarch64-manylinux_2_33: An ARM64 target for the manylinux_2_33 platform
  • +
  • aarch64-manylinux_2_34: An ARM64 target for the manylinux_2_34 platform
  • +
  • aarch64-manylinux_2_35: An ARM64 target for the manylinux_2_35 platform
  • +
  • aarch64-manylinux_2_36: An ARM64 target for the manylinux_2_36 platform
  • +
  • aarch64-manylinux_2_37: An ARM64 target for the manylinux_2_37 platform
  • +
  • aarch64-manylinux_2_38: An ARM64 target for the manylinux_2_38 platform
  • +
  • aarch64-manylinux_2_39: An ARM64 target for the manylinux_2_39 platform
  • +
  • aarch64-manylinux_2_40: An ARM64 target for the manylinux_2_40 platform
  • +
  • wasm32-pyodide2024: A wasm32 target using the Pyodide 2024 platform. Meant for use with Python 3.12
  • +
--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

--refresh-package refresh-package

Refresh cached data for a specific package

@@ -2103,7 +2148,52 @@ uv tool run [OPTIONS] [COMMAND]

This setting has no effect when used in the uv pip interface.

May also be set with the UV_PROJECT environment variable.

--python, -p python

The Python interpreter to use to build the run environment.

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

-

May also be set with the UV_PYTHON environment variable.

--quiet, -q

Use quiet output.

+

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.

+

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:

+
    +
  • windows: An alias for x86_64-pc-windows-msvc, the default target for Windows
  • +
  • linux: An alias for x86_64-unknown-linux-gnu, the default target for Linux
  • +
  • macos: An alias for aarch64-apple-darwin, the default target for macOS
  • +
  • x86_64-pc-windows-msvc: A 64-bit x86 Windows target
  • +
  • aarch64-pc-windows-msvc: An ARM64 Windows target
  • +
  • i686-pc-windows-msvc: A 32-bit x86 Windows target
  • +
  • x86_64-unknown-linux-gnu: An x86 Linux target. Equivalent to x86_64-manylinux_2_28
  • +
  • aarch64-apple-darwin: An ARM-based macOS target, as seen on Apple Silicon devices
  • +
  • x86_64-apple-darwin: An x86 macOS target
  • +
  • aarch64-unknown-linux-gnu: An ARM64 Linux target. Equivalent to aarch64-manylinux_2_28
  • +
  • aarch64-unknown-linux-musl: An ARM64 Linux target
  • +
  • x86_64-unknown-linux-musl: An x86_64 Linux target
  • +
  • x86_64-manylinux2014: An x86_64 target for the manylinux2014 platform. Equivalent to x86_64-manylinux_2_17
  • +
  • x86_64-manylinux_2_17: An x86_64 target for the manylinux_2_17 platform
  • +
  • x86_64-manylinux_2_28: An x86_64 target for the manylinux_2_28 platform
  • +
  • x86_64-manylinux_2_31: An x86_64 target for the manylinux_2_31 platform
  • +
  • x86_64-manylinux_2_32: An x86_64 target for the manylinux_2_32 platform
  • +
  • x86_64-manylinux_2_33: An x86_64 target for the manylinux_2_33 platform
  • +
  • x86_64-manylinux_2_34: An x86_64 target for the manylinux_2_34 platform
  • +
  • x86_64-manylinux_2_35: An x86_64 target for the manylinux_2_35 platform
  • +
  • x86_64-manylinux_2_36: An x86_64 target for the manylinux_2_36 platform
  • +
  • x86_64-manylinux_2_37: An x86_64 target for the manylinux_2_37 platform
  • +
  • x86_64-manylinux_2_38: An x86_64 target for the manylinux_2_38 platform
  • +
  • x86_64-manylinux_2_39: An x86_64 target for the manylinux_2_39 platform
  • +
  • x86_64-manylinux_2_40: An x86_64 target for the manylinux_2_40 platform
  • +
  • aarch64-manylinux2014: An ARM64 target for the manylinux2014 platform. Equivalent to aarch64-manylinux_2_17
  • +
  • aarch64-manylinux_2_17: An ARM64 target for the manylinux_2_17 platform
  • +
  • aarch64-manylinux_2_28: An ARM64 target for the manylinux_2_28 platform
  • +
  • aarch64-manylinux_2_31: An ARM64 target for the manylinux_2_31 platform
  • +
  • aarch64-manylinux_2_32: An ARM64 target for the manylinux_2_32 platform
  • +
  • aarch64-manylinux_2_33: An ARM64 target for the manylinux_2_33 platform
  • +
  • aarch64-manylinux_2_34: An ARM64 target for the manylinux_2_34 platform
  • +
  • aarch64-manylinux_2_35: An ARM64 target for the manylinux_2_35 platform
  • +
  • aarch64-manylinux_2_36: An ARM64 target for the manylinux_2_36 platform
  • +
  • aarch64-manylinux_2_37: An ARM64 target for the manylinux_2_37 platform
  • +
  • aarch64-manylinux_2_38: An ARM64 target for the manylinux_2_38 platform
  • +
  • aarch64-manylinux_2_39: An ARM64 target for the manylinux_2_39 platform
  • +
  • aarch64-manylinux_2_40: An ARM64 target for the manylinux_2_40 platform
  • +
  • wasm32-pyodide2024: A wasm32 target using the Pyodide 2024 platform. Meant for use with Python 3.12
  • +
--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

--refresh-package refresh-package

Refresh cached data for a specific package

@@ -2277,7 +2367,52 @@ uv tool install [OPTIONS]

This setting has no effect when used in the uv pip interface.

May also be set with the UV_PROJECT environment variable.

--python, -p python

The Python interpreter to use to build the tool environment.

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

-

May also be set with the UV_PYTHON environment variable.

--quiet, -q

Use quiet output.

+

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.

+

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:

+
    +
  • windows: An alias for x86_64-pc-windows-msvc, the default target for Windows
  • +
  • linux: An alias for x86_64-unknown-linux-gnu, the default target for Linux
  • +
  • macos: An alias for aarch64-apple-darwin, the default target for macOS
  • +
  • x86_64-pc-windows-msvc: A 64-bit x86 Windows target
  • +
  • aarch64-pc-windows-msvc: An ARM64 Windows target
  • +
  • i686-pc-windows-msvc: A 32-bit x86 Windows target
  • +
  • x86_64-unknown-linux-gnu: An x86 Linux target. Equivalent to x86_64-manylinux_2_28
  • +
  • aarch64-apple-darwin: An ARM-based macOS target, as seen on Apple Silicon devices
  • +
  • x86_64-apple-darwin: An x86 macOS target
  • +
  • aarch64-unknown-linux-gnu: An ARM64 Linux target. Equivalent to aarch64-manylinux_2_28
  • +
  • aarch64-unknown-linux-musl: An ARM64 Linux target
  • +
  • x86_64-unknown-linux-musl: An x86_64 Linux target
  • +
  • x86_64-manylinux2014: An x86_64 target for the manylinux2014 platform. Equivalent to x86_64-manylinux_2_17
  • +
  • x86_64-manylinux_2_17: An x86_64 target for the manylinux_2_17 platform
  • +
  • x86_64-manylinux_2_28: An x86_64 target for the manylinux_2_28 platform
  • +
  • x86_64-manylinux_2_31: An x86_64 target for the manylinux_2_31 platform
  • +
  • x86_64-manylinux_2_32: An x86_64 target for the manylinux_2_32 platform
  • +
  • x86_64-manylinux_2_33: An x86_64 target for the manylinux_2_33 platform
  • +
  • x86_64-manylinux_2_34: An x86_64 target for the manylinux_2_34 platform
  • +
  • x86_64-manylinux_2_35: An x86_64 target for the manylinux_2_35 platform
  • +
  • x86_64-manylinux_2_36: An x86_64 target for the manylinux_2_36 platform
  • +
  • x86_64-manylinux_2_37: An x86_64 target for the manylinux_2_37 platform
  • +
  • x86_64-manylinux_2_38: An x86_64 target for the manylinux_2_38 platform
  • +
  • x86_64-manylinux_2_39: An x86_64 target for the manylinux_2_39 platform
  • +
  • x86_64-manylinux_2_40: An x86_64 target for the manylinux_2_40 platform
  • +
  • aarch64-manylinux2014: An ARM64 target for the manylinux2014 platform. Equivalent to aarch64-manylinux_2_17
  • +
  • aarch64-manylinux_2_17: An ARM64 target for the manylinux_2_17 platform
  • +
  • aarch64-manylinux_2_28: An ARM64 target for the manylinux_2_28 platform
  • +
  • aarch64-manylinux_2_31: An ARM64 target for the manylinux_2_31 platform
  • +
  • aarch64-manylinux_2_32: An ARM64 target for the manylinux_2_32 platform
  • +
  • aarch64-manylinux_2_33: An ARM64 target for the manylinux_2_33 platform
  • +
  • aarch64-manylinux_2_34: An ARM64 target for the manylinux_2_34 platform
  • +
  • aarch64-manylinux_2_35: An ARM64 target for the manylinux_2_35 platform
  • +
  • aarch64-manylinux_2_36: An ARM64 target for the manylinux_2_36 platform
  • +
  • aarch64-manylinux_2_37: An ARM64 target for the manylinux_2_37 platform
  • +
  • aarch64-manylinux_2_38: An ARM64 target for the manylinux_2_38 platform
  • +
  • aarch64-manylinux_2_39: An ARM64 target for the manylinux_2_39 platform
  • +
  • aarch64-manylinux_2_40: An ARM64 target for the manylinux_2_40 platform
  • +
  • wasm32-pyodide2024: A wasm32 target using the Pyodide 2024 platform. Meant for use with Python 3.12
  • +
--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

--refresh-package refresh-package

Refresh cached data for a specific package

@@ -2442,7 +2577,52 @@ uv tool upgrade [OPTIONS] ...

May also be set with the UV_PROJECT environment variable.

--python, -p python

Upgrade a tool, and specify it to use the given Python interpreter to build its environment. 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.

--quiet, -q

Use quiet output.

+

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.

+

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:

+
    +
  • windows: An alias for x86_64-pc-windows-msvc, the default target for Windows
  • +
  • linux: An alias for x86_64-unknown-linux-gnu, the default target for Linux
  • +
  • macos: An alias for aarch64-apple-darwin, the default target for macOS
  • +
  • x86_64-pc-windows-msvc: A 64-bit x86 Windows target
  • +
  • aarch64-pc-windows-msvc: An ARM64 Windows target
  • +
  • i686-pc-windows-msvc: A 32-bit x86 Windows target
  • +
  • x86_64-unknown-linux-gnu: An x86 Linux target. Equivalent to x86_64-manylinux_2_28
  • +
  • aarch64-apple-darwin: An ARM-based macOS target, as seen on Apple Silicon devices
  • +
  • x86_64-apple-darwin: An x86 macOS target
  • +
  • aarch64-unknown-linux-gnu: An ARM64 Linux target. Equivalent to aarch64-manylinux_2_28
  • +
  • aarch64-unknown-linux-musl: An ARM64 Linux target
  • +
  • x86_64-unknown-linux-musl: An x86_64 Linux target
  • +
  • x86_64-manylinux2014: An x86_64 target for the manylinux2014 platform. Equivalent to x86_64-manylinux_2_17
  • +
  • x86_64-manylinux_2_17: An x86_64 target for the manylinux_2_17 platform
  • +
  • x86_64-manylinux_2_28: An x86_64 target for the manylinux_2_28 platform
  • +
  • x86_64-manylinux_2_31: An x86_64 target for the manylinux_2_31 platform
  • +
  • x86_64-manylinux_2_32: An x86_64 target for the manylinux_2_32 platform
  • +
  • x86_64-manylinux_2_33: An x86_64 target for the manylinux_2_33 platform
  • +
  • x86_64-manylinux_2_34: An x86_64 target for the manylinux_2_34 platform
  • +
  • x86_64-manylinux_2_35: An x86_64 target for the manylinux_2_35 platform
  • +
  • x86_64-manylinux_2_36: An x86_64 target for the manylinux_2_36 platform
  • +
  • x86_64-manylinux_2_37: An x86_64 target for the manylinux_2_37 platform
  • +
  • x86_64-manylinux_2_38: An x86_64 target for the manylinux_2_38 platform
  • +
  • x86_64-manylinux_2_39: An x86_64 target for the manylinux_2_39 platform
  • +
  • x86_64-manylinux_2_40: An x86_64 target for the manylinux_2_40 platform
  • +
  • aarch64-manylinux2014: An ARM64 target for the manylinux2014 platform. Equivalent to aarch64-manylinux_2_17
  • +
  • aarch64-manylinux_2_17: An ARM64 target for the manylinux_2_17 platform
  • +
  • aarch64-manylinux_2_28: An ARM64 target for the manylinux_2_28 platform
  • +
  • aarch64-manylinux_2_31: An ARM64 target for the manylinux_2_31 platform
  • +
  • aarch64-manylinux_2_32: An ARM64 target for the manylinux_2_32 platform
  • +
  • aarch64-manylinux_2_33: An ARM64 target for the manylinux_2_33 platform
  • +
  • aarch64-manylinux_2_34: An ARM64 target for the manylinux_2_34 platform
  • +
  • aarch64-manylinux_2_35: An ARM64 target for the manylinux_2_35 platform
  • +
  • aarch64-manylinux_2_36: An ARM64 target for the manylinux_2_36 platform
  • +
  • aarch64-manylinux_2_37: An ARM64 target for the manylinux_2_37 platform
  • +
  • aarch64-manylinux_2_38: An ARM64 target for the manylinux_2_38 platform
  • +
  • aarch64-manylinux_2_39: An ARM64 target for the manylinux_2_39 platform
  • +
  • aarch64-manylinux_2_40: An ARM64 target for the manylinux_2_40 platform
  • +
  • wasm32-pyodide2024: A wasm32 target using the Pyodide 2024 platform. Meant for use with Python 3.12
  • +
--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

--reinstall-package reinstall-package

Reinstall a specific package, regardless of whether it's already installed. Implies --refresh-package