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

Implement "uv pip show" #1594

Closed
jab opened this issue Feb 17, 2024 · 4 comments
Closed

Implement "uv pip show" #1594

jab opened this issue Feb 17, 2024 · 4 comments
Labels
compatibility Compatibility with a specification or another tool enhancement New feature or improvement to existing functionality help wanted Contribution especially encouraged

Comments

@jab
Copy link

jab commented Feb 17, 2024

❯ uv --version
uv 0.1.2

❯ uv pip show uv
error: unrecognized subcommand 'show'

Usage: uv pip [OPTIONS] <COMMAND>

For more information, try '--help'.

❯ pip show uv
Name: uv
Version: 0.1.2
Summary: An extremely fast Python package installer and resolver, written in Rust.
Home-page: https://pypi.org/project/uv/
Author: uv
Author-email: "Astral Software Inc." <hey@astral.sh>
License: MIT OR Apache-2.0
Location: /Users/jab/src/bidict/.venv/dev/lib/python3.12/site-packages
Requires:
Required-by:

❯ pip show -qq uv && echo uv installed || echo uv not installed
uv installed

As in the last example, the -qq form is particularly useful for querying just whether any version of a particular package is installed, which is all I actually need.

It's possible to run uv pip freeze | grep ... instead, but it seems like it might be easy enough and worth it to add uv pip show <pkg> (or at least uv pip show -qq <pkg>), which should also be faster.

@jab
Copy link
Author

jab commented Feb 17, 2024

Relatedly, uv pip list is also missing, which has some overlap here. I'll hold off on creating a separate ticket for that for now though.

@ismail
Copy link

ismail commented Feb 17, 2024

@jab #1401 for pip list.

@zanieb zanieb added enhancement New feature or improvement to existing functionality compatibility Compatibility with a specification or another tool help wanted Contribution especially encouraged labels Feb 17, 2024
charliermarsh pushed a commit that referenced this issue Mar 6, 2024
## Summary
Implementation for #1594
The output will contain only the name, version and location of the
packages for now but it should be extendable to include other
information in the future.

Quite inexperienced with Rust, so please forgive me if there are things
that obviously don't make sense 😭

## Test Plan
Added a bunch of unit tests. The exit code behavior matches `pip`'s
behavior:
- When the package is found -> exit code 0
- When the package isn't found -> exit code 1
- When one package is found but another isn't -> exit code 0
@charliermarsh
Copy link
Member

This was added in #2115.

@charliermarsh
Copy link
Member

Thanks @ChannyClaus!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility Compatibility with a specification or another tool enhancement New feature or improvement to existing functionality help wanted Contribution especially encouraged
Projects
None yet
Development

No branches or pull requests

4 participants