From 9d3d3bfb3667dd561c73db1ff4f2950747265ea0 Mon Sep 17 00:00:00 2001 From: Gonzalo Rafuls Date: Tue, 3 Feb 2026 22:00:41 +0100 Subject: [PATCH] fix: unified versioning for semantic-release --- setup.py | 15 ++++++++++++++- src/badfish/__init__.py | 2 +- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index c878b56..446deea 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,18 @@ import setuptools +import re +import os + +here = os.path.abspath(os.path.dirname(__file__)) +version_file = os.path.join(here, "src", "badfish", "__init__.py") + +with open(version_file, "r", encoding="utf-8") as f: + content = f.read() + match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", content, re.M) + if match: + current_version = match.group(1) + else: + raise RuntimeError("Unable to find version string in src/badfish/__init__.py") setuptools.setup( - version="1.0.7" + version=current_version ) diff --git a/src/badfish/__init__.py b/src/badfish/__init__.py index a82b376..9e604c0 100644 --- a/src/badfish/__init__.py +++ b/src/badfish/__init__.py @@ -1 +1 @@ -__version__ = "1.1.1" +__version__ = "1.0.7"