mintel / build-harness

🤖Collection of Makefiles to facilitate building Python/Golang projects, Dockerfiles, and more
Apache License 2.0
2 stars 6 forks source link

Pyproject toml in faas #70

Closed aspage2 closed 3 years ago

aspage2 commented 3 years ago

Context

Some of our work requires that software agents be aware of their own version. ECS-deployed agents have their version built into their dockerfile, but we don't have the same for lambda bundles. This PR adds support to the faas/ module for adding a pyproject.toml file to the lambda bundle which contains a software-managed "version" field.

New Behavior

make faas/python/build will now create dist/pyproject.toml and bundle that file into the final build.zip. If a pyproject.toml exists in the project root, it is copied into dist/, otherwise, a bare pyproject.toml is created. Before zipping, dist/pyproject.toml's "version" field is updated to either $(GIT_TAG) or $(GIT_COMMIT_SHORT), in that order.

This PR and !68 are nearly identical; the only change is adding the build-harness modules to the list of ignored paths when looking for pyfiles to lint.