summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleš Mrázek <ales.mrazek@nic.cz>2024-08-28 11:13:41 +0200
committerAleš Mrázek <ales.mrazek@nic.cz>2024-09-07 00:28:31 +0200
commit7b24fde85067502c62ea3709b50b1297691652c8 (patch)
treed02619758a11a4f0ed47b7ebdecf51a245bd837b
parentpython/knot_resolver: version arguments for manager and client (diff)
downloadknot-resolver-7b24fde85067502c62ea3709b50b1297691652c8.tar.xz
knot-resolver-7b24fde85067502c62ea3709b50b1297691652c8.zip
python/knot_resolver: set __version__
-rw-r--r--pyproject.toml1
-rw-r--r--python/knot_resolver/__init__.py3
-rw-r--r--tests/manager/test_knot_resolver_manager.py9
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