Show PyPy downloads during uv python list (#12915)

Fixes #12914.
When `PythonDownloadRequest` does not have the `implementation` set, do
not set it to CPython when calling `fill`, otherwise only CPython
interpreters are shown when listing interpreters available for download,
with `uv python list`.
This commit is contained in:
Alex Prengère 2025-04-17 18:59:13 +02:00 committed by GitHub
parent 89b221d72b
commit 451c834ebb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 7 deletions

View file

@ -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<Self, Error> {
if self.implementation.is_none() {
self.implementation = Some(ImplementationName::CPython);
}
pub fn fill_platform(mut self) -> Result<Self, Error> {
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<Self, Error> {
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<Self, Error> {
Ok(Self::new(