Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump metadata version to 2.4 to fix license bug #2332

Merged
merged 2 commits into from
Nov 28, 2024

Conversation

konstin
Copy link
Member

@konstin konstin commented Nov 28, 2024

When a project sets license = { file = "LICENSE" }, we're currently emitting a License-File entry, but Metadata-Version 2.3, which is invalid and now gets rejected by PyPI, breaking publish for projects using license = { file = "LICENSE" }. This change bumps the metadata version.

Alternatively, we could only bump the version if license files are used and use the old License field for license = { file = "LICENSE" } again, but i'm not aware of any index currently rejecting metadata version 2.4.

When a project sets `license = { file = "LICENSE" }`, we're currently emitting a `License-File` entry, but Metadata-Version 2.3, which is invalid and now gets rejected by PyPI. This change bumps the metadata version.

Alternatively, we could only bump the version if license files are used and use the old `License` field for `license = { file = "LICENSE" }` again, but i'm not aware of any index currently rejecting metadata version 2.4.
@konstin konstin added the bug Something isn't working label Nov 28, 2024
@konstin konstin enabled auto-merge (squash) November 28, 2024 14:21
@konstin konstin merged commit 6090c81 into main Nov 28, 2024
37 of 38 checks passed
@konstin konstin deleted the konsti/bump-metadata-to-2-4 branch November 28, 2024 15:11
@ddelange
Copy link

ddelange commented Nov 29, 2024

hi @messense @konstin 👋

this was a breaking change, twine does not allow metadata version 2.4: https://github.com/oconnor663/blake3-py/actions/runs/12079634972/job/33685800258

xref pypa/twine#1146

plusvic referenced this pull request in VirusTotal/yara-x Nov 29, 2024
This was the version that built the a wheel package with Metadata-Version 2.3, which seems to be the larger version accepted by `pypa/gh-action-pypi-publish`, newer versions of `maturin`seem to be producing packages with Metadata-Version 2.4.
@ddelange
Copy link

ddelange commented Nov 30, 2024

but Metadata-Version 2.3, which is invalid and now gets rejected by PyPI

by pinning maturin to 1.7.5, we were able to push to pypi (twine check within pypa/gh-action-pypi-publish passes with metadata 2.3, and apparently pypi still accepts it).

on a side note, pypa/twine#1123 was merged and as soon as that's released and propagated to pypa/gh-action-pypi-publish, your users should be green again using maturin 1.7.6.

@ddelange
Copy link

ddelange commented Dec 1, 2024

I think no action is required here: we're almost there ref pypa/gh-action-pypi-publish#308

@ddelange
Copy link

ddelange commented Dec 9, 2024

pypa/[email protected] has been released with metadata 2.4 support 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants