hi! i'm playing around with setting up Pants in th...
# general
d
hi! i'm playing around with setting up Pants in this repo: https://github.com/wandb/wandb. For now, just trying to set up Python. When I run
pants tailor ::
it generates a very large number of BUILD files because the project is big and has many directories containing Python code. I'm unfamiliar with most of the code so this makes me a little nervous. Is there a way to do this more incrementally? For instance, could I set up a top-level
python_sources
and break it up gradually later, starting with the directories I'm most familiar with?
a
iirc you can do
python_sources(files=["**/*.py", "!**/test_*.py", ...])
and
python_tests(...)
d
thank you! i'll try that
a
But, I'd recommend biting the bullet on lots of BUILD files now. Or at least, proof-of-concept it as one, but split it out ASAP. It'll make managing dependencies (and blocked dependencies), maintenance, refactoring, etc a lot easier
I think you can also tell
pants tailor
which directories to tailor, so you don't need to do it all at once.
like, one example with one BUILD file, would be. If you have a component dependent on something that's not source file (i.e. a html template) it becomes quite finnicky to manage those dependencies.
d
yeah I realized that it might be worth it to just bite the bullet after reading about dependencies a bit more
c
You can also use [tailor] ignore_paths={} or pants_ignore.add as methods of incremental rollout