uv icon indicating copy to clipboard operation
uv copied to clipboard

List specifier used to install a tool

Open paidhi opened this issue 1 year ago • 5 comments

Currently (uv v0.3.5) if a constraint is used with uv tool install the version/restriction is pinned and subsequent uv tool upgrade commands might not update to a newer release. E.g. `uv tool install "pyinfra<3.0".

Over time I imagine it's easy to forget that a tool was installed this way. And as a result one might start wondering why e.g. uv tool upgrade --all misses newer versions for some tools.

I think it would help if the output from uv tool list shows what specifier was used to install a tool (which is stored in $(uv tool dir)/${package_name}/uv-receipt.toml).

Example (mockup):

$ uv tool install "pyinfra<3.0"

$ uv tool list
pyinfra v2.9.2 (specifier: "<3.0")
- pyinfra

paidhi avatar Aug 28 '24 12:08 paidhi

This seems reasonable, I wonder if it should be opt-in though?

zanieb avatar Aug 28 '24 13:08 zanieb

--show-specifiers would be fine with me.

charliermarsh avatar Aug 28 '24 13:08 charliermarsh

We have this as --show-version-specifiers in uv pip tree

zanieb avatar Aug 28 '24 13:08 zanieb

Maybe opt-in as part of a --verbose option (uv tool list -v).

paidhi avatar Aug 28 '24 14:08 paidhi

That's fine with me too.

zanieb avatar Aug 28 '24 14:08 zanieb