astral-sh / uv

An extremely fast Python package installer and resolver, written in Rust.
https://astral.sh/
Apache License 2.0
11.74k stars 321 forks source link

Add a `pipdeptree` like output #3272

Open mgaitan opened 2 weeks ago

mgaitan commented 2 weeks ago

pipdeptree is a cool tool for visualizing the dependency tree of python packages. It allows users to see a structured "tree" of dependencies and, using its reverse mode, to understand why a particular dependency is required for our project.

One particularly useful use case of pipdeptree is to filter out only the "top-level" packages. This helps in cleaning up *.in files by leaving the resolution of transitive dependencies to the compilation process.

Would it be possible to support something similar to this as a built-in feature of uv ? something like uv pip list --format=tree ?

charliermarsh commented 2 weeks ago

I like the idea of having a tree view for this. cargo tree is another good example -- really useful.

MarcinKonowalczyk commented 2 weeks ago

Strong support for this(!) I was about to make a proposal similar to it, although i didn't know pipdpeptree so was going to use pip-chill as an example. I'd love to see alongside this functionality like pip-autoremove - remove given package and all the orphan packages it leaves behind.

samypr100 commented 2 weeks ago

For reference/design, poetry has --tree as part of poetry show