ambitious-xylophone-5772
10/21/2022, 3:37 PMpython_sources()
python_tests(
name="tests0",
sources=["test_a.py"],
)
python_tests(
name="tests1",
sources=["test_b.py"],
)
python_tests(
name="tests2",
sources=["test_c.py"],
)
and ./pants list
returns the following:
repo/test:tests0
repo/test:tests1
repo/test:tests2
repo/test/test_a.py:test0
repo/test/test_b.py:test1
repo/test/test_c.py:test2
witty-crayon-22786
10/21/2022, 4:17 PMpython_tests
is a “target generator”, which generates a target per file: the generator itself has a name, and each generated python_test
target does too. see https://www.pantsbuild.org/docs/targets#target-generationpython_tests
target (which tailor
will do by default)ambitious-xylophone-5772
10/21/2022, 4:19 PMwitty-crayon-22786
10/21/2022, 4:22 PMambitious-xylophone-5772
10/21/2022, 6:08 PMwitty-crayon-22786
10/21/2022, 6:16 PMtailor
doesn’t get you a good experience out of the box, an issue would be appreciated… our goal is that folks mostly don’t need to hand-edit BUILD
files, except to add metadataambitious-xylophone-5772
10/21/2022, 6:45 PMtailor
didn’t seem to pick that up.witty-crayon-22786
10/21/2022, 6:55 PMfile
and resource
targets) is disabled by default, but you can enable it: https://www.pantsbuild.org/docs/reference-python-infer#assets