high-yak-85899
04/14/2022, 9:28 PMBUILD
files in all directories. Is there any way to make a python_distribution
that does something like src/my_project::
in the dependencies
section? Am I forced to make a pyproject.toml
to do that specifying?hundreds-father-404
04/14/2022, 9:31 PMhigh-yak-85899
04/14/2022, 9:33 PMresources(name="my_source_files", sources=["//where/my/stuff/is/**/*.py"])
and then put that in the dependencies
section of my python_distribution
. It definitely didn't grab all the proper dependencies so I'm wondering if I can point directly to the python_sources
defined throughout that root directory instead of making this separate resources
target.high-yak-85899
04/14/2022, 9:39 PMhundreds-father-404
04/14/2022, 9:41 PMhigh-yak-85899
04/14/2022, 9:44 PMpython_sources
😞high-yak-85899
04/14/2022, 9:45 PMBUILD
files.high-yak-85899
04/14/2022, 9:56 PMresources
target.enough-analyst-54434
04/14/2022, 11:48 PMfile
or resource
then Pants is dumb and you have to tell it everything. If the target is a *_source
Pants is smart and can infer dependencies, etc. So for the latter you generally just need to point at the "root" target if there is a natural one and then dependency inference will do the rest except for those hopefully rare cases where you had to add a manual dependency.high-yak-85899
04/14/2022, 11:59 PMresources
not doing anything fancy transitively. My issue is that, say I have a project like
-> src
-> lib1
- BUILD.pants
- lib1_module1.py
- lib1_module2.py
-> lib2
- BUILD.pants
- lib2_module1.py
- lib2_module2.py
-> lib3
- BUILD.pants
- lib3_module1.py
- lib3_module2.py
, how is is it recommended to make a distribution? It seems like I have to do something like
python_distribution(
dependencies=[
"src/lib1:lib1",
"src/lib2:lib2",
"src/lib3:lib3"
]
)
if I am to follow the Pants convention of putting BUILD files throughout the source tree. The way I get around this is moving my python_sources
target up to the top of src
and changing the glob pattern to ***/**.py
. Then, I don't have to update my python_distribution
dependencies every time I add a new lib to that source tree.enough-analyst-54434
04/15/2022, 12:32 AMhigh-yak-85899
04/15/2022, 12:42 AM