Skip to content

Commit f5b7000

Browse files
authored
fix: use dynamic versioning (#240)
1 parent 88ecbdd commit f5b7000

File tree

6 files changed

+13
-15
lines changed

6 files changed

+13
-15
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
1010
!uv.lock
1111
!pyproject.toml
1212
!README.md
13+
!.git/
1314

1415
**/__pycache__/

.releaserc.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,6 @@ tagFormat: "v${version}"
44
plugins:
55
- "@semantic-release/commit-analyzer"
66
- "@semantic-release/release-notes-generator"
7-
- - "semantic-release-replace-plugin"
8-
- replacements:
9-
- files: [ "pyproject.toml" ]
10-
from: "version = \"0.0.0\""
11-
to: "version = \"${nextRelease.version}\""
12-
countMatches: true
13-
results:
14-
- file: "pyproject.toml"
15-
hasChanged: true
16-
numMatches: 1
17-
numReplacements: 1
187
- - "@semantic-release/exec"
198
- verifyConditionsCmd: echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
209
verifyReleaseCmd: |

Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ RUN --mount=from=ghcr.io/astral-sh/uv:0.8,source=/uv,target=/bin/uv \
2121
--mount=type=cache,target=/root/.cache/uv \
2222
--mount=type=bind,source=uv.lock,target=uv.lock \
2323
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
24+
--mount=type=bind,source=.git/,target=.git/,ro \
2425
uv sync --locked --no-install-project --no-editable
2526

2627
# =========
@@ -39,6 +40,7 @@ RUN --mount=from=ghcr.io/astral-sh/uv:0.8,source=/uv,target=/bin/uv \
3940
--mount=type=cache,target=/root/.cache/uv \
4041
--mount=type=bind,source=uv.lock,target=uv.lock \
4142
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
43+
--mount=type=bind,source=.git/,target=.git/,ro \
4244
uv sync --locked --no-install-project --group=docs
4345
COPY docs ./docs
4446
COPY CONTRIBUTING.md mkdocs.yml ./
@@ -57,6 +59,7 @@ RUN --mount=from=ghcr.io/astral-sh/uv:0.8,source=/uv,target=/bin/uv \
5759
--mount=type=cache,target=/root/.cache/uv \
5860
--mount=type=bind,source=uv.lock,target=uv.lock \
5961
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
62+
--mount=type=bind,source=.git/,target=.git/,ro \
6063
uv sync --locked --no-editable
6164

6265
# =========

pyproject.toml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "gitopscli"
3-
version = "0.0.0"
3+
dynamic = ["version"]
44
description = "GitOps CLI is a command line interface (CLI) to perform operations on GitOps managed infrastructure repositories, including updates in YAML files."
55
authors = [{ name = "Christian Siegel", email = "[email protected]" }]
66
requires-python = ">=3.10, <4"
@@ -40,12 +40,18 @@ docs = [
4040
]
4141

4242
[build-system]
43-
requires = ["hatchling"]
43+
requires = ["hatchling", "uv-dynamic-versioning"]
4444
build-backend = "hatchling.build"
4545

4646
[virtualenvs]
4747
in-project = true
4848

49+
[tool.hatch.version]
50+
source = "uv-dynamic-versioning"
51+
52+
[tool.uv-dynamic-versioning]
53+
fallback-version = "0.0.0"
54+
4955
[tool.ruff]
5056
line-length = 120
5157
target-version = "py311"

tests/commands/test_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ class VersionCommandTest(unittest.TestCase):
2222
def test_output(self):
2323
with captured_output() as stdout:
2424
VersionCommand(VersionCommand.Args()).execute()
25-
assert re.match(r"^GitOps CLI version \d+\.\d+\.\d+\n$", stdout.getvalue())
25+
assert re.match(r"^GitOps CLI version \d+\.\d+\.\d+.*\n$", stdout.getvalue())

uv.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)