Skip to content

Commit

Permalink
Improve output when an older toolchain version is already installed (#…
Browse files Browse the repository at this point in the history
…4248)

e.g.

```
❯ uv toolchain install
Found installed toolchain 'cpython-3.9.19-macos-aarch64-none'
A toolchain is already installed. Use `uv toolchain install <request>` to install a specific toolchain
```

instead of

```
❯ uv toolchain install
Using latest Python version
Found installed toolchain 'cpython-3.9.19-macos-aarch64-none'
Already installed at /Users/zb/Library/Application Support/uv/toolchains/cpython-3.9.19-macos-aarch64-none
```
  • Loading branch information
zanieb authored Jun 11, 2024
1 parent dce913c commit 8cfe202
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions crates/uv/src/commands/toolchain/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ pub(crate) async fn install(
}
request
} else {
writeln!(printer.stderr(), "Using latest Python version")?;
ToolchainRequest::default()
};

Expand All @@ -58,11 +57,19 @@ pub(crate) async fn install(
"Found installed toolchain '{}'",
toolchain.key()
)?;
writeln!(
printer.stderr(),
"Already installed at {}",
toolchain.path().user_display()
)?;

if matches!(request, ToolchainRequest::Any) {
writeln!(
printer.stderr(),
"A toolchain is already installed. Use `uv toolchain install <request>` to install a specific toolchain.",
)?;
} else {
writeln!(
printer.stderr(),
"Already installed at {}",
toolchain.path().user_display()
)?;
}
return Ok(ExitStatus::Success);
}

Expand Down

0 comments on commit 8cfe202

Please sign in to comment.