diff --git a/crates/uv-cli/src/lib.rs b/crates/uv-cli/src/lib.rs index 94ab6ef878f18..8324d5f8701b3 100644 --- a/crates/uv-cli/src/lib.rs +++ b/crates/uv-cli/src/lib.rs @@ -4222,6 +4222,12 @@ pub struct PythonListArgs { #[arg(long)] pub all_platforms: bool, + /// List Python downloads for all architectures. + /// + /// By default, only downloads for the current architecture are shown. + #[arg(long, alias = "all_architectures")] + pub all_arches: bool, + /// Only show installed Python versions, exclude available downloads. /// /// By default, available downloads for the current platform are shown. diff --git a/crates/uv-python/src/downloads.rs b/crates/uv-python/src/downloads.rs index 0f32b6eef6700..d0a502a96ea3e 100644 --- a/crates/uv-python/src/downloads.rs +++ b/crates/uv-python/src/downloads.rs @@ -144,6 +144,12 @@ impl PythonDownloadRequest { self } + #[must_use] + pub fn with_any_arch(mut self) -> Self { + self.arch = None; + self + } + #[must_use] pub fn with_os(mut self, os: Os) -> Self { self.os = Some(os); diff --git a/crates/uv/src/commands/python/list.rs b/crates/uv/src/commands/python/list.rs index 0c859770bcb44..8c49ef8ebe29f 100644 --- a/crates/uv/src/commands/python/list.rs +++ b/crates/uv/src/commands/python/list.rs @@ -25,11 +25,12 @@ enum Kind { } /// List available Python installations. -#[allow(clippy::too_many_arguments)] +#[allow(clippy::too_many_arguments, clippy::fn_params_excessive_bools)] pub(crate) async fn list( kinds: PythonListKinds, all_versions: bool, all_platforms: bool, + all_arches: bool, show_urls: bool, python_preference: PythonPreference, python_downloads: PythonDownloads, @@ -49,6 +50,8 @@ pub(crate) async fn list( if python_downloads.is_automatic() { Some(if all_platforms { PythonDownloadRequest::default() + } else if all_arches { + PythonDownloadRequest::from_env()?.with_any_arch() } else { PythonDownloadRequest::from_env()? }) diff --git a/crates/uv/src/lib.rs b/crates/uv/src/lib.rs index 029f772ab7d3a..f6ffefe8ac6c5 100644 --- a/crates/uv/src/lib.rs +++ b/crates/uv/src/lib.rs @@ -1088,6 +1088,7 @@ async fn run(mut cli: Cli) -> Result { args.kinds, args.all_versions, args.all_platforms, + args.all_arches, args.show_urls, globals.python_preference, globals.python_downloads, diff --git a/crates/uv/src/settings.rs b/crates/uv/src/settings.rs index ada9e69ae8a81..cd8d705930ac9 100644 --- a/crates/uv/src/settings.rs +++ b/crates/uv/src/settings.rs @@ -715,6 +715,7 @@ pub(crate) enum PythonListKinds { pub(crate) struct PythonListSettings { pub(crate) kinds: PythonListKinds, pub(crate) all_platforms: bool, + pub(crate) all_arches: bool, pub(crate) all_versions: bool, pub(crate) show_urls: bool, } @@ -726,6 +727,7 @@ impl PythonListSettings { let PythonListArgs { all_versions, all_platforms, + all_arches, only_installed, only_downloads, show_urls, @@ -742,6 +744,7 @@ impl PythonListSettings { Self { kinds, all_platforms, + all_arches, all_versions, show_urls, } diff --git a/docs/reference/cli.md b/docs/reference/cli.md index 6c925f47bdac1..6878535f4aa8b 100644 --- a/docs/reference/cli.md +++ b/docs/reference/cli.md @@ -4351,7 +4351,11 @@ uv python list [OPTIONS]

Options

-
--all-platforms

List Python downloads for all platforms.

+
--all-arches

List Python downloads for all architectures.

+ +

By default, only downloads for the current architecture are shown.

+ +
--all-platforms

List Python downloads for all platforms.

By default, only downloads for the current platform are shown.