cal-itp/eligibility-server

Add support for app getting its version dynamically

angela-tran opened this issue · 1 comments

May be able to use https://setuptools-git-versioning.readthedocs.io/en/stable/install.html#pyproject-toml

It'd be simplest if this can be done in a way that still works with the old deployment model in case we need to do a release while we're in the middle of working on the new deployment model (e.g. a hotfix).

However, if this isn't compatible with our old deployment model, then we'll need to think more about when to merge this in.

We have a model of this working in the littlepay repo that we may be able to follow:

  1. Configure setuptools_scm in the build-system and tool sections of pyproject.toml
  2. Configure the version to be dynamic in pyproject.toml
  3. Make the package __init__.py read the version from the environment
  4. For the devcontainer, copy the .git directory during build time so version metadata is available We need the .git directory to be available in the regular appcontainer build as well.

See the following commit with all of the above changes: cal-itp/littlepay@4cf866b