astral-sh / rye

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

`update` subcommand for `rye tools` #1301

Open lengau opened 4 months ago

lengau commented 4 months ago

Allow updating a tool using rye tools update rather than having to install -f it.

Current workflow:

$ rye tools install uv
error: package already installed
$ rye tools
Helper utility to manage global tools

Usage: rye tools <COMMAND>

Commands:
  install    Installs a package as global tool
  uninstall  Uninstalls a global tool
  list       List all registered tools
  help       Print this message or the help of the given subcommand(s)

Options:
  -h, --help  Print help
$ rye tools install -f uv
Resolved 1 package in 184ms
Prepared 1 package in 205ms
Installed 1 package in 0.76ms
 + uv==0.2.32

Installed scripts:
  - uv
  - uvx

Expected workflow:

$ rye tools update uv
Resolved 1 package in 184ms
Prepared 1 package in 205ms
Installed 1 package in 0.76ms
 + uv==0.2.32

Installed scripts:
  - uv
  - uvx
raoulg commented 2 months ago

Yes, currently, if I want to update a global tool, my workaround is:

rye tools uninstall uv && rye tools install uv

Or something along those lines.