Repository navigation
BUG: Fix license-expression metadata breaking twine check - #2632
Merged
Merged
Conversation
Use the table form instead of the bare SPDX string . The bare string is PEP 639 syntax that emits a field in core metadata 2.4, which older twine versions do not recognize and flag as an invalid distribution, breaking the nightly packaging GHA workflow.
blowekamp
requested review from
Copilot and
zivy
and removed request for
Copilot
July 15, 2026 12:57
blowekamp
marked this pull request as ready for review
July 15, 2026 12:57
zivy
approved these changes
Jul 15, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts Python package metadata to avoid generating the Core Metadata License-Expression field (triggered by PEP 639-style license = "Apache-2.0"), which breaks twine check on older Twine versions used by the nightly packaging workflow.
Changes:
- Switch
licensefrom a bare SPDX string to the table formlicense = {text = "Apache-2.0"}in the rootpyproject.toml. - Apply the same license metadata change to the packaging template
Wrapping/Python/Packaging/pyproject.toml.in.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
pyproject.toml |
Uses table-form license to avoid emitting License-Expression metadata that older Twine rejects. |
Wrapping/Python/Packaging/pyproject.toml.in |
Mirrors the same license metadata change in the packaging template to keep generated packaging consistent. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix
InvalidDistribution: unrecognized or malformed field 'license-expression'error fromtwine checkbreaking the nightly packaging GHA workflow.Problem
The bare SPDX string form
license = "Apache-2.0"is PEP 639 syntax, which causesscikit-build-coreto emit aLicense-Expression:field in core metadata 2.4. Older versions oftwinedo not recognizelicense-expressionas a valid metadata field and reject the distribution.Fix
Changed
license = "Apache-2.0"tolicense = {text = "Apache-2.0"}in both:pyproject.tomlWrapping/Python/Packaging/pyproject.toml.inThe table form emits the traditional
License:field (core metadata 2.1), which is compatible with alltwineversions.