diff --git a/.dockerignore b/.dockerignore index ca8737e..ea79b1a 100644 --- a/.dockerignore +++ b/.dockerignore @@ -10,5 +10,6 @@ !uv.lock !pyproject.toml !README.md +!.git/ **/__pycache__/ diff --git a/.releaserc.yml b/.releaserc.yml index 8278bb4..ca7a800 100644 --- a/.releaserc.yml +++ b/.releaserc.yml @@ -4,17 +4,6 @@ tagFormat: "v${version}" plugins: - "@semantic-release/commit-analyzer" - "@semantic-release/release-notes-generator" -- - "semantic-release-replace-plugin" - - replacements: - - files: [ "pyproject.toml" ] - from: "version = \"0.0.0\"" - to: "version = \"${nextRelease.version}\"" - countMatches: true - results: - - file: "pyproject.toml" - hasChanged: true - numMatches: 1 - numReplacements: 1 - - "@semantic-release/exec" - verifyConditionsCmd: echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin verifyReleaseCmd: | diff --git a/Dockerfile b/Dockerfile index afcc085..aae6cb8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,6 +21,7 @@ RUN --mount=from=ghcr.io/astral-sh/uv:0.8,source=/uv,target=/bin/uv \ --mount=type=cache,target=/root/.cache/uv \ --mount=type=bind,source=uv.lock,target=uv.lock \ --mount=type=bind,source=pyproject.toml,target=pyproject.toml \ + --mount=type=bind,source=.git/,target=.git/,ro \ uv sync --locked --no-install-project --no-editable # ========= @@ -39,6 +40,7 @@ RUN --mount=from=ghcr.io/astral-sh/uv:0.8,source=/uv,target=/bin/uv \ --mount=type=cache,target=/root/.cache/uv \ --mount=type=bind,source=uv.lock,target=uv.lock \ --mount=type=bind,source=pyproject.toml,target=pyproject.toml \ + --mount=type=bind,source=.git/,target=.git/,ro \ uv sync --locked --no-install-project --group=docs COPY docs ./docs COPY CONTRIBUTING.md mkdocs.yml ./ @@ -57,6 +59,7 @@ RUN --mount=from=ghcr.io/astral-sh/uv:0.8,source=/uv,target=/bin/uv \ --mount=type=cache,target=/root/.cache/uv \ --mount=type=bind,source=uv.lock,target=uv.lock \ --mount=type=bind,source=pyproject.toml,target=pyproject.toml \ + --mount=type=bind,source=.git/,target=.git/,ro \ uv sync --locked --no-editable # ========= diff --git a/pyproject.toml b/pyproject.toml index 5b4bd96..1186e6e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "gitopscli" -version = "0.0.0" +dynamic = ["version"] description = "GitOps CLI is a command line interface (CLI) to perform operations on GitOps managed infrastructure repositories, including updates in YAML files." authors = [{ name = "Christian Siegel", email = "christian.siegel@gmx.net" }] requires-python = ">=3.10, <4" @@ -40,12 +40,18 @@ docs = [ ] [build-system] -requires = ["hatchling"] +requires = ["hatchling", "uv-dynamic-versioning"] build-backend = "hatchling.build" [virtualenvs] in-project = true +[tool.hatch.version] +source = "uv-dynamic-versioning" + +[tool.uv-dynamic-versioning] +fallback-version = "0.0.0" + [tool.ruff] line-length = 120 target-version = "py311" diff --git a/tests/commands/test_version.py b/tests/commands/test_version.py index 297f0bd..75863c6 100644 --- a/tests/commands/test_version.py +++ b/tests/commands/test_version.py @@ -22,4 +22,4 @@ class VersionCommandTest(unittest.TestCase): def test_output(self): with captured_output() as stdout: VersionCommand(VersionCommand.Args()).execute() - assert re.match(r"^GitOps CLI version \d+\.\d+\.\d+\n$", stdout.getvalue()) + assert re.match(r"^GitOps CLI version \d+\.\d+\.\d+.*\n$", stdout.getvalue()) diff --git a/uv.lock b/uv.lock index cc1ec92..812b5f0 100644 --- a/uv.lock +++ b/uv.lock @@ -509,7 +509,6 @@ wheels = [ [[package]] name = "gitopscli" -version = "0.0.0" source = { editable = "." } dependencies = [ { name = "atlassian-python-api" },