flat-zoo-31952
01/19/2022, 5:43 PM.build/src/module/BUILD
would map to src/module/BUILD
?hundreds-father-404
01/19/2022, 5:45 PMflat-zoo-31952
01/19/2022, 6:04 PMflat-zoo-31952
01/19/2022, 6:07 PMhundreds-father-404
01/19/2022, 6:09 PMhundreds-father-404
01/19/2022, 6:11 PM**
recursive globs. We don't generally recommend that per https://www.pantsbuild.org/docs/targets#target-generation, but it is totally feasible to do especially thanks to the overrides
field added in 2.8
(If you haven't read that page in the past two months, I encourage re-reading it. It was rewritten with some conceptual changes in 2.8)flat-zoo-31952
01/19/2022, 7:16 PMhundreds-father-404
01/19/2022, 7:18 PMflat-zoo-31952
01/19/2022, 7:20 PMflat-zoo-31952
01/19/2022, 7:24 PMpath/to/file.py
in the dependencies
field of another target gives
❯ ./pants dependencies src:alerting-config-ci
14:23:36.92 [ERROR] 1 Exception encountered:
ResolveError: Directory 'path/to' does not contain any BUILD files.
flat-zoo-31952
01/19/2022, 7:30 PMpath/to/file.py:../../all-sources
(where `all-sources) was the name of my recursive targetflat-zoo-31952
01/19/2022, 7:31 PMhundreds-father-404
01/19/2022, 8:03 PMhundreds-father-404
01/19/2022, 8:06 PMdir:tgt#app.py
rather than dir/app.py:tgt
. A benefit would be that path/to/file.py:../../all-sources
becomes //:all_sources#path/to/file.py
withou the ../
part. But we decided file address syntax is generally better, and it's part of why we recommend 1-1-1 to avoid the awkwardness of ../
flat-zoo-31952
01/19/2022, 8:13 PMhundreds-father-404
01/19/2022, 8:17 PMflat-zoo-31952
01/19/2022, 8:18 PMhundreds-father-404
01/19/2022, 8:20 PMpython_requirements
will generate 3rdparty/python#Django
instead of 3rdparty/python:Django
. So we'll have 3 syntaxes:
• normal one for explicit targets
• file addresses
• generated targets
I still think it's useful to consolidate to just two syntaxes (https://github.com/pantsbuild/pants/issues/12917). But I wasn't persuasive enough and I see benefits to file addressesflat-zoo-31952
01/19/2022, 8:24 PMhundreds-father-404
01/19/2022, 8:26 PMpython_requirements
, go_thirdparty_package
(already released)flat-zoo-31952
01/19/2022, 8:27 PMhundreds-father-404
01/19/2022, 8:29 PM#
syntax regardless of it describes files or is file-less. Consistency is valuableflat-zoo-31952
01/19/2022, 8:31 PM#
to things I might type on the command line doesn't sound greatflat-zoo-31952
01/19/2022, 8:32 PMflat-zoo-31952
01/19/2022, 8:32 PMhundreds-father-404
01/19/2022, 8:33 PM❯ ./pants list 3rdparty/python#PyYAML
3rdparty/python#PyYAML
adding # to things I might type on the command line doesn't sound greatYou normally would not need to because you can use file arguments like
f.py
. Pants will find the owning target for youhundreds-father-404
01/19/2022, 8:38 PM./pants test
would be less useful and less copy-and-pasteable. We would report that dir#tests.py
succeeded, rather than dir/tests.py