Hey Team, really noob question but how would one r...
# general
r
Hey Team, really noob question but how would one request
Dependencies
like this
./pants dependencies app/something/::
in a Pants plugin? I have used Dependees (dependents) before like this
Copy code
dependents = await Get(
        Dependees,
        DependeesRequest(
            (t.address for t in req.targets),
            transitive=False,
            include_roots=False,
        ),
    )
but I'm not sure rule similar rule exists for
Dependencies
?
Also I have done this before
Copy code
parsed_dependencies = await Get(
        ParsedPythonDependencies,
        ParsePythonDependenciesRequest(
            request.source.get(PythonSourceField),
            InterpreterConstraints(("==3.9.5",)),
            string_imports=False,
            string_imports_min_dots=2,
            assets=False,
            assets_min_slashes=0,
        ),
    )
but was thinking of a more generic rule that just take addresses and returns all dependencies
w
DependenciesRequest
exists, but it’s for a single target
if you want to do something for all of the targets in a directory, you’d want to match a
Spec
first to match all of the targets in the directory
👍 1
r
once we have the spec just
MultiGet
for each
FilteredTarget
?
w
looking for an example
r
that is dead simple thank you for sharing these examples. I will give it go on my end