From 5dfb96874ed6f2501855f496db64d0a51918eccd Mon Sep 17 00:00:00 2001 From: claudi Date: Tue, 24 Mar 2026 16:28:02 +0100 Subject: [PATCH] chore: Update version to 0.5.0 in project files and enhance version update script --- elytra_client/__init__.py | 2 +- pyproject.toml | 6 +++--- update_version.py | 12 ++++++++---- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/elytra_client/__init__.py b/elytra_client/__init__.py index f3a750c..8c9c132 100644 --- a/elytra_client/__init__.py +++ b/elytra_client/__init__.py @@ -1,6 +1,6 @@ """Elytra PIM Client - A Pythonic client for the Elytra PIM API""" -__version__ = "0.3.0" +__version__ = "0.5.0" __author__ = "Your Name" from . import rest_api diff --git a/pyproject.toml b/pyproject.toml index d021b2e..9a93664 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "elytra-pim-client" -version = "0.3.0" +version = "0.5.0" description = "A Pythonic client for the Elytra PIM API" readme = "README.md" requires-python = ">=3.9" @@ -44,8 +44,8 @@ Repository = "https://git.him-tools.de/HIM-public/elytra_client.git" Documentation = "https://www.elytra.ch/" Issues = "https://git.him-tools.de/HIM-public/elytra_client/issues" -[tool.setuptools] -packages = ["elytra_client"] +[tool.setuptools.packages.find] +include = ["elytra_client*"] [tool.black] line-length = 100 diff --git a/update_version.py b/update_version.py index 9e05bc4..54a47e4 100644 --- a/update_version.py +++ b/update_version.py @@ -31,20 +31,22 @@ def validate_version(version: str) -> bool: return bool(re.match(pattern, version)) -def update_file(file_path: Path, old_pattern: str, new_version: str) -> bool: +def update_file(file_path: Path, old_pattern: str, new_version: str, multiline: bool = False) -> bool: """Update version in a file. Args: file_path: Path to file to update old_pattern: Regex pattern to find version new_version: New version string + multiline: Whether to use multiline mode for regex Returns: True if successful, False otherwise """ try: content = file_path.read_text() - updated_content = re.sub(old_pattern, new_version, content) + flags = re.MULTILINE if multiline else 0 + updated_content = re.sub(old_pattern, new_version, content, flags=flags) if content == updated_content: print(f"✓ {file_path.name} already up-to-date") @@ -89,11 +91,13 @@ def main() -> int: # Update pyproject.toml if pyproject_path.exists(): - pattern = r'version = "[^"]+"' + # Use word boundary to match 'version' but not 'python_version' + pattern = r'^version = "[^"]+"' success &= update_file( pyproject_path, pattern, - f'version = "{new_version}"' + f'version = "{new_version}"', + multiline=True ) else: print(f"✗ {pyproject_path} not found")