Curious if anyone can suggest a tool for visualiza...
# general
Curious if anyone can suggest a tool for visualization of a Python project dependency graph? Looking to have a deeper understanding on how
./pants dependees --transitive <file_path>
finds links to files. The current dump shows all dependees for a file but not how they are connected.
I made an -ad-hoc script using
and the output of
./pants peek
@happy-kitchen-89482 also maybe had a way, I can't remember
can also use
./pants paths --from=$target1 --to=$target2
βž• 1
to note this repo using version 2.7.0, so not sure if we have these features or not. We are planning to upgrade. We did write custom script to build some visual of what pants dependees outputs but want to see if we don't need to reinvent the wheel here. I heard of not sure if that offers a good view of what pants finds.
I think what @witty-crayon-22786 mentioned is the syntax we would need. How does the output work for that goal?
it’s a JSON list of the various paths between two targets
so it effectively explains all of the reasons that target1 depends on target2
that's awesome. I'm going to experiment a bit and see how it works. It may be a bit fine grained as I was hoping to have a way to visualize this for every path in the repo.
@rapid-bird-79300 use
./pants peek ::
for that πŸ™‚
yea, @happy-kitchen-89482 has something for that. and you can convert the
output to
. it is generally very interesting, but
can be better for debugging particular issues
gives you JSON metadata for the CLI arg. In this case using
means "everything". So: "give me all the metadata for the entire repo". Then filter using
or your favorite json lib
does pants peek show us the paths to dependees? I thought that operated similar to
which currently does not show the paths.
no, but you can build that using the information, since you have every edge
yeah that's what we are experimenting with in our custom script but wanted to see if we didn't have to re-invent the wheel here.
I like the d3 force graph visuals. It seems easy enough to setup, will give that a go. We are building the graph using anytree with dotexplorer and render tree txt output, but the project is quite large so it has been a pain. Also I noticed
./pants dependees --no-transitive --output-format=json --output-file=app_dependees.txt app/::
is not sufficient because it does not show files. Where
/pants dependees --no-transitive --output-format=json --output-file=app_dependees.txt 'app/**/*.py'
shows all file dependees. However, you need both to keep it accurate.
yea, the
dependees json
output format has essentially been replaced with
in later versions
πŸ‘ 1
βœ… 1