diff options
-rw-r--r-- | pyproject.toml | 1 | ||||
-rw-r--r-- | python/knot_resolver/__init__.py | 3 | ||||
-rw-r--r-- | tests/manager/test_knot_resolver_manager.py | 9 |
3 files changed, 11 insertions, 2 deletions
diff --git a/pyproject.toml b/pyproject.toml index fefe24ac..a5f301cc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,6 +47,7 @@ debugpy = "^1.8.1" pytest = "^8.0.1" pytest-cov = "^4.1.0" pytest-asyncio = "^0.23.5" +toml = "^0.10.2" [tool.poetry.group.lint.dependencies] black = "^24.2.0" diff --git a/python/knot_resolver/__init__.py b/python/knot_resolver/__init__.py index 33ce9e87..8407cd6d 100644 --- a/python/knot_resolver/__init__.py +++ b/python/knot_resolver/__init__.py @@ -1,5 +1,6 @@ from .datamodel import KresConfig +from .constants import VERSION -__version__ = "0.1.0" +__version__ = VERSION __all__ = ["KresConfig"] diff --git a/tests/manager/test_knot_resolver_manager.py b/tests/manager/test_knot_resolver_manager.py index c1d9b933..108b3b55 100644 --- a/tests/manager/test_knot_resolver_manager.py +++ b/tests/manager/test_knot_resolver_manager.py @@ -1,5 +1,12 @@ +import toml + from knot_resolver import __version__ def test_version(): - assert __version__ == "0.1.0" + + with open("pyproject.toml", "r") as f: + pyproject = toml.load(f) + + version = pyproject["tool"]["poetry"]["version"] + assert __version__ == version |