diff --git a/.dockerignore b/.dockerignore index fe9f4ce..44d2407 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,4 +1,3 @@ -.gitignore .venv/ __pycache__/ *.py[cod] @@ -7,15 +6,11 @@ __pycache__/ .mypy_cache/ .env .env.* -docker-compose*.yml -Dockerfile -.dockerignore -*.md -!README.md xmcp.yml -xmcp.example.yml +xmcp.local.yml # Generated at build time src/xmcp/_version.py *.egg-info/ +build/ dist/ diff --git a/Dockerfile b/Dockerfile index dc0a1d4..b8332aa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/pyproject.toml b/pyproject.toml index f236d8a..808ffe6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,3 +25,10 @@ version_file = "src/xmcp/_version.py" [tool.setuptools_scm.tag] prefix = "release/" + +[tool.uv] +# setuptools-scm derives the version from git; make uv notice commit/tag changes. +cache-keys = [ + { file = "pyproject.toml" }, + { git = { commit = true, tags = true } }, +]