chore: derive version from git tags via hatch-vcs

Replace hardcoded version in pyproject.toml with hatch-vcs so the
package version is read from git tags at build time. Dockerfile
accepts a VERSION build arg and passes it as HATCH_VCS_PRETEND_VERSION
for builds without a git checkout. Makefile _tag target now rebuilds
the container with the correct version automatically.
This commit is contained in:
2026-04-25 16:53:37 +10:00
parent 4651183ed1
commit cf854a2ace
3 changed files with 31 additions and 10 deletions
+2 -1
View File
@@ -32,7 +32,8 @@ COPY --chown=appuser:appuser pyproject.toml uv.lock README.md ./
# Switch to appuser and install Python dependencies
USER appuser
RUN uv sync --frozen
ARG VERSION=dev
RUN HATCH_VCS_PRETEND_VERSION=${VERSION} uv sync --frozen
# Copy application source
COPY --chown=appuser:appuser src/ ./src/