Fill Python requests with platform information during automatic fetches (#4810)

Closes https://github.com/astral-sh/uv/issues/4800

We do this during `install` — it's an important step to ensure the
request has the platform information in it.
This commit is contained in:
Zanie Blue 2024-07-05 17:13:57 -04:00 committed by GitHub
parent 77b1bb77b5
commit c0ca0b02b8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -88,7 +88,7 @@ impl PythonInstallation {
// Perform a fetch aggressively if managed Python is preferred
if matches!(preference, PythonPreference::Managed) && python_fetch.is_automatic() {
if let Some(request) = PythonDownloadRequest::try_from_request(&request) {
return Self::fetch(request, client_builder, cache).await;
return Self::fetch(request.fill(), client_builder, cache).await;
}
}
@ -103,7 +103,7 @@ impl PythonInstallation {
{
if let Some(request) = PythonDownloadRequest::try_from_request(&request) {
debug!("Requested Python not found, checking for available download...");
Self::fetch(request, client_builder, cache).await
Self::fetch(request.fill(), client_builder, cache).await
} else {
err
}