Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions _version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "0.2.11"
2 changes: 0 additions & 2 deletions config/system_config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
client_version: "0.2.11"

error_messages:
template_not_found:
message: |
Expand Down
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -40,6 +40,9 @@ dev = [
[project.scripts]
codeplain = "plain2code:main"

[tool.hatch.version]
path = "_version.py"

[tool.hatch.build.targets.wheel]
include = [
"*.py",
Expand Down
5 changes: 2 additions & 3 deletions system_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import yaml

from _version import __version__
from plain2code_console import console


Expand All @@ -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):
Expand Down