diff --git a/chart/Chart.yaml b/chart/Chart.yaml index aac4166..12e28ef 100644 --- a/chart/Chart.yaml +++ b/chart/Chart.yaml @@ -3,7 +3,7 @@ name: kz-scoring-api description: | Synchronous REST facade for Beeline-initiator PKB lookups via vaultee-pipelines. type: application -version: 0.1.2 -appVersion: "0.1.2" +version: 0.1.3 +appVersion: "0.1.3" maintainers: - name: Aggregion diff --git a/pyproject.toml b/pyproject.toml index 415ee02..84e4620 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "kz-scoring-api" -version = "0.1.2" +version = "0.1.3" description = "Synchronous REST facade for Beeline-initiator PKB lookups via vaultee-pipelines." requires-python = ">=3.11" dependencies = [ diff --git a/src/kz_scoring_api/__init__.py b/src/kz_scoring_api/__init__.py index 485f44a..5c88f22 100644 --- a/src/kz_scoring_api/__init__.py +++ b/src/kz_scoring_api/__init__.py @@ -1 +1,6 @@ -__version__ = "0.1.1" +from importlib.metadata import PackageNotFoundError, version + +try: + __version__ = version("kz-scoring-api") +except PackageNotFoundError: + __version__ = "0.0.0+unknown" diff --git a/tests/test_endpoints.py b/tests/test_endpoints.py index 45a4ed8..8cd4b8c 100644 --- a/tests/test_endpoints.py +++ b/tests/test_endpoints.py @@ -1,3 +1,6 @@ +import tomllib +from pathlib import Path + from kz_scoring_api.hashing import compute_row_id_full, compute_row_id_iin from kz_scoring_api.pipeline_client import ( PipelineTimeoutError, @@ -11,6 +14,15 @@ def test_healthz(test_client): assert r.json()["status"] == "ok" +def test_healthz_version_matches_pyproject(test_client): + pyproject = tomllib.loads( + (Path(__file__).resolve().parent.parent / "pyproject.toml").read_text() + ) + r = test_client.get("/healthz") + assert r.status_code == 200 + assert r.json()["version"] == pyproject["project"]["version"] + + def test_single_iin_only_200(test_client, settings, fake_pipelines, fake_secrets): row_id = compute_row_id_iin( fake_secrets.value, "801217301434", settings.iin_salt