Skip to content

Commit cc9ec12

Browse files
committed
dynamic versioning
1 parent b4a4d3e commit cc9ec12

File tree

4 files changed

+15
-21
lines changed

4 files changed

+15
-21
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ __pycache__/
1111
/temp
1212
/reports
1313
/src/xml2python.egg-info
14+
/src/xml2python/_version.py
1415

1516
.ruff_cache/
1617
.mypy_cache/

pyproject.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,14 @@ build-backend = "hatchling.build"
5151
[tool.hatch.version]
5252
source = "uv-dynamic-versioning"
5353

54+
[tool.hatch.build.hooks.version]
55+
path = "src/xml2python/_version.py"
56+
template = '''
57+
version = "{version}"
58+
'''
59+
5460
[tool.uv-dynamic-versioning]
61+
vcs = 'git'
5562
fallback-version = "0.0.0"
5663

5764
[tool.pytest.ini_options]

src/xml2python/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,10 @@
44
"""
55

66
from .xml2python import Xml2Python
7+
8+
try:
9+
from ._version import version
10+
11+
__version__ = version
12+
except ImportError:
13+
__version__ = 'dev'

src/xml2python/_version.py

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)