https://pantsbuild.org/ logo
#general
Title
# general
l

loud-laptop-17949

09/16/2022, 9:49 PM
Is there any way to get more structured output from commands like
dependees
? I am trying to get a map of dependees for a bunch of files and am either faced with running through a loop and calling dependees for each (slow) or using xargs to
./pants
and calling dependees once, losing track of which target the dependee came from. Ideally I could call
dependees
(and maybe other commands like it) once with a bunch of targets and get something like a json map of which target has which dependee.
w

witty-crayon-22786

09/16/2022, 9:52 PM
using
./pants peek ::
will get you the adjacency list for all targets
l

loud-laptop-17949

09/16/2022, 9:57 PM
I should have added that I want to filter those by type
w

witty-crayon-22786

09/16/2022, 9:58 PM
like
./pants --filter-target-type=… peek ::
?
l

loud-laptop-17949

09/16/2022, 9:58 PM
something like
./pants list ... | xargs ./pants dependees --filter-target-type=python_test
no I want to filter the dependees by type
w

witty-crayon-22786

09/16/2022, 9:58 PM
got it.
l

loud-laptop-17949

09/16/2022, 9:58 PM
basically "give me a list of python_source's which are not depended upon by a python_test"
best idea I have now is 1. get a list of python_source's 2. for each: list dependees (slow), filtering by target type and count
w

witty-crayon-22786

09/16/2022, 10:03 PM
./pants peek ::
plus some pretty simple recursive code will get you something similar faster probably:
peek
also includes the type information
faster
from a performance perspective
4 Views