How do I make a `python_distribution` dependent on...
# general
r
How do I make a
python_distribution
dependent on every
python_source
target in a subdirectory?
dependencies=[":pyproject", "mypackage::"],
is throwing an error.
r
pick the nearest
python_sources
target
Wait
r
Yeah it's only picking up a few sources
Feel like I'm missing something obvious
r
If you had something like an entry point, it’s simpler. Otherwise if the python sources are just loose modules, then you might have to define a globbed target and put dependency on that.
Copy code
python_sources(name="sources", sources=["**/*.py", "!**/test_*.py"])
python_distribution(dependencies=[":sources"])
This would mean that any subdirectory
python_sources
would have to be removed because pants will complain about multiple ownership