From 66b095ae1ca59ad3a832bc55beef0ac2c5a9d6a2 Mon Sep 17 00:00:00 2001 From: uermel Date: Tue, 6 Oct 2026 00:54:49 -0700 Subject: [PATCH] fix: bump the version of prereleases in src/copick_shared_ui/__init__.py release-please's Python updater matches the version with [0-9]+\.[0-9]+\.[0-9]+(?:-\w+)?, which a dotted prerelease suffix does not fit: from "2.0.0-alpha.1" on it silently leaves the version alone, so a release builds the previous version again (copick 2.0.0-alpha.2 and copick-mcp 2.0.0-alpha.2 were refused by PyPI as duplicates). - Both release-please configs list src/copick_shared_ui/__init__.py as a generic extra file, and its version line carries an x-release-please- version marker; the generic updater handles dotted prereleases and the final 2.0.0. - The version stays 2.0.0-alpha.1, what v2.0 is; the next alpha would otherwise have built alpha.1 again. - The publish job compares the built wheel's version with the release's and fails, naming the file, instead of on PyPI's duplicate check. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/release-please.yml | 13 +++++++++++++ release-please.config.json | 1 + release-please.prerelease.config.json | 1 + src/copick_shared_ui/__init__.py | 2 +- 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 255f30a..e8e6658 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -82,6 +82,19 @@ jobs: uv build uv run --no-project --with packaging python tests/inspect_wheel_metadata.py dist/*.whl + # release-please's own Python updater misses a version with a dotted prerelease suffix (2.0.0-alpha.1), so + # src/copick_shared_ui/__init__.py carries an x-release-please-version marker; refuse to upload if it was still missed. + - name: Check the built version is the release's + env: + RELEASE_VERSION: ${{ needs.release-please.outputs.version }} + run: > + uv run --no-project --with packaging python -c + "import glob, os, sys; from packaging.version import Version; + want = Version(os.environ['RELEASE_VERSION']); + got = Version(os.path.basename(glob.glob('dist/*.whl')[0]).split('-')[1]); + print(f'release {want}, built {got}'); + sys.exit(0 if got == want else f'Built {got}, but the release is {want}: src/copick_shared_ui/__init__.py was not bumped.')" + - name: Publish distribution 📦 to PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: diff --git a/release-please.config.json b/release-please.config.json index 44212b6..dab2dc9 100644 --- a/release-please.config.json +++ b/release-please.config.json @@ -15,6 +15,7 @@ "packages": { ".": { "package-name": "copick-shared-ui", + "extra-files": [{ "type": "generic", "path": "src/copick_shared_ui/__init__.py" }], "tag-prefix": "v", "release-type": "python", "separate-pull-requests": true, diff --git a/release-please.prerelease.config.json b/release-please.prerelease.config.json index 932c7fb..1f3e0be 100644 --- a/release-please.prerelease.config.json +++ b/release-please.prerelease.config.json @@ -15,6 +15,7 @@ "packages": { ".": { "package-name": "copick-shared-ui", + "extra-files": [{ "type": "generic", "path": "src/copick_shared_ui/__init__.py" }], "tag-prefix": "v", "release-type": "python", "versioning": "prerelease", diff --git a/src/copick_shared_ui/__init__.py b/src/copick_shared_ui/__init__.py index dd899e1..35f579e 100644 --- a/src/copick_shared_ui/__init__.py +++ b/src/copick_shared_ui/__init__.py @@ -1,6 +1,6 @@ """Copick shared UI components for cross-platform visualization.""" -__version__ = "2.0.0-alpha.1" +__version__ = "2.0.0-alpha.1" # x-release-please-version # Core components from copick_shared_ui.core import (