From b747480706dd4b30715d2d5fede3251cdabc0d78 Mon Sep 17 00:00:00 2001 From: jepson2k <55201008+Jepson2k@users.noreply.github.com> Date: Wed, 13 May 2026 23:05:34 -0400 Subject: [PATCH] Switch to setuptools_scm for dynamic versioning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Version is now read from the latest git tag reachable from HEAD at build time. Tagged commits get a clean version (v0.2.6 -> "0.2.6"); commits past a tag get a dev suffix like "0.2.7.dev3+g1234567". Removes the static `version = "..."` line and the [tool.tbump] config section. Deletes .github/workflows/release.yml — its only job was to sed the version into pyproject after a release was published and push that back to main, which is unnecessary once the tag is the source of truth. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/release.yml | 43 ----------------------------------- pyproject.toml | 22 ++++-------------- 2 files changed, 4 insertions(+), 61 deletions(-) delete mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 46782a8..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: release - -on: - release: - types: [published] - -permissions: - contents: write - -jobs: - bump-version: - name: Bump version to match release tag - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - ref: ${{ github.event.release.target_commitish }} - - - name: Extract version from tag - id: version - run: | - TAG="${{ github.event.release.tag_name }}" - # Strip leading 'v' if present (v0.2.0 -> 0.2.0) - VERSION="${TAG#v}" - echo "version=$VERSION" >> "$GITHUB_OUTPUT" - - - name: Update version in pyproject.toml - run: | - sed -i "s/^version = \".*\"/version = \"${{ steps.version.outputs.version }}\"/" pyproject.toml - - - name: Verify version - run: | - grep "^version = \"${{ steps.version.outputs.version }}\"" pyproject.toml - - - name: Commit and push version bump - run: | - git config user.name "github-actions[bot]" - git config user.email "github-actions[bot]@users.noreply.github.com" - git add pyproject.toml - git diff --cached --quiet && echo "No changes to commit" && exit 0 - git commit -m "bump version to ${{ steps.version.outputs.version }}" - git push diff --git a/pyproject.toml b/pyproject.toml index 91077c9..a0ffeff 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,10 @@ [build-system] -requires = ["setuptools>=61.0"] +requires = ["setuptools>=61.0", "setuptools-scm>=8"] build-backend = "setuptools.build_meta" [project] name = "parol6" -version = "0.2.6" +dynamic = ["version"] description = "Python library for controlling PAROL6 robot arms" requires-python = ">=3.11" @@ -118,19 +118,5 @@ include-package-data = true [tool.setuptools.package-data] parol6 = ["urdf_model/**"] -# Release tooling: `tbump ` edits pyproject.toml, commits, tags -# and pushes (main + tag) in one shot. Install with `pip install tbump`. -[tool.tbump] -github_url = "https://github.com/Jepson2k/PAROL6-python-API" - -[tool.tbump.version] -current = "0.2.5" -regex = '''(?P\d+)\.(?P\d+)\.(?P\d+)''' - -[tool.tbump.git] -message_template = "bump version to {new_version}" -tag_template = "v{new_version}" - -[[tool.tbump.file]] -src = "pyproject.toml" -search = 'version = "{current_version}"' +[tool.setuptools_scm] +# Version comes from the latest git tag reachable from HEAD.