https://pantsbuild.org/ logo
#development
Title
# development
b

busy-vase-39202

03/14/2023, 9:29 PM
It seems like every couple of weeks someone asks if it's possible to use variables in BUILD files. Would someone please volunteer to identify more places in the docs to emphasize the full capabilities Pants puts at one's disposal, in contrast to systems that use a more limited syntax such as Starlark? It does seem like we haven't driven that point home enough, especially for people used to build systems that offer them less flexibility.
p

proud-dentist-22844

03/15/2023, 2:54 AM
I think the emphasis so far has been for python devs: "Don't think of BUILD files as python. It's a DSL for configuring pants metadata" - the emphasis there is that imports won't work, so a lot of pythonic ways of doing things won't work. But, with StackStorm, I use the fact that BUILD is python as a selling point, because we're a python project, so that makes it feel less daunting to learn.
So, it sounds like we need a balanced message. Something like: You have the power of python, but some pythonic mannerisms won't work like imports. Feel free to use variables. And for variables to be reusable across BUILD files, check out macros (aka prelude).