bitter-ability-32190
12/20/2021, 2:44 PMtailor
would have me use. One BUILD
file in each directory that matters.
โฆ Pros: Granular. Pants internals kind of assume this pattern (so target names are sane, etc...).
โฆ Cons: Still boilerplate-y (MUCH less so than say, Bazel. But still have N files which just repeat python_sources()
, python_test_utils
, python_tests
over and over).
2. Second is one BUILD
file in the "root" which has nested globs for each (E.g. sources=["***/**.py", "!**/conftest.py", ...]
) and then I can override when necessary at the directory level (assuming that works ๐ค )
โฆ Pros: Minimal boilerplate
โฆ Cons: Less granular. Pants internals don't assume this (the target name of the generator is funny looking when printed)
Q: Is pants smart enough for option 2 to not have double ownership? Can it be taught to be?
Q: What considerations should be made about cache invalidation? If I edit the top-level file in #2, do I bust any caching?
Q: For option 2, can I improve the names that get spit out? Does the "generators-are-not-targets" proposal help this case?hundreds-father-404
12/20/2021, 2:47 PMtailor
does. See https://www.pantsbuild.org/docs/targets#target-generation and https://github.com/pantsbuild/pants/issues/13488
But we think this isn't flexible enough, you have to repeast yourself too much: https://github.com/pantsbuild/pants/issues/13767bitter-ability-32190
12/20/2021, 3:04 PMbitter-ability-32190
12/20/2021, 3:05 PMBUILD
while I'm only using Pants for fmt/lint/check
as to not scare my devs by adding a bajillion BUILD.pants
fileshundreds-father-404
12/20/2021, 3:07 PMbitter-ability-32190
12/20/2021, 3:07 PMcurved-television-6568
12/20/2021, 3:08 PMhundreds-father-404
12/20/2021, 3:09 PMbitter-ability-32190
12/21/2021, 4:23 PM