Support SPDX WITH expressions - #809
Merged
Merged
Conversation
yangfan-yf-yf
marked this pull request as ready for review
July 23, 2026 15:02
takluyver
reviewed
Sep 12, 2026
takluyver
left a comment
Member
There was a problem hiding this comment.
Thanks, this looks good to me.
Could you add an entry in the documentation about version constraints, that license expressions using WITH require flit_core >=4.1?
| else: | ||
| if parts and parts[-1] not in {' AND ', ' OR ', '('}: | ||
| if parts and parts[-1] not in {' AND ', ' OR ', ' WITH ', '('}: | ||
| reason = "a license ID must follow either AND, OR, or '('" |
Member
There was a problem hiding this comment.
The message here should be updated now that WITH and exception IDs are also accepted
Contributor
Author
|
Updated in 33a7a39:
Validation: core tests passed (217 passed, 1 skipped), the valid-expression and updated-error-message checks passed, and the Sphinx HTML build passed with warnings treated as errors. |
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 #735.
This adds SPDX exception IDs for
WITHexpressions. The parser now normalises exception IDs, retains the existing uppercase-operator rule, and rejects a secondWITHafter an exception ID.The generated license data remains aligned with SPDX v3.26, which matches the version already used for the existing license IDs; this change adds only exception IDs.
Validation:
python -m pytest flit_core/tests_core -qwithPYTHONPATH=flit_core(216 passed, 1 skipped)WITH