-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #712 from pypa/license-expression
Support simple SPDX license expressions (PEP 639)
- Loading branch information
Showing
8 changed files
with
831 additions
and
24 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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) | ||
|