Pip: Tree-like visualization of dependencies

Created on 18 Apr 2020  路  7Comments  路  Source: pypa/pip

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, ...)

UX UX - functionality research epic needs discussion feature request

Most helpful comment

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

All 7 comments

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鈥檒l 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鈥檒l need to change the format somewhat to fit Python鈥檚 dependency model.

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

@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_.

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

Was this page helpful?
0 / 5 - 0 ratings