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

Support uv tool install package@version to match uvx #6535

Closed
zanieb opened this issue Aug 23, 2024 · 10 comments · Fixed by #6762
Closed

Support uv tool install package@version to match uvx #6535

zanieb opened this issue Aug 23, 2024 · 10 comments · Fixed by #6762
Assignees
Labels
cli Related to the command line interface enhancement New feature or improvement to existing functionality good first issue Good for newcomers uv tool Related to the uv tool interface

Comments

@zanieb
Copy link
Member

zanieb commented Aug 23, 2024

Otherwise, going from uvx to uv tool install can be surprising.

@zanieb zanieb added enhancement New feature or improvement to existing functionality cli Related to the command line interface uv tool Related to the uv tool interface labels Aug 23, 2024
@charliermarsh charliermarsh added the good first issue Good for newcomers label Aug 23, 2024
@baggiponte
Copy link

I wonder whether using @ is appropriate over package==version. The @ is documented for example here for uv pip install "ruff @ ./projects/ruff".

@charliermarsh
Copy link
Member

package==version does work here already. But uvx uses package@version because it does not accept an arbitrary version specifier, just a single version, and we want to disambiguate.

@chrisrodrigue
Copy link

@ is very commonly used for specifying locations/paths, for example [email protected] or package@path/to/pkg/src.

Maybe this could cause some confusion/surprises.

@zanieb
Copy link
Member Author

zanieb commented Aug 23, 2024

It might not be worth it, but... I'm not sure if it's that common? We had a lot of complaints about requiring package @ path and I'm not sure how person@company applies? Regardless, we can easily:

  1. Tell if it's a path and/or
  2. Treat it as we would now if it's not a valid PEP 440 version — that's what we do in uvx tool@version

@chrisrodrigue
Copy link

Ah sorry, I should have clarified that [email protected] is an email address 😆

I’m not sure what PEPs might govern tokens used in the context of package paths/versions but RFC 3986 could be a good standard to reference that covers allowed uses of @ in URIs if there isn’t anything more relevant.

@zanieb
Copy link
Member Author

zanieb commented Aug 23, 2024

To be clear — we already support uvx [email protected] and uvx ruff@latest so we already have clear semantics around this. This issue is about extending those semantics to uv tool install to avoid confusion.

@chrisrodrigue
Copy link

chrisrodrigue commented Aug 23, 2024

That makes sense 😁

(By the way, it looks like PEP 440 covers @ for direct references with explicit URLs.)

@charliermarsh
Copy link
Member

Gonna do this now.

@damienrj
Copy link

damienrj commented Aug 28, 2024

This would also make sense given the docs indicate that the @ is the method for doing the install.

The name of the command can include an exact version in the format @, e.g., uv run [email protected]. If more complex version specification is desired or if the command is provided by a different package, use --from.

@charliermarsh
Copy link
Member

(Separately, there's a typo there, it should be uv tool run [email protected].)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Related to the command line interface enhancement New feature or improvement to existing functionality good first issue Good for newcomers uv tool Related to the uv tool interface
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants