Skip to content

Commit 57089e3

Browse files
committed
Patch fix SPDX IDs
1 parent fb7d375 commit 57089e3

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description = "A beautiful description."
55
authors = [
66
{name = "CMI DAIR", email = "dair@childmind.org"}
77
]
8-
license = "LGPL-2.1"
8+
license = "LGPL-2.1-only"
99
readme = "README.md"
1010
requires-python = ">=3.12"
1111
dependencies = []

setup/licenses.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,15 @@ def get_license(name: str) -> dict[str, str]:
2727
if name not in LICENSES:
2828
raise ValueError(f"License {name} is not in {LICENSES}.")
2929
with request.urlopen(f"https://api.github.com/licenses/{name}") as response:
30-
license_info = response.read().decode()
31-
return json.loads(license_info)
30+
license_info_response = response.read().decode()
31+
license_info = json.loads(license_info_response)
32+
# The following SPDX identifiers have been deprecated which broke builds.
33+
# Remove once GitHub updates their API or we come up with better solution.
34+
license_info["spdx_id"] = {
35+
"LGPL-2.1": "LGPL-2.1-only",
36+
"LGPL-3.0": "LGPL-3.0-only",
37+
}.get(license_info["spdx_id"], license_info["spdx_id"])
38+
return license_info
3239

3340

3441
def modify_license_placeholder_text(selected_license: dict[str, str]) -> dict[str, str]:

0 commit comments

Comments
 (0)