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 pip tree machine readable output #4711

Open
ibraheemdev opened this issue Jul 1, 2024 · 4 comments
Open

uv pip tree machine readable output #4711

ibraheemdev opened this issue Jul 1, 2024 · 4 comments
Labels
cli Related to the command line interface help wanted Contribution especially encouraged

Comments

@ibraheemdev
Copy link
Member

e.g. JSON with -j. This is useful for interacting with graph tools such as mermaid.

@ibraheemdev ibraheemdev added the cli Related to the command line interface label Jul 1, 2024
@zanieb
Copy link
Member

zanieb commented Jul 1, 2024

I think we should probably use --format json for consistency with other interfaces?

@zanieb zanieb added the help wanted Contribution especially encouraged label Jul 1, 2024
@zanieb
Copy link
Member

zanieb commented Jul 1, 2024

See also #411

@ChannyClaus
Copy link
Contributor

ChannyClaus commented Jul 3, 2024

should this be part of uv pip tree or uv pip list? uv pip list --format json seems to already print something very similar to what pipdeptree --json prints:

$ uv pip list --format json | jq 
[
  {
    "name": "certifi",
    "version": "2024.6.2"
  },
  {
    "name": "charset-normalizer",
    "version": "3.3.2"
  },
  {
    "name": "idna",
    "version": "3.7"
  },
  {
    "name": "requests",
    "version": "2.32.3"
  },
  {
    "name": "urllib3",
    "version": "2.2.2"
  }
]

additionally the output of pipdeptree --json doesn't seem to necessarily relate to the concept of tree, since when there's a nested dependency, it doesn't actually nest it in the json output.

thoughts @dsully @kdeldycke?

@kdeldycke
Copy link

Oh I'm not really picky about the shape of the JSON output, as long as it is machine readable.

That's because I'm only interested in creating a Mermaid diagram to visualize dependencies like so: https://kdeldycke.github.io/meta-package-manager/install.html#python-dependencies

So whatever the JSON looks like, I'll have to write a script to generate the .mmd file out of uv pip tree output.

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 help wanted Contribution especially encouraged
Projects
None yet
Development

No branches or pull requests

4 participants