Skip to content

Commit ca8564f

Browse files
hf-kkleinKonstantin
andauthored
fix(ci): don't hardcode version to 0.1.0 but read from git tag (#16)
Co-authored-by: Konstantin <[email protected]>
1 parent d3ef696 commit ca8564f

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,3 +135,5 @@ dmypy.json
135135

136136
# vscode settings
137137
.vscode/
138+
139+
src/_ahlbatross_version.py

pyproject.toml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
[project]
22
name = "ahlbatross"
33
description = ""
4-
version = "0.1.0"
54
license = { text = "MIT" }
65
requires-python = ">=3.11"
76
authors = [{ name = "Hochfrequenz Unternehmensberatung GmbH", email = "[email protected]" }]
@@ -24,6 +23,7 @@ dependencies = [
2423
"pandas-stubs>=2.2.3.241009",
2524
"xlsxwriter>=3.2.0"
2625
]
26+
dynamic = ["version"]
2727

2828
[project.scripts]
2929
ahlbatross = "ahlbatross.main:main"
@@ -76,10 +76,20 @@ truethy-bool = true
7676
[tool.mypy]
7777
disable_error_code = []
7878

79+
7980
[build-system]
80-
requires = ["hatchling>=1.8.0"]
81+
requires = ["hatchling>=1.8.0", "hatch-vcs"]
8182
build-backend = "hatchling.build"
8283

84+
[tool.hatch.version]
85+
source = "vcs"
86+
87+
[tool.hatch.build.hooks.vcs]
88+
version-file = "src/_ahlbatross_version.py"
89+
template = '''
90+
version = "{version}"
91+
'''
92+
8393
[tool.hatch.build.targets.sdist]
8494
exclude = ["/unittests"]
8595

0 commit comments

Comments
 (0)