astral-sh / rye

a Hassle-Free Python Experience
https://rye.astral.sh
MIT License
13.6k stars 466 forks source link

List all existing tool references on `rye toolchain remove` #1346

Closed soof-golan closed 3 weeks ago

soof-golan commented 1 month ago

Using rye toolchain remove now lists all tools that use a specific toolchain.

This eliminates the Whac-a-Mole game of reiterating through the rye toolchain remove blabla command in order to actually remove it.

Example Usage

$ rye install black --quiet --python 3.11.7
$ rye toolchain remove 3.11.7
error: toolchain cpython@3.11.7 is still in use by tool black
$ rye install ruff --quiet --python 3.11.7
$ rye toolchain remove 3.11.7
error: toolchain cpython@3.11.7 is still in use by tools: black, ruff

(Side note: Rust isn't my main d2d language, feel free to comment on coding style and unidiomatic code)