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:
+4
-5
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user