diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 5c484c7..31dd9f4 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -57,10 +57,6 @@ jobs: with: skip-uv-sync: "true" - - name: Update version in __init__.py - if: ${{ steps.release.outputs.release_created }} - run: nix develop --command just update-version - - name: Build and publish package if: ${{ steps.release.outputs.release_created }} env: diff --git a/justfile b/justfile index f0e40c5..2ebc360 100644 --- a/justfile +++ b/justfile @@ -34,10 +34,6 @@ ty: gitleaks: gitleaks detect --source . --config .gitleaks.toml -# Update version in __init__.py -update-version: - uv run scripts/update_version.py - # Build package build: uv build diff --git a/scripts/update_version.py b/scripts/update_version.py deleted file mode 100755 index 6c2e39f..0000000 --- a/scripts/update_version.py +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env python -# /// script -# requires-python = ">=3.11" -# dependencies = [ -# "tomli", -# ] -# /// -""" -Script to ensure version consistency between pyproject.toml and __init__.py. -Run this script after release-please updates the version in pyproject.toml. -""" - -import re -import subprocess -from pathlib import Path - -import tomli - - -def main() -> None: - """Update version in __init__.py to match pyproject.toml and refresh uv.lock.""" - # Read version from pyproject.toml - pyproject_path = Path("pyproject.toml") - init_path = Path("stackone_ai/__init__.py") - - with open(pyproject_path, "rb") as f: - pyproject = tomli.load(f) - version = pyproject["project"]["version"] - - # Update version in __init__.py - init_content = init_path.read_text() - new_init_content = re.sub(r'__version__ = "[^"]+"', f'__version__ = "{version}"', init_content) - - if init_content != new_init_content: - init_path.write_text(new_init_content) - print(f"Updated version in {init_path} to {version}") - else: - print(f"Version in {init_path} already matches {version}") - - # Update uv.lock to reflect version change in pyproject.toml - print("Updating uv.lock...") - subprocess.run(["uv", "lock"], check=True) - print("uv.lock updated successfully") - - -if __name__ == "__main__": - main()