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:
Luis Nell
2026-01-15 10:58:41 +01:00
committed by GitHub
parent 0c08cba0c4
commit db7d1a2058
2 changed files with 38 additions and 1 deletions
+7 -1
View File
@@ -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
}