Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uv tool install --reinstall not working as documented #8067

Open
dpoznik opened this issue Oct 10, 2024 · 7 comments
Open

uv tool install --reinstall not working as documented #8067

dpoznik opened this issue Oct 10, 2024 · 7 comments
Labels
documentation Improvements or additions to documentation

Comments

@dpoznik
Copy link
Contributor

dpoznik commented Oct 10, 2024

The docs suggest that uv tool install --reinstall should reinstall all packages:

$ uv --version
uv 0.4.20 (0e1b25a53 2024-10-08)

$ uv tool install --help
...
      --reinstall                              Reinstall all packages, regardless of whether they're already installed. Implies `--refresh`
      --reinstall-package <REINSTALL_PACKAGE>  Reinstall a specific package, regardless of whether it's already installed. Implies `--refresh-package`
...

This suggests that one need not specify a particular package. But in practice, a package name is expected:

$ uv tool install --reinstall
error: the following required arguments were not provided:
  <PACKAGE>

Usage: uv tool install --reinstall --index-url <INDEX_URL> <PACKAGE>
@charliermarsh
Copy link
Member

uv tool install --reinstall <PACKAGE> will reinstall <PACKAGE> and all of its dependencies (whereas uv tool --reinstall-package <FOO> <PACKAGE> will reinstall <FOO>, but not <PACKAGE>). Any suggestions on how to make this clearer?

@charliermarsh charliermarsh added the documentation Improvements or additions to documentation label Oct 10, 2024
@bluss
Copy link
Contributor

bluss commented Oct 10, 2024

--reinstall is not "Reinstall all tools", but it's like "Reinstall everything for one tool".

Maybe this is a clarification.
Here PACKAGE is the tool you want to install:

Usage: uv tool install [OPTIONS] <PACKAGE>

But below, packages is all the distribution packages in the installation of the tool (the previous single PACKAGE).

Installer options:
      --reinstall
          Reinstall all packages, regardless of whether they're already installed. Implies
          `--refresh`

@dpoznik
Copy link
Contributor Author

dpoznik commented Oct 10, 2024

Any suggestions on how to make this clearer?

Perhaps something like the following, wherein instances of "package" have been edited to forms of "dependency" to disambiguate "packages" providing tools from "packages" these tool-providing packages depend on:

      --reinstall                         Reinstall all dependencies, regardless of whether they're already installed. Implies `--refresh`
      --reinstall-package <DEPENDENCY>    Reinstall a specific dependency, regardless of whether it's already installed. Implies `--refresh-package`

      --refresh                           Refresh all cached data
      --refresh-package <DEPENDENCY>      Refresh cached data for a specific dependency

It may be even clearer if the second and fourth option were --reinstall-dependency and --refresh-dependency, respectively. But that would involve more than just a documentation tweak.

Thanks!

@dpoznik
Copy link
Contributor Author

dpoznik commented Oct 10, 2024

Relatedly, does uv tool have an equivalent to pipx's reinstall-all subcommand?
I find this useful when, for example, upgrading Python.

@charliermarsh
Copy link
Member

You can do uv tool upgrade --all. You can even do uv tool upgrade --all --python 3.13 to upgrade all installed tools to Python 3.13.

@dpoznik
Copy link
Contributor Author

dpoznik commented Oct 10, 2024

You can do uv tool upgrade --all. You can even do uv tool upgrade --all --python 3.13 to upgrade all installed tools to Python 3.13.

Ah, so uv tool upgrade is closer in behavior to pipx reinstall than to pipx upgrade, which upgrades a tool within its existing environment. Got it. Thanks!

If not already present, it may be worth noting this contrast somewhere in the docs to help folks transition.

@charliermarsh
Copy link
Member

\cc @zanieb for opinions on changing the --reinstall docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants