Skip to content

Commit fe51222

Browse files
committed
fix(docker): materialise tracked files before uv sync
The selective COPYs in the runtime stage leave most tracked files (LICENSE, README, .github/, Dockerfile itself, …) missing from /app. hatch-vcs/setuptools_scm interprets those as deleted in the working tree during `uv sync` and stamps the package with a +dYYYYMMDD dirty suffix. Combined with the next-dev guess that also kicks in on dirty trees, the version came out as e.g. 0.9.1.dev0+g<sha>.d20260520 instead of 0.9.0. Run `git checkout -- .` right after `COPY .git` so the index re-materialises the missing files. The working tree is then clean, hatch-vcs reads the tag straight, and the version computed at sync time is baked into the installed package metadata before the css builder later overlays /app/src/struudel/static/css/app.css.
1 parent 7067057 commit fe51222

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

Dockerfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,14 @@ COPY src ./src
5757
COPY alembic ./alembic
5858
COPY .git ./.git
5959

60+
# The selective COPYs above leave most tracked files (LICENSE, README,
61+
# .github/, …) missing from /app. Without this, hatch-vcs sees those as
62+
# "deleted" in the working tree and stamps the build with a +dXXXXXXXX
63+
# dirty suffix. `git checkout -- .` materialises everything from the
64+
# index, so `uv sync` reads a clean tree and produces the correct
65+
# version (e.g. 0.9.0 instead of 0.9.1.dev0+gSHA.dDATE).
66+
RUN cd /app && git checkout -- .
67+
6068
RUN --mount=type=cache,target=/app/.cache/uv \
6169
uv sync --all-groups
6270

0 commit comments

Comments
 (0)