From 3547e22a6f45fcc6cbace2f830088d500371b07b Mon Sep 17 00:00:00 2001 From: Danny Willems Date: Sat, 7 Feb 2026 22:29:00 -0300 Subject: [PATCH 1/2] Use importlib.metadata for version, single source of truth Remove hardcoded version string from __init__.py and use importlib.metadata.version() instead. Version is now defined only in pyproject.toml. Closes #22 --- l9format/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/l9format/__init__.py b/l9format/__init__.py index a2a2201..94d127e 100644 --- a/l9format/__init__.py +++ b/l9format/__init__.py @@ -1,4 +1,6 @@ -__version__ = "1.4.0" +from importlib.metadata import version + +__version__ = version("l9format") from l9format.l9format import ( Certificate, From db172c7f92763aad92fb2c4a21645e973d91d976 Mon Sep 17 00:00:00 2001 From: Danny Willems Date: Sat, 7 Feb 2026 22:29:42 -0300 Subject: [PATCH 2/2] CHANGELOG: add entry for version deduplication (#22) --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c41021..6103fb1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,8 @@ and this project adheres to ### Changed +- Use `importlib.metadata.version()` for `__version__`, single source of truth + in `pyproject.toml` ([3547e22], [#22]) - Re-export all public models from `__init__.py` and define `__all__` ([1dcfbef], [#21]) - Tests now import from `l9format` package directly instead of @@ -148,6 +150,7 @@ and this project adheres to +[3547e22]: https://github.com/LeakIX/l9format-python/commit/3547e22 [1ca6e4d]: https://github.com/LeakIX/l9format-python/commit/1ca6e4d [0d8736e]: https://github.com/LeakIX/l9format-python/commit/0d8736e [d30efd2]: https://github.com/LeakIX/l9format-python/commit/d30efd2 @@ -212,6 +215,7 @@ and this project adheres to [#16]: https://github.com/LeakIX/l9format-python/pull/16 [#18]: https://github.com/LeakIX/l9format-python/pull/18 [#21]: https://github.com/LeakIX/l9format-python/issues/21 +[#22]: https://github.com/LeakIX/l9format-python/issues/22 [#27]: https://github.com/LeakIX/l9format-python/issues/27 [#33]: https://github.com/LeakIX/l9format-python/issues/33 [#35]: https://github.com/LeakIX/l9format-python/issues/35