Improve display of selected interpreter sources (#3748)

e.g. this error message is not great

```
❯ uv venv --python 3.12.2
  × No interpreter found for Python 3.12.2 in provided path, search path, managed toolchains, or parent interpreter
```
This commit is contained in:
Zanie Blue 2024-05-22 14:39:22 -04:00 committed by GitHub
parent 6962147831
commit 0e75eb8d78
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 103 additions and 75 deletions

View file

@ -700,12 +700,7 @@ mod tests {
fn find_interpreter_version_minor() -> Result<()> {
let tempdir = TempDir::new()?;
let cache = Cache::temp()?;
let sources = SourceSelector::from_sources([
InterpreterSource::ProvidedPath,
InterpreterSource::ActiveEnvironment,
InterpreterSource::DiscoveredEnvironment,
InterpreterSource::SearchPath,
]);
let sources = SourceSelector::All;
with_vars(
[
@ -757,12 +752,7 @@ mod tests {
fn find_interpreter_version_patch() -> Result<()> {
let tempdir = TempDir::new()?;
let cache = Cache::temp()?;
let sources = SourceSelector::from_sources([
InterpreterSource::ProvidedPath,
InterpreterSource::ActiveEnvironment,
InterpreterSource::DiscoveredEnvironment,
InterpreterSource::SearchPath,
]);
let sources = SourceSelector::All;
with_vars(
[
@ -814,12 +804,7 @@ mod tests {
fn find_interpreter_version_minor_no_match() -> Result<()> {
let tempdir = TempDir::new()?;
let cache = Cache::temp()?;
let sources = SourceSelector::from_sources([
InterpreterSource::ProvidedPath,
InterpreterSource::ActiveEnvironment,
InterpreterSource::DiscoveredEnvironment,
InterpreterSource::SearchPath,
]);
let sources = SourceSelector::All;
with_vars(
[
@ -861,12 +846,7 @@ mod tests {
fn find_interpreter_version_patch_no_match() -> Result<()> {
let tempdir = TempDir::new()?;
let cache = Cache::temp()?;
let sources = SourceSelector::from_sources([
InterpreterSource::ProvidedPath,
InterpreterSource::ActiveEnvironment,
InterpreterSource::DiscoveredEnvironment,
InterpreterSource::SearchPath,
]);
let sources = SourceSelector::All;
with_vars(
[