rye
rye copied to clipboard
How should we go about updating the global tools applications?
We can use rye install ...
to install some python applications, but how to update it? Currently it seems the only option is to uninstall and then reinstall. pip can use --upgrade to update the application. Can we also add another parameter to update the application?
The functionality of rye install
is based on rye add
, so there should be an update mechanism such as adding the --upgrade
flag, so that the project's virtual environment can update the package (as well as synchronize the update of the pyproject.toml
file), and the tools
can be updated as well.
Also is there a need for a command like --upgrade-all
to update all the tools?
You can rye install the-tool --force
to update.
You can
rye install the-tool --force
to update.您可以rye install the-tool --force
进行更新。
you are right, but it doesn't feel very graceful.
It's not very graceful, but it works for now. I think I should add this to the docs until a better command exists.
related: https://github.com/mitsuhiko/rye/discussions/518
The main problem with “rye install the-tool --force” right now is that it doesn’t work great when run automatically, e.g. as part of a script to update various global packages throughout the system.
I wrote a bit about that here: https://github.com/mitsuhiko/rye/discussions/496#discussion-5838264
But the short version is that you lose any pinned python version for a tool, and it always reinstalls the tool even if the version hasn’t changed, so it gets slow when you have a lot of them
If uv
is used to facilitate this, perhaps uv tool upgrade
could be exposed as rye tools upgrade
? Related uv
addition within the past couple of days: https://github.com/astral-sh/uv/commit/cbc3274848dbbf8420b475232579db962a863811 (new as of uv
0.2.35)