I had two separate questions about the generation ...
# general
c
I had two separate questions about the generation of
BUILD
files for
python_tests
targets. See the code snippets below for reference. ā€¢ Why is a
name
parameter generated at all? Why is this necessary? ā€¢ Why is it that sometimes a
"tests0"
string is (rarely) used for a name, whereas other times
"tests"
is used?
Copy code
# path/to/some/BUILD
python_tests(
    name="tests0",
)

# path/to/another/BUILD
python_tests(
    name="tests",
)
āœ… 1
n
Name is needed so it can be referenced and targeted, otherwise Pants can't differentiate between e.g.
python_sources()
and
python_tests()
within a BUILD file.
šŸ‘ 1
h
Exactly, this section: https://www.pantsbuild.org/docs/targets#target-addresses. We need an unambiguous way to refer to each "target"
Re why it sometimes uses
tests0
, that means the name
tests
was already claimed in that directory
c
I see. Thank you!