Skip to content

Keep the release script from uploading the last release - #505

Merged
chrismattmann merged 1 commit into
masterfrom
make-the-release-script-safe
Nov 9, 2026
Merged

chrismattmann merged 1 commit into
masterfrom
make-the-release-script-safe

Conversation

@chrismattmann

Copy link
Copy Markdown
Owner

Two hazards found while preparing a release. Both of them bite at the moment a release is published, which is the worst time to find out.

dist/ holds the last release

dist/ is gitignored, so it keeps whatever was built last time. On my checkout that is tika-3.3.2-py3-none-any.whl and tika-3.3.2.tar.gz, from August. The script was:

python3 -m build
twine upload --verbose dist/*

So the upload would have included 3.3.2 alongside the new version. PyPI refuses a version it already has, twine stops at the first failure, and the release ends up half done — possibly with the new wheel never uploaded at all, depending on the order twine walked the glob. The script now clears dist/ and build/ first.

It also runs twine check before uploading. Invalid long-description metadata is rejected at upload time, which on PyPI means after the sdist is live and the version number is burned.

The script was untracked

Which is part of why this went unnoticed: a release process that exists on one machine can't be read or fixed by anyone else. It's tracked now, with the reasoning in comments.

pypi-token

Added to .gitignore. It was untracked, but nothing stopped git add -A from committing it, and it sits in the repository root next to everything else.

Verified

built: tika-3.3.3.dev0-py3-none-any.whl
built: tika-3.3.3.dev0.tar.gz
Checking dist/tika-3.3.3.dev0-py3-none-any.whl: PASSED
Checking dist/tika-3.3.3.dev0.tar.gz: PASSED

Separately: the Documentation badge

It was showing failing and has gone green on its own. Nothing was broken — #502 and #503 merged 42 seconds apart, the pages concurrency group superseded the first Documentation run, and GitHub renders a cancelled run as a failing badge. The next run (on #503's merge) built and deployed successfully, and the badge now reads Documentation - passing. No change needed; worth knowing the cause, since back-to-back merges to master will do it again.

Two hazards found while preparing a release, both of which bite at the moment
a release is published.

dist/ is gitignored, so it holds whatever was built last time -- on this
machine, tika-3.3.2-py3-none-any.whl and tika-3.3.2.tar.gz from August. The
script was:

    python3 -m build
    twine upload --verbose dist/*

so the upload would have included 3.3.2 alongside the new version. PyPI
refuses to accept a version it already has, twine stops at the first failure,
and the release ends up half done -- possibly with the new wheel never
uploaded, depending on the order twine walked the glob. The script now clears
dist/ and build/ first.

It also runs `twine check` before uploading. Invalid long-description metadata
is rejected at upload time, which on PyPI means after the sdist is already
published and the version number is burned.

The script was untracked, which is part of why this went unnoticed: a release
process that exists on one machine cannot be read or fixed by anybody else. It
is tracked now.

pypi-token is added to .gitignore. It was untracked but nothing was stopping
`git add -A` from committing it, and the file sits in the repository root
next to everything else.
@chrismattmann
chrismattmann force-pushed the make-the-release-script-safe branch from b536d4f to e6f78c9 Compare November 9, 2026 21:45
@coveralls

coveralls commented Nov 9, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 70.13%. remained the same — make-the-release-script-safe into master

@chrismattmann chrismattmann self-assigned this Nov 9, 2026
@chrismattmann chrismattmann added this to the tika-next milestone Nov 9, 2026
@chrismattmann
chrismattmann merged commit 9435933 into master Nov 9, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants