fix(build): align pyproject.toml version with __version__.py + skip-existing on TestPyPI#50
Merged
Merged
Conversation
…→ 0.12.0) The `feat(sdk)` commit (79a6e7e, PR #49) bumped `src/nullrun/__version__.py` to 0.12.0 but left `version` in `pyproject.toml` at 0.11.0. Hatchling uses `pyproject.toml`'s version, so `python -m build` was producing a wheel named `nullrun-0.11.0-py3-none-any.whl` — same name as the 0.11.0 artifact that `publish-test` had already uploaded to TestPyPI on its previous successful run (commit 18a91e2). TestPyPI rejects re-uploads of the same wheel hash with HTTP 400 "File already exists" (no overwrite semantics), so the `publish-test` workflow failed at the very last step. Verify locally: $ python -m build --wheel Successfully built nullrun-0.12.0-py3-none-any.whl Also adds `skip-existing: true` to the `pypa/gh-action-pypi-publish` step so a re-run of the same SHA becomes a no-op (matching twine's --skip-existing). Production PyPI cannot overwrite anyway, so this flag is harmless there too.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
What
The
publish-testworkflow at commit 79a6e7e (PR #49) failed withHTTPError: 400 Bad Request — File already exists. Two issues, onefix each:
feat(sdk)bumpedsrc/nullrun/__version__.pyto
0.12.0but leftversioninpyproject.tomlat0.11.0.Hatchling uses
pyproject.toml's version, so the wheel was builtas
nullrun-0.11.0-py3-none-any.whl— the same name as the 0.11.0artifact already on TestPyPI from a previous successful publish
(at 18a91e2).
pypa/gh-action-pypi-publishrejectssame-hash re-uploads with HTTP 400. Adding
skip-existing: truemakes a re-run of the same SHA a no-op (matching twine's
--skip-existing). Production PyPI cannot overwrite anyway.Why
upload cleanly once the version is corrected.
skip-existingis defensive: even if the build ever produces aduplicate of an already-published artifact (e.g. a re-run of an
unchanged SHA), the workflow will not fail.
How
pyproject.tomlversion field:0.11.0→0.12.0with a commentexplaining the prior drift so the next version bump doesn't repeat it.
.github/workflows/publish-test.yml: addskip-existing: trueto thepypa/gh-action-pypi-publish@release/v1step.Test plan
Local verification (
.venv-ci, Python 3.14):python -m build --wheel: wheel is nownullrun-0.12.0-py3-none-any.whl(wasnullrun-0.11.0-…).The Author field is still populated correctly by the metadata hook
from PR #49 — version bump didn't regress it.
Risk
with the runtime
__version__thatfeat(sdk)already shipped.If a 0.12.0 was somehow intended to be a different release than
the one in PR fix(sdk): make Author field non-empty + v3 capability probe #49, this would conflict — but per the commit
message ("Bumped 0.11.0 → 0.12.0"), the intent was always 0.12.0.
skip-existingon TestPyPI: only suppresses the 400 onduplicates. A genuinely new artifact still uploads. Production
PyPI is unaffected (immutable versions there).
Checklist