In rule code, I need to go from resolve name to a ...
# plugins
p
In rule code, I need to go from resolve name to a list of python_distribution targets in that resolve. My mind is feeling like mush right now… anyone have an idea on how to approach this?
1
w
you’d probably want to request
AllTargets
(or all python targets, if there is such a thing), filter to the relevant target type, and then request the resolve for each of them
👍 1
p
OK. I got
AllTargets
and then tried
tgt.get(PythonResolveField).normalized_value(python_setup)
which felt like a clean solution. Then I just realized that
PythonDistribution
does not have a
PythonResolveField
. 🫠
So, uhm… Get the transitive deps of each python_distribution and calculate all of the resolves that they encompass. This sounds like a very expensive ask. Any more suggestions?