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

Tree-like visualization of dependencies #8077

Closed
stonebig opened this issue Apr 18, 2020 · 9 comments
Closed

Tree-like visualization of dependencies #8077

stonebig opened this issue Apr 18, 2020 · 9 comments
Labels
C: list/show 'pip list' or 'pip show' state: needs discussion This needs some more discussion type: feature request Request for a new feature UX: functionality research epic Temporary label to link tickets to #8516 UX User experience related

Comments

@stonebig
Copy link
Contributor

What's the problem this feature will solve?
In the context of building a Python Distrubution, I suffer a lot to understand and manage dependancies and version contraints.

Recently, I fell on pipdeptree and it blew my mind per :

  • it's relative simplicity of code,
  • it's usefulness, especially by providing internals in json style.

Describe the solution you'd like

  • I whish:
    . the pipdeptree feature shall be in standard pip ( a pip "--tree" option ?),
    . pip internals becomes as accessible as pipdeptree, with json output options

today, when I want to know what package is use by what:
. pipdeptree + navigating the indented ouput let me see where/why a package is used
. pipdeptree -r + navigating the indented ouput let me see where/why a package is used from the other side (less practical for 1 given package, but not bad)
. I'm interested in its internal access (not command line) and json output options, as simplifying work to try build a simple GUI over pip...

Alternative Solutions
continue to use pipdeptree, if pip doesn't evolve

Additional context
Maintaining WinPython, while trying to have its "specifics weight" smaller and smaller (relying more and more on standard pip, standard pypi, ...)

@triage-new-issues triage-new-issues bot added the S: needs triage Issues/PRs that need to be triaged label Apr 18, 2020
@stonebig stonebig changed the title a beaautifull tree of depedencies a beautifull tree of dependancies with pip --tree Apr 18, 2020
@McSinyx
Copy link
Contributor

McSinyx commented Apr 18, 2020

There's also pipgrip (see #988 (comment)) which can show the dependency graph. However, as mentioned in the linked issue, the dependency relationships made by pip is not yet correct (at least not by default, proper dependency resolution will be out soon this year I hope), so for now you might want to stick with your current solution. BTW there are many cool features depending on proper resolution (batch upgrade, autoremove, etc.) that I can't wait to see!

Edit: did not see GH-8076. Also I looked it up and found GH-4968 asking for the opposite feature of pipdeptree too.

@stonebig
Copy link
Contributor Author

just feeded the idea pipeline, hope it wheel help.

@uranusjr
Copy link
Member

I do like the idea. Something like pip list --tree might work, although we’ll need to think of a way to express broken dependencies.

It might also be a useful feature to show a (partial) tree when a pip install call succeeds. I think one of NPM and Yarn does this, or do they both? But JavaScript dependencies are nested, so we’ll need to change the format somewhat to fit Python’s dependency model.

@pradyunsg
Copy link
Member

pradyunsg commented Apr 18, 2020

HAI

Can we come up a pip inspect command to replace check, list, show and freeze?

Then it can have a --tree option, and I'll be a happy kiddo.

KTHXBYE

@pradyunsg pradyunsg added state: needs discussion This needs some more discussion type: feature request Request for a new feature labels Apr 18, 2020
@triage-new-issues triage-new-issues bot removed the S: needs triage Issues/PRs that need to be triaged label Apr 18, 2020
@pradyunsg pradyunsg changed the title a beautifull tree of dependancies with pip --tree Tree-like visualization of dependencies Apr 18, 2020
@pradyunsg pradyunsg added the UX User experience related label Apr 26, 2020
@pradyunsg
Copy link
Member

@ei8fdb FYI

@sinoroc
Copy link
Contributor

sinoroc commented Aug 18, 2020

Out of this discussion on pipdeptree, as some kind of challenge, I eventually wrote deptree. It might be of interest to those looking for this kind of feature.

Anyway, since pipdeptree already uses pip's internal private APIs it could be a good fit to get parts of it integrated into pip.

@alexchandel
Copy link

This feature is a must. pipdeptree does it perfectly. Just merge their code in.

@sbidoul sbidoul added the C: list/show 'pip list' or 'pip show' label Jul 12, 2022
@ssbarnea
Copy link
Contributor

ssbarnea commented Aug 7, 2022

@alexchandel As of 2022, pipdeptree is unamaintained and it does not work with recent pip versions nor with py311.

@stonebig
Copy link
Contributor Author

I did my own implementation, using from importlib.metadata import Distribution , distributions

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
C: list/show 'pip list' or 'pip show' state: needs discussion This needs some more discussion type: feature request Request for a new feature UX: functionality research epic Temporary label to link tickets to #8516 UX User experience related
Projects
None yet
Development

No branches or pull requests

9 participants