-
Notifications
You must be signed in to change notification settings - Fork 153
Support simple SPDX license expressions (PEP 639) #712
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
Merged
Merged
Changes from 4 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
640b6ad
Add support for license expressions
cdce8p 6d60848
Add validation of simple license expressions
takluyver 06faa0b
Allow unrecognised license IDs with FLIT_ALLOW_INVALID
takluyver c62ba7d
Fix path passed to read_pep621_metadata in test
takluyver e08f30f
Fix the path passed to read_pep621_metadata in more tests
takluyver f08bb9f
Merge branch 'main' into license-expression
takluyver 345bf1c
Remove test for license text again
takluyver 0d0d06b
Add back project.license.file to license files
takluyver File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| # Call with path to SPDX license-list-data repo, cloned from: | ||
| # https://github.com/spdx/license-list-data | ||
|
|
||
| import json | ||
| import pprint | ||
| import sys | ||
| from pathlib import Path | ||
|
|
||
| list_data_repo = Path(sys.argv[1]) | ||
| with (list_data_repo / 'json' / 'licenses.json').open('rb') as f: | ||
| licenses_json = json.load(f) | ||
|
|
||
| condensed = { | ||
| l['licenseId'].lower() : {'id': l['licenseId']} | ||
| for l in licenses_json['licenses'] | ||
| if not l['isDeprecatedLicenseId'] | ||
| } | ||
|
|
||
| with Path('flit_core', 'flit_core', '_spdx_data.py').open('w') as f: | ||
| f.write("# This file is generated from SPDX license data; don't edit it manually.\n\n") | ||
|
|
||
| f.write("licenses = \\\n") | ||
| pprint.pprint(condensed, f) | ||
|
|
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.
Uh oh!
There was an error while loading. Please reload this page.