Skip to content

fix(release): pin twine to 6.2.0 to fix PyPI upload metadata error - #230

Merged
pranavz28 merged 1 commit into
masterfrom
fix/twine-metadata-2-4-pin
Aug 18, 2026
Merged

fix(release): pin twine to 6.2.0 to fix PyPI upload metadata error#230
pranavz28 merged 1 commit into
masterfrom
fix/twine-metadata-2-4-pin

Conversation

@pranavz28

Copy link
Copy Markdown
Contributor

Summary

  • The Release workflow run for v2.0.9-beta.0 failed at twine upload with InvalidDistribution: Metadata is missing required fields: Name, Version.
  • Root cause: development.txt pins twine==5.1.1, which bundles pkginfo — a package that can't parse the Metadata-Version: 2.4 files emitted by the unpinned, latest setuptools the release Makefile installs. pkginfo silently drops Name/Version, so twine's own validation rejects an otherwise-valid wheel (upstream: Failed to upload artifacts to Test PyPI or PyPI - Invalid Distribution Metadata: unrecognized or malformed field: 'license-file' pypa/twine#1216).
  • twine>=6.1.0 dropped pkginfo in favor of packaging for metadata validation, which correctly supports Metadata-Version 2.4. This bumps to 6.2.0.
  • Note: dependabot PR ⬆️ Bump twine from 5.1.1 to 7.0.0 #223 already proposes bumping twine, but to 7.0.0, which requires Python>=3.10 and breaks the Test (3.9) CI job. 6.2.0 fixes the release without breaking the supported Python matrix.

Test plan

  • CI (Test/Lint/CodeQL/Semgrep) passes on this PR
  • Cut a new beta release (see follow-up version-bump PR) and confirm the Release workflow's make release step succeeds and the package appears on PyPI

twine 5.1.1 bundles pkginfo, which cannot parse the Metadata-Version 2.4
files emitted by modern setuptools (unpinned in the release Makefile's
venv target). pkginfo silently drops Name/Version, so twine upload
rejects the wheel with "Metadata is missing required fields: Name,
Version" (pypa/twine#1216) even though the built wheel is valid.

twine>=6.1.0 replaced pkginfo with packaging for metadata validation,
fixing this. 6.2.0 is used instead of the open dependabot PR's 7.0.0
bump, since 7.0.0 requires Python>=3.10 and breaks the Test(3.9) CI job.
@pranavz28
pranavz28 requested a review from a team as a code owner August 18, 2026 14:45
@pranavz28 pranavz28 mentioned this pull request Aug 18, 2026
2 tasks
@pranavz28
pranavz28 merged commit cb8ba74 into master Aug 18, 2026
9 checks passed
@pranavz28
pranavz28 deleted the fix/twine-metadata-2-4-pin branch August 18, 2026 14:52
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