From 57081c2ed79f8e90f4f87c50bec45d3b4d2e13be Mon Sep 17 00:00:00 2001 From: Predrag Radenkovic Date: Tue, 17 Feb 2026 12:16:42 +0100 Subject: [PATCH 1/2] Setup client version as a single source of trouth --- _version.py | 1 + config/system_config.yaml | 2 -- pyproject.toml | 5 ++++- system_config.py | 5 ++--- 4 files changed, 7 insertions(+), 6 deletions(-) create mode 100644 _version.py diff --git a/_version.py b/_version.py new file mode 100644 index 0000000..6232f7a --- /dev/null +++ b/_version.py @@ -0,0 +1 @@ +__version__ = "0.2.10" diff --git a/config/system_config.yaml b/config/system_config.yaml index fd9057e..1bc49c2 100644 --- a/config/system_config.yaml +++ b/config/system_config.yaml @@ -1,5 +1,3 @@ -client_version: "0.2.11" - error_messages: template_not_found: message: | diff --git a/pyproject.toml b/pyproject.toml index a79fea8..9efc47c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "codeplain" -version = "0.2.11" +dynamic = ["version"] description = "Transform plain language specifications into working code" readme = "README.md" requires-python = "==3.11" @@ -40,6 +40,9 @@ dev = [ [project.scripts] codeplain = "plain2code:main" +[tool.hatch.version] +path = "_version.py" + [tool.hatch.build.targets.wheel] include = [ "*.py", diff --git a/system_config.py b/system_config.py index 46c14cc..dcc3721 100644 --- a/system_config.py +++ b/system_config.py @@ -3,6 +3,7 @@ import yaml +from _version import __version__ from plain2code_console import console @@ -11,12 +12,10 @@ class SystemConfig: def __init__(self): self.config = self._load_config() - if "client_version" not in self.config: - raise KeyError("Missing 'client_version' in system_config.yaml") if "error_messages" not in self.config: raise KeyError("Missing 'error_messages' section in system_config.yaml") - self.client_version = self.config["client_version"] + self.client_version = __version__ self.error_messages = self.config["error_messages"] def _load_config(self): From ef65325a95d8fffa45bc8495f0fe148902f0b5b2 Mon Sep 17 00:00:00 2001 From: Predrag Radenkovic Date: Wed, 25 Feb 2026 15:40:30 +0100 Subject: [PATCH 2/2] Update version to 0.2.11 --- _version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_version.py b/_version.py index 6232f7a..5635676 100644 --- a/_version.py +++ b/_version.py @@ -1 +1 @@ -__version__ = "0.2.10" +__version__ = "0.2.11"