Skip to content

Commit cb2fe66

Browse files
committed
ci: Adds hatch-vcs.
1 parent 1d161a3 commit cb2fe66

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[build-system]
2-
requires = ["hatchling"]
2+
requires = ["hatchling", "hatch-vcs"]
33
build-backend = "hatchling.build"
44

55
[project]
@@ -40,7 +40,7 @@ Funding = "https://github.com/sponsors/pcisar"
4040
Source = "https://github.com/FirebirdSQL/python3-driver"
4141

4242
[tool.hatch.version]
43-
path = "src/firebird/driver/__init__.py"
43+
source = "vcs"
4444

4545
[tool.hatch.build.targets.sdist]
4646
include = ["src"]

src/firebird/driver/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,4 +133,8 @@
133133
)
134134

135135
#: Current driver version, SEMVER string.
136-
__VERSION__ = '2.0.2'
136+
try:
137+
from importlib.metadata import version as _get_version
138+
__VERSION__ = _get_version('firebird-driver')
139+
except Exception:
140+
__VERSION__ = 'unknown'

0 commit comments

Comments
 (0)