Skip to content

ci: publish with a twine that accepts current wheel metadata - #612

Merged
Nelson-PROIA merged 1 commit into
mainfrom
nelsonproia/pypi-publish-twine7
Aug 21, 2026
Merged

ci: publish with a twine that accepts current wheel metadata#612
Nelson-PROIA merged 1 commit into
mainfrom
nelsonproia/pypi-publish-twine7

Conversation

@Nelson-PROIA

Copy link
Copy Markdown
Contributor

Context

mistralai 2.9.4 did not reach PyPI. The publish job failed with:

Checking dist/mistralai/mistralai-2.9.4-py3-none-any.whl:
ERROR InvalidDistribution: Invalid distribution metadata:
      '2.5' is not a valid metadata version

The wheel is fine. The uploader is out of date.

setup-uv installs the newest uv unless a version is declared, and the log says so: "Could not determine uv version from uv.toml or pyproject.toml. Falling back to latest." The publish on 13 August used uv 0.12.3, this one used 0.12.5, and 0.12.5 writes Metadata-Version: 2.5. That is a valid, current format. The action pinned here bundles twine==6.1.0, which predates it.

Nothing in this repository changed. One side moved, the other is frozen.

Implementation

Bump the publish action to the first tag whose bundled twine understands the format:

tag twine
v1.13.0 (current) 6.1.0
v1.14.0 6.1.0
v1.14.1 6.1.0
v1.14.2 7.0.0

Pinning uv instead was the other option and is worse: it freezes a correct tool to satisfy a stale one, blocks every later uv improvement, and has to be maintained by hand. Metadata versions are a slow standardised sequence and a current twine reads current and older wheels, so moving the uploader forward is the durable direction.

dashboard already runs v1.14.2 in five of its publish workflows, so this brings the SDK in line rather than introducing anything new.

Checks / QA

Reproduced and verified locally rather than inferred. Building a trivial package with uv 0.12.5 produces Metadata-Version: 2.5, and checking that same wheel:

twine 6.1.0  ->  ERROR: '2.5' is not a valid metadata version
twine 7.0.0  ->  PASSED

The four inputs this workflow passes (packages-dir, print-hash, verbose, skip-existing) all still exist in v1.14.2.

The real test is the next publish reaching PyPI. Version 2.9.4 was never uploaded, so nothing needs yanking and the next run should pick it up cleanly.

The publish step pins an action whose bundled twine predates metadata version
2.5, so it rejects the wheels uv now produces and the release never reaches
PyPI. The build is correct; the uploader is behind.

The first tag carrying twine 7.0.0 is v1.14.2. The inputs this workflow passes
are unchanged there.
@andreaonofrei01
andreaonofrei01 self-requested a review August 21, 2026 17:46
@Nelson-PROIA
Nelson-PROIA merged commit df37126 into main Aug 21, 2026
11 checks passed
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.

2 participants