happy-kitchen-89482
05/06/2022, 1:19 AMsetuptools_scm
(https://github.com/pypa/setuptools_scm) which is a utility that uses various heuristics to grab a version number out of git (it looks at latest tag+changes since the most recent tag). It is typically invoked in setup.py. It typically writes the version to a gitignored source file (e.g., _version.py
) in the source tree. Its configuration, including the destination file, lives in pyproject.toml. I'm trying to figure out how best to implement this in Pants. It's sort-of codegen, but note that there is no original source file, equivalent to a .proto, in this case. In fact, we have to run this codegen every time, and cannot cache it, because git state may have changed from under us.happy-kitchen-89482
05/06/2022, 1:19 AMhappy-kitchen-89482
05/06/2022, 1:20 AMhappy-kitchen-89482
05/06/2022, 1:21 AMhappy-kitchen-89482
05/06/2022, 1:22 AMhappy-kitchen-89482
05/06/2022, 1:22 AMhundreds-father-404
05/06/2022, 2:19 AMit's sort-of codegen, but note that there is no original source file,
docker_image(instructions=)
is codegen w.o input file. Same w/ archive
hundreds-father-404
05/06/2022, 2:20 AMIn fact, we have to run this codegen every time, and cannot cache it, because git state may have changed from under us.that's totally fine. mark the codegen request not cacheable
hundreds-father-404
05/06/2022, 2:21 AMto a gitignored source filethat's a good hint for #1
witty-crayon-22786
05/06/2022, 2:22 AMhappy-kitchen-89482
05/06/2022, 3:12 AMdocker_image()
is still something you act on explicitly. What would trigger a rule in this case?witty-crayon-22786
05/06/2022, 4:55 PMsetuptools_scm
happy-kitchen-89482
05/08/2022, 1:20 AM