Skip to content

Release tooling: twine 7 and build from the pixi-locked env - #10

Merged
krokicki merged 2 commits into
mainfrom
release-tooling-twine7
Oct 16, 2026
Merged

krokicki merged 2 commits into
mainfrom
release-tooling-twine7

Conversation

@krokicki

@krokicki krokicki commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Problem

Releasing 0.8.1 failed with:

InvalidDistribution: Invalid distribution metadata: '2.5' is not a valid metadata version

Two causes:

  1. python -m build runs in an isolated env and pulled the newest hatchling (1.32.4) from PyPI, which now emits Metadata-Version: 2.5. The build backend version was effectively unpinned.
  2. twine 6.2.0 hard-codes an accepted metadata-version list ending at 2.4 (twine/package.py), overriding packaging's own support for 2.5, so it rejected a valid wheel.

Changes

  • twine 7 from PyPI in the release env ([dependency-groups] release). The conda-forge twine 7.0.0 build crashed on import in this env, so the PyPI build is used.
  • hatchling in the release feature, locked at 1.32.4 in pixi.lock, and pypi-build now runs rm -rf dist && python -m build --no-isolation. The backend comes from the locked env, so future hatchling upgrades are a deliberate pixi update with a lockfile diff instead of a surprise on release day. The rm -rf dist keeps stale artifacts from an earlier version out of twine upload dist/*.
  • build-system.requires gets a lower bound (hatchling>=1.27) for anyone building from the sdist.

Verification

  • pixi run -e release pypi-build rebuilds from the locked env. The wheel's Generator reads hatchling 1.32.4, matching pixi.lock.
  • twine check dist/* passes on both artifacts.
  • The rebuilt wheel is byte-identical (sha256) to the 0.8.1 wheel on PyPI. The sdist differs only in pyproject.toml and pixi.lock, which reflect this PR; PKG-INFO and cluster_api/ are identical.

🤖 Generated with Claude Code

@StephanPreibisch

krokicki and others added 2 commits October 16, 2026 08:01
…load

Recent hatchling emits Metadata-Version 2.5; twine 6.2 hard-codes an
accepted list ending at 2.4 and rejects the wheel. Pull twine 7 from
PyPI (the conda-forge build crashed on import in this env).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
python -m build was pulling whichever hatchling PyPI had that day into
an isolated env, so the build backend (and the metadata it emits) was
unpinned. Add hatchling to the release feature and build with
--no-isolation so pixi.lock governs the backend version. Give
build-system.requires a lower bound for anyone building from the sdist.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@krokicki
krokicki merged commit d9be153 into main Oct 16, 2026
1 check passed
@krokicki
krokicki deleted the release-tooling-twine7 branch October 16, 2026 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant