future-oxygen-10553
08/25/2022, 8:00 PMpython_distribution
? Do I need to list all of them individually? Or is there some way to say “All python_source()
targets which are in subdirectories of this BUILD
file”?high-yak-85899
08/25/2022, 8:01 PMpython_sources
target and then add that target to my dependencies for my distribution.high-yak-85899
08/25/2022, 8:02 PMfuture-oxygen-10553
08/25/2022, 8:03 PMI had to capture all my sources in one top levelHow did you do that?targetpython_sources
high-yak-85899
08/25/2022, 8:03 PMsources
glob pattern to **/*.py
future-oxygen-10553
08/25/2022, 8:03 PMhigh-yak-85899
08/25/2022, 8:03 PMBUILD
files below thatfuture-oxygen-10553
08/25/2022, 8:03 PM./pants tailor --check
have a problem with that?high-yak-85899
08/25/2022, 8:04 PMhigh-yak-85899
08/25/2022, 8:04 PMfuture-oxygen-10553
08/25/2022, 8:05 PMhundreds-father-404
08/25/2022, 8:11 PMoverrides
when you're using recursive sources globs like that. It keeps metadata as precise as possible
python_tests(
sources=["**/*_test.py"],
overrides={
"subdir/foo_test.py": {"timeout": 120},
},
)
(You can use globs in the key, like with *
. And you can use a tuple for the key for multiple globs / file namesfuture-oxygen-10553
08/25/2022, 8:17 PMwitty-crayon-22786
08/25/2022, 8:18 PMwitty-crayon-22786
08/25/2022, 8:19 PMimport
statements)…
https://github.com/pantsbuild/pants/blob/485d5858bbdd7f450a015d70bd6f76adb86e33ac/src/python/pants/bin/BUILD#L6-L70
but it isn’t necessary to “include all of the sources” for those plugins. they have dependencies, and those dependencies will be pulled in.future-oxygen-10553
08/25/2022, 8:19 PMpackage-name
|--- __init__.py
|--- submodule/__init__.py
|--- submodule/sububmodule/__init__.py
|--- BUILD
BUILD
pyproject.toml
witty-crayon-22786
08/25/2022, 8:21 PMfuture-oxygen-10553
08/25/2022, 8:21 PMwitty-crayon-22786
08/25/2022, 8:22 PMfuture-oxygen-10553
08/25/2022, 8:23 PMwitty-crayon-22786
08/25/2022, 8:23 PMhigh-yak-85899
08/25/2022, 8:27 PMwitty-crayon-22786
09/08/2022, 9:31 PM