pip
pip copied to clipboard
Tree-like visualization of dependencies
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 <Enter> + navigating the indented ouput let me see where/why a package is used . pipdeptree -r <Enter> + 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, ...)
There's also pipgrip (see https://github.com/pypa/pip/issues/988#issuecomment-572797302) 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.
just feeded the idea pipeline, hope it wheel help.
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.
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.
@ei8fdb FYI
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.
- https://github.com/naiquevin/pipdeptree/issues/1
This feature is a must. pipdeptree does it perfectly. Just merge their code in.
@alexchandel As of 2022, pipdeptree is unamaintained and it does not work with recent pip versions nor with py311.