Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions crates/uv-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 6 additions & 0 deletions crates/uv-python/src/downloads.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 4 additions & 1 deletion crates/uv/src/commands/python/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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()?
})
Expand Down
1 change: 1 addition & 0 deletions crates/uv/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1088,6 +1088,7 @@ async fn run(mut cli: Cli) -> Result<ExitStatus> {
args.kinds,
args.all_versions,
args.all_platforms,
args.all_arches,
args.show_urls,
globals.python_preference,
globals.python_downloads,
Expand Down
3 changes: 3 additions & 0 deletions crates/uv/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand All @@ -726,6 +727,7 @@ impl PythonListSettings {
let PythonListArgs {
all_versions,
all_platforms,
all_arches,
only_installed,
only_downloads,
show_urls,
Expand All @@ -742,6 +744,7 @@ impl PythonListSettings {
Self {
kinds,
all_platforms,
all_arches,
all_versions,
show_urls,
}
Expand Down
6 changes: 5 additions & 1 deletion docs/reference/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -4351,7 +4351,11 @@ uv python list [OPTIONS]

<h3 class="cli-reference">Options</h3>

<dl class="cli-reference"><dt><code>--all-platforms</code></dt><dd><p>List Python downloads for all platforms.</p>
<dl class="cli-reference"><dt><code>--all-arches</code></dt><dd><p>List Python downloads for all architectures.</p>

<p>By default, only downloads for the current architecture are shown.</p>

</dd><dt><code>--all-platforms</code></dt><dd><p>List Python downloads for all platforms.</p>

<p>By default, only downloads for the current platform are shown.</p>

Expand Down