Repository navigation
fix(release): publish every package version missing from PyPI - #35
Open
Kevin-Liu-01 wants to merge 1 commit into
Open
Kevin-Liu-01 wants to merge 1 commit into
Kevin-Liu-01 wants to merge 1 commit into
Conversation
Every release-PR merge from 2026-03-09 to 03-19 failed in the publish job's tag step, which stopped the run before the build and publish steps. The 0.1.1 to 0.3.0 tags exist, but PyPI still serves gt-i18n 0.1.0 and generaltranslation 0.0.4. On a version-bump run on main, or a manual run, the publish job now builds every package version that PyPI does not have, even when tagging or the release notes failed. It asks PyPI first: a 404 builds the version, a 200 skips it, and any other status fails the run. It refuses to build a version whose package code changed since that version's tag. It publishes only when every build succeeded, and only from main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 12, 2026
| version=$(grep '^version = ' "$pkg/pyproject.toml" | head -1 | sed 's/.*"\(.*\)".*/\1/') | ||
| status=$(curl -sS -o /dev/null -w '%{http_code}' --retry 3 --retry-all-errors "https://pypi.org/pypi/$name/$version/json" || true) | ||
| case "$status" in | ||
| 200) echo "$name $version is already on PyPI"; continue ;; |
There was a problem hiding this comment.
Retries leave release files missing
If an upload stops after only one file reaches PyPI, the 200 branch skips that version on every later run. uv build creates a wheel and a source archive, so a manual retry can leave either file missing. Check the files returned by PyPI, then build incomplete releases and skip files that were already uploaded.
Prompt To Fix With AI
This is a comment left during a code review.
Path: .github/workflows/release.yml
Line: 112
Comment:
**Retries leave release files missing**
If an upload stops after only one file reaches PyPI, the `200` branch skips that version on every later run. `uv build` creates a wheel and a source archive, so a manual retry can leave either file missing. Check the files returned by PyPI, then build incomplete releases and skip files that were already uploaded.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
7 tasks done
This branch has not been deployed
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.
Summary
PyPI still serves gt-i18n, gt-flask and gt-fastapi 0.1.0, generaltranslation 0.0.4, and generaltranslation-intl-messageformat and generaltranslation-supported-locales 0.0.4. Every release-PR merge from 2026-03-09 to 2026-03-19 failed in the publish job's tag step, and that failure stopped the run before the build and publish steps. The tags for 0.1.1 to 0.3.0 exist on GitHub, but no GitHub release or PyPI upload was made from them.
This PR changes
.github/workflows/release.yml:workflow_dispatch). The sampo release job runs only on a push, and the publish job runs only from main.!cancelled()).README.mdandCHANGELOG.md, and the whole run stops with an error that names the package.fetch-depth: 0, so the tags and the diff against them are available.Size: 1 file, +40/-8.
Decisions
pyproject.tomlversion changed in the pushed commit, or on a manual run.Test plan
Run on this branch (
k/publish-missing-versionsat 6eaeb03, on origin/main c3fe22b, still the latest main on 2026-10-11):pushandworkflow_dispatch, and the job and step conditions are the ones listed above.uv buildreplaced by an echo and real PyPI lookups: it would build generaltranslation-intl-messageformat 0.0.5, generaltranslation-supported-locales 0.0.6, generaltranslation 0.1.0, gt-fastapi 0.3.0, gt-flask 0.3.0 and gt-i18n 0.3.0. It skipped generaltranslation-icu-messageformat-parser 0.0.3, which is already on PyPI.k/gt-i18n-cache-expiry), which changes gt-i18n without a version bump, stopped with "gt-i18n changed since gt-i18n@0.3.0; bump its version before publishing" and exit code 1.uv sync --all-packages --locked,ruff check .,ruff format --check .,mypy .(163 files) andpytest(1,399 passed): clean. This PR does not change Python code.Not run: the workflow on GitHub Actions itself, and actionlint, which is not installed on this machine.
Merge order
pip install gt-flask==0.3.1would then fail because generaltranslation 0.1.0 is not on PyPI.k/gt-i18n-cache-expiry)), then fix(gt-flask,gt-fastapi): load translations for every configured locale (fix(gt-flask,gt-fastapi): load translations for every configured locale #37 (k/flask-fastapi-configured-locales)).k/python-quickstart-loads-translations)), after 0.3.1 is on PyPI.Ernest McCarter wrote most of gt-python. He, or whoever holds the PyPI token, should review this PR and merge the release PR.
🤖 Generated with Claude Code
The PR appears safe to merge, with a non-blocking improvement needed to recover incomplete uploads.
Fix with agent prompt
Summary
Updates
.github/workflows/release.ymlto recover current package versions missing from PyPI.Kevin-Liu-01 explicitly limits recovery to current versions, permits publishing after tagging fails, and requires changed package code to receive a version bump before any upload.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Push to main or manual run] --> B{Version changed or manual run?} B -->|No| C[Skip build and upload] B -->|Yes| D[Check each current version on PyPI] D -->|200| E[Skip version] D -->|404| F{Package differs from its existing tag?} D -->|Other status| G[Stop without uploading] F -->|Yes| G F -->|No| H[Build package] E --> I{All packages checked and builds succeeded?} H --> I I -->|Yes| J[Upload built files, if any] I -->|No| GReviews (1) · Last reviewed commit: "fix(release): publish every package vers..." · Reviewed by Greptile