I wonder if the current graph / rule engine implem...
# development
f
I wonder if the current graph / rule engine implementation allows asking for dependencies of an arbitrary target while inferring dependencies? Inside
Copy code
@rule
async def get_dependencies_python_sources(
    request: MyInferDependenciesRequest,
) -> InferredDependencies:
...
I have a custom target object and I want to get its dependencies.
Copy code
$ pants dependencies module.py
# get_dependencies_python_sources is run
# I have a target that is a dependency of module.py
Now I want to ask for dependencies of
target
. But
deps = await Get(Addresses, MyCustomTargetDependenciesRequest(target.get(Dependencies)))
doesn't work - a matching rule can't be found. Is there any other way to get the dependencies (by running that custom rule of mine returning the
InferredDependencies(addresses)
?
asking in the terminal
Copy code
pants dependencies <my-custom-target-address>
works fine, so I know the rule is valid