Add a hint to use a newer uv when a managed Python download is not found (#17461)
## Summary Suggest using a newer uv version when a managed python installation request fails with `NoDownloadFound`. Before: ``` error: No interpreter found for Python ==3.14.* in managed installations or search path ``` After: ``` error: No interpreter found for Python ==3.14.* in managed installations or search path hint: uv embeds available Python downloads and may require an update to install new versions. Consider retrying on a newer version of uv. ``` ## Test Plan Integration test added for this case. --------- Co-authored-by: Zanie Blue <contact@zanie.dev>
This commit is contained in:
@@ -159,7 +159,13 @@ impl PythonInstallation {
|
||||
Ok(Err(downloads::Error::NoDownloadFound(_))) => {
|
||||
if downloads_enabled {
|
||||
debug!("No downloads are available for {request}");
|
||||
return Err(err);
|
||||
if matches!(request, PythonRequest::Default | PythonRequest::Any) {
|
||||
return Err(err);
|
||||
}
|
||||
return Err(err.with_missing_python_hint(
|
||||
"uv embeds available Python downloads and may require an update to install new versions. Consider retrying on a newer version of uv."
|
||||
.to_string(),
|
||||
));
|
||||
}
|
||||
None
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user