Declare the license as an SPDX expression instead of a file - #980
Open
sap1110 wants to merge 1 commit into
Open
Conversation
license = {file = "LICENSE"} makes the backend inline the whole license text
into the METADATA License field, so the built wheel carries a 30-line License
field and PyPI renders the full BSD text where the short name belongs.
Switching to the PEP 639 form emits License-Expression: BSD-3-Clause instead.
The LICENSE file is still shipped, at dist-info/licenses/LICENSE, via
license-files.
The License :: OSI Approved :: BSD License classifier goes with it, since PEP
639 deprecates license classifiers once an expression is declared, and hatchling
is floored at 1.27, the first release that understands these fields.
🤖🍆 Prepared with the help of an AI coding agent, marked as the contributing
guide asks agents to do. Reviewed and tested by me.
Codecov Report✅ All modified and coverable lines are covered by tests.
☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Closes #870
license = {file = "LICENSE"}tells the build backend to inline the entire license text into theLicense:field ofMETADATA. The reporter saw the effect on PyPI, which prints that field where the short license name belongs.Building
maintoday still reproduces it. TheLicense:field in the wheel spans 30 lines:The PEP 639 form declares the license as an SPDX expression, which is what the field was meant to hold:
The LICENSE file itself is still shipped, now under
traitlets-<version>.dist-info/licenses/LICENSE, vialicense-files.Two changes come along with it. The
License :: OSI Approved :: BSD Licenseclassifier is removed, since PEP 639 deprecates license classifiers once an expression is declared and some backends reject having both. And thehatchlingfloor moves from 1.5 to 1.27, the first release that understandslicense-filesand emitsLicense-Expression; below that the new fields would be silently dropped.The reporter wondered whether a custom packaging script was involved. It isn't, this is just the older
license = {file = ...}spelling behaving as it was defined to.🤖🍆 Prepared with the help of an AI coding agent, marked as the contributing guide asks agents to do. Reviewed and tested by me.