From a12249e36d87c8f9cbfba97ac5426e85bf4d5b41 Mon Sep 17 00:00:00 2001 From: test Date: Mon, 31 Aug 2026 20:15:53 +0500 Subject: [PATCH] fix: run PSR via uv again now that 10.6.2 fixes the GitPython break #438 reverted all the way back to the official Docker-based action once upstream fixed python-semantic-release/python-semantic-release#1476, but that wasn't necessary -- it also undid the uv-based invocation and build_command from #435/#436 for no reason tied to the actual bug. The gitpython pin was only ever needed to work around the bug; with PSR 10.6.2 (which no longer references the removed GitPython attribute) that constraint isn't needed at all, uvx resolves and runs it cleanly. Verified both halves locally: `uvx --from "python-semantic-release==10.6.2" ...` runs without error, and `SETUPTOOLS_SCM_PRETEND_VERSION=... uv build` produces correct dist/ artifacts. Keeping the uv-based invocation avoids reintroducing pip anywhere in this workflow (the official action's Docker image only has pip, not uv), consistent with this org's uv-native CI standard. --- .github/workflows/release.yml | 21 +++++++++++---------- pyproject.toml | 2 +- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 039aba2..06ac239 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,18 +29,19 @@ jobs: - run: git reset --hard ${{ github.sha }} + - name: Install uv + uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 + - name: Python Semantic Release id: release - uses: python-semantic-release/python-semantic-release@v10.6.2 - with: - github_token: ${{ secrets.OPENEDX_SEMANTIC_RELEASE_GITHUB_TOKEN }} - git_committer_name: "github-actions" - git_committer_email: "github-actions@github.com" - changelog: "false" - # Commit, tag, push and build, but don't create the GitHub release. - # We create it ourselves in the next step so that the distributions - # are attached before the release is published. See that step for why. - vcs_release: "false" + env: + GH_TOKEN: ${{ secrets.OPENEDX_SEMANTIC_RELEASE_GITHUB_TOKEN }} + GIT_COMMIT_AUTHOR: "github-actions " + run: | + git config --global user.name "github-actions" + git config --global user.email "github-actions@github.com" + uvx --from "python-semantic-release==10.6.2" \ + semantic-release -v version --no-changelog --no-vcs-release # This repo has immutable releases enabled, which freezes a release's # assets the moment it is published, so assets cannot be attached diff --git a/pyproject.toml b/pyproject.toml index a45187b..e979892 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -93,7 +93,7 @@ local_scheme = "no-local-version" fallback_version = "0.0.0" [tool.semantic_release] -build_command = "python -m pip install --upgrade build && SETUPTOOLS_SCM_PRETEND_VERSION=$NEW_VERSION python -m build" +build_command = "SETUPTOOLS_SCM_PRETEND_VERSION=$NEW_VERSION uv build" major_on_zero = false allow_zero_version = true tag_format = "v{version}"