build: let uv track git version changes; copy full checkout in Docker

Add uv cache-keys for the commit and tags so the editable install is
refreshed when the git state changes, and copy the complete checkout
(with .git) into the builder so setuptools-scm sees a clean worktree.
Previously the partial copy made git describe report a dirty tree and
tagged Docker builds got a development version suffix.
This commit is contained in:
2026-10-22 04:05:31 +00:00
parent 5db454f8c8
commit 63c5497a83
3 changed files with 13 additions and 12 deletions
+4 -5
View File
@@ -20,11 +20,10 @@ COPY pyproject.toml uv.lock .python-version ./
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --frozen --no-dev --no-install-project
# Then install the project itself as a regular wheel. The git metadata is
# required by setuptools-scm to derive the package version.
COPY README.md ./
COPY src ./src
COPY .git ./.git
# Then install the project itself. The full checkout (including .git) is
# copied so setuptools-scm sees a clean worktree and derives the version
# from the closest release tag.
COPY . .
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --frozen --no-dev --no-editable