diff --git a/crates/uv-python/src/downloads.rs b/crates/uv-python/src/downloads.rs index f97a8fc2b..c3c52018e 100644 --- a/crates/uv-python/src/downloads.rs +++ b/crates/uv-python/src/downloads.rs @@ -206,10 +206,7 @@ impl PythonDownloadRequest { /// Fill empty entries with default values. /// /// Platform information is pulled from the environment. - pub fn fill(mut self) -> Result { - if self.implementation.is_none() { - self.implementation = Some(ImplementationName::CPython); - } + pub fn fill_platform(mut self) -> Result { if self.arch.is_none() { self.arch = Some(Arch::from_env()); } @@ -222,6 +219,14 @@ impl PythonDownloadRequest { Ok(self) } + pub fn fill(mut self) -> Result { + if self.implementation.is_none() { + self.implementation = Some(ImplementationName::CPython); + } + self = self.fill_platform()?; + Ok(self) + } + /// Construct a new [`PythonDownloadRequest`] with platform information from the environment. pub fn from_env() -> Result { Ok(Self::new( diff --git a/crates/uv/src/commands/python/list.rs b/crates/uv/src/commands/python/list.rs index 60f05d2e4..794ab1bd1 100644 --- a/crates/uv/src/commands/python/list.rs +++ b/crates/uv/src/commands/python/list.rs @@ -79,16 +79,16 @@ pub(crate) async fn list( PythonListKinds::Downloads => Some(if all_platforms { base_download_request } else { - base_download_request.fill()? + base_download_request.fill_platform()? }), PythonListKinds::Default => { if python_downloads.is_automatic() { Some(if all_platforms { base_download_request } else if all_arches { - base_download_request.fill()?.with_any_arch() + base_download_request.fill_platform()?.with_any_arch() } else { - base_download_request.fill()? + base_download_request.fill_platform()? }) } else { // If fetching is not automatic, then don't show downloads as available by default