I'm reading up on synthesized targets. My recent s...
# development
p
I'm reading up on synthesized targets. My recent stevedore PR adds inferred dependencies on the python implementations for a subset of the entry points of
python_distributions
I wonder if it would be good to create synthetic targets for each of the entry points on the
python_distribution
and then infer dependencies on those instead of on the underlying python code. One of the rules generates an entry_points.txt file for
python_tests
. If there were synthetic entry point targets, then that rule could look for any direct or transitive dependencies on these synthetic targets instead of looking for the
python_distribution
and descending into the field to discover the entry points. This way, if test depends on the distribution itself, the entry_points.txt would get all of the entry points, not just the selected ones inferred by my plugin. And that would mean only one rule would generate that file so that two rules do not have to cooperatively choose which one generates the file. Or maybe instead of a synthetic target, we could reimagine
python_distribution
as a hybrid target generator that is both a target and generates these entry point targets. In any case, I think this would be a future enhancement - I don't want to do it in my current stevedore PR. But I'm imagining the future of it. @curved-television-6568 what do you think?
c
Interesting. I’ll have to spend some time thinking on this 🙂