I'm reaching the point where I need to either 1. ...
# general
a
I'm reaching the point where I need to either 1. Murder my ML team 2. Introduce multiple resolves Assuming I keep my hands clean, can I set multiple resolves for
python_sources
as a default, even at the root of a repository, and what would be the downside to doing so? Some dependencies, eg
pyarrow
and its ill-born companions, are used across multiple parts of the system, and I don't wanna go into every BUILD file in the repo and separately consider which resolves should or should not apply.
😆 2
e
You can use the __defaults__ syntax in a build file to apply a default value to all targets (of a particular type) in that build file and in nested subdirectories. Combining this with parametrize should let you set a particular set of resolves on all targets by default. Then you can override this on a per-target basis for those files that need a single resolve (or a different set of multiple resolves)
a
Any downsides?
e
Not much. The only one I can think of is that there is risk of it being overly broad to default everything like this, but that's more of a question of your situation than a true con, I think.
One other thing (more to do with multiple resolves than this particular solution, I guess): This effectively means you have duplicated targets. So for every resolve a source file belongs to, you need to run lint/typecheck/tests.
This is correct behavior because it lints/checks/tests that the file actually works in each of the resolves you've stated it must work in, but it does cause a multiplicative increase to dev time (pre-commit hooks, for example) and CI time.
a
Yeah, I was just thinking through that - I'm presuming that pants lint|check etc will run through each resolve automagically?
e
I think it should yes
a
Winner. I think step one might be the dependency detangling that I've been putting off, and then i can at least scope resolves to particular subsets of the codebase.
thanks 🙂
e
no problem. good luck with the detangling
😭 1