Test PR: pin PSR tag_format and document release remediation - #287
Draft
farhan wants to merge 2 commits into
Draft
Test PR: pin PSR tag_format and document release remediation#287farhan wants to merge 2 commits into
farhan wants to merge 2 commits into
Conversation
PSR determines the last released version by reading git tags only (never
PyPI), matching them against tag_format. The default is v{version}, but this
repo's historical release tags are bare (0.1.0 ... 0.4.3), so a default-config
PSR ignores that entire history, restarts from 0.0.0, and either refuses to
release or invents versions (v0.4.4/v0.4.5) that were never published.
Pin the format explicitly so the convention is unambiguous. Making releases
actually work also requires a matching baseline tag (v0.4.3) and cleanup of the
stray tags; see the PR description for the full remediation checklist.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The 'Upload to GitHub Release Assets' step (publish-action) fails with HTTP 422 on the asset upload, which fails the whole release job. Because publish_to_pypi has 'needs: release', that job failure cascades and skips the PyPI publish — so a cosmetic asset attach blocks the actual release. Attaching dists to the GitHub Release is optional; PyPI is published from the uploaded artifact via OIDC. Mark the step continue-on-error so a 422 there no longer fails the job: the artifact upload still runs and publish_to_pypi proceeds. The underlying 422 is tracked separately (needs the response body, which the CI logs strip) for a proper root-cause fix. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
farhan
marked this pull request as draft
August 17, 2026 12:10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Automated releases are not reaching PyPI — the package is stuck at
0.4.3, while the repo has stray tags/GitHub Releases forv0.4.4andv0.4.5that were never published. Two independent root causes:1. Tag-format mismatch (versioning).
python-semantic-release(PSR) determines the last released version by reading git tags only — never PyPI. It invertstag_formatinto a regex (defaultv{version}→^v(?P<version>.+)$) and silently discards every tag that does not match. This repo's entire real history uses bare tags (0.1.0…0.4.3), so a default-config PSR ignores all of it, restarts from0.0.0, and either refuses to release (No release will be made, 0.1.0 has already been released) or invents versions that never existed on PyPI.2. HTTP 422 on GitHub Release asset upload (artifacts). In the
releasejob, theUpload to GitHub Release Assetsstep (publish-action→upload_dists) fails with422 Unprocessable Entityfor both the.whland.tar.gz. That kills the job beforeactions/upload-artifact, so the distribution never reaches artifact storage andpublish_to_pypiis skipped (the-in the run summary — skipped, not failed).What this PR changes
tag_format = "v{version}"in[tool.semantic_release]with a comment documenting that a matching baseline tag must exist. Makes the convention explicit so nobody assumes bare tags work, and pairs with the operational fix below.continue-on-error: trueon theUpload to GitHub Release Assetsstep). That step 422s and, becausepublish_to_pypihasneeds: release, its failure cascades and skips PyPI. Attaching dists to the GitHub Release is cosmetic — PyPI publishes from the uploaded artifact via OIDC — so this unblocks the PyPI path regardless of the 422's root cause.This PR still does not fully close the loop on its own — the versioning fix is mostly operational (tags), and the 422 itself is only neutralized, not root-caused. The full checklist is below.
Remaining steps
Versioning (do first)
0.4.3(3be8beb):0.4.5 → 0.4.6, skipping numbers):v0.4.3as the latest release (afix:commit should compute0.4.4).Artifacts — the 422 (the actual PyPI blocker)
continue-on-error: trueon the asset-upload step so the 422 can no longer fail the job or skippublish_to_pypi. Confirmed from PSR source that this is safe:versionattaches only the configassetslist (empty here), so this step is the only thing uploading dists and is off the PyPI critical path.gh release upload/curl -vwithGITHUB_TOKENprints the full JSON), then either switch the step to idempotentgh release upload "$TAG" dist/* --clobberor bump the pinned PSR/publish-action version. Tracks whether GitHub-Release assets get attached at all — not a PyPI blocker anymore.Verify end-to-end
fix:commit onmaster→ confirm PSR computes0.4.4, the asset upload succeeds,publish_to_pypiruns (not skipped), and0.4.4appears on PyPI.Verification tooling
The
modernize-python-reposskill now has two versioning guards that catch this class of failure:tag_format(else emitsSUGGEST-TAG).tag_format-matching tag must exist for the version currently on PyPI. Run against this repo today it fails withSUGGEST-TAG: v0.4.3.🤖 Generated with Claude Code