Is there a way to split `pants.toml` sections and ...
# general
h
Is there a way to split
pants.toml
sections and have them in a separate file? Reason is that the addition of new resolves requires editing this file, and currently we've got the admin of the repo as the code owner of
pants.toml
so any change to the resolves requires an admin's approval which is not very necessary We're working with dozens of resolves in our monorepo, BTW
h
The global
pants_config_files
option determines which config files Pants uses, but the catch is that you can’t set it in a config file, for obvious reasons.
You can set it via env var:
PANTS_CONFIG_FILES='["pants.toml", "pants.other.toml"]' pants ...
or flag:
pants --pants-config-files='["pants.toml", "pants.other.toml"]' ...
When specifying multiple files pants takes the union of them, with later values overriding earlier ones
So the question is whether you can set that env var for all your users
or run pants via a script that adds that flag
h
Oh, got it! Thank you 🙂
a
Quick thought, is it at all possible to enable different subsystems in different parts of a repo, maybe using a
pants.toml
file in a subdirectory?
h
@acoustic-librarian-29560 Not today, but exactly that is going to be a major feature of the new Python backend, and eventually all of Pants I hope.
😃 1
a
Does it have to be implemented in the backends specifically? My gut feeling as a plugin author is that this would ideally be a backend agnostic feature. Could you have a concept of subprojects where the backends only know about targets and union rules from the project they're running in or a subproject?
h
The backends would have to be aware of it, they are not currently written that way
It might be possible to do it at a higher level without the backends being aware of it, I would need to see about that
But right now there is a strong assumption that config is global