Skip to content

Commit 74ca48b

Browse files
committed
feat: enable automatic versioning with hatch-vcs
1 parent 0892022 commit 74ca48b

2 files changed

Lines changed: 16 additions & 4 deletions

File tree

pyproject.toml

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

55
[project]
66
name = "robotframework-mimesislibrary"
7-
version = "1.0.0"
7+
dynamic = ["version"]
88
description = "Robot Framework keyword library wrapper for the Mimesis fake data generator"
99
readme = "README.md"
1010
license = { file = "LICENSE" }
@@ -57,6 +57,9 @@ Repository = "https://github.com/your-org/robotframework-mimesislibrary"
5757
"Bug Tracker" = "https://github.com/your-org/robotframework-mimesislibrary/issues"
5858
Documentation = "https://robotframework-mimesislibrary.sinanerdinc.com/"
5959

60+
[tool.hatch.version]
61+
source = "vcs"
62+
6063
[tool.hatch.build.targets.wheel]
6164
packages = ["src/MimesisLibrary"]
6265

src/MimesisLibrary/version.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,11 @@
1-
# Version information for the MimesisLibrary package.
2-
VERSION = "1.0.0"
1+
"""Dynamic version resolution from package metadata."""
2+
3+
from __future__ import annotations
4+
5+
import importlib.metadata
6+
7+
try:
8+
VERSION = importlib.metadata.version("robotframework-mimesislibrary")
9+
except importlib.metadata.PackageNotFoundError:
10+
# Fallback when running from source checkout without installation
11+
VERSION = "0.0.0.dev0"

0 commit comments

Comments
 (0)