mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-30 01:57:13 +02:00
Host SPDX licenses on Bintray, Github is blocked in multiple countries
This commit is contained in:
@ -242,7 +242,7 @@ class ManifestSchema(BaseSchema):
|
|||||||
raise ValidationError("Could not load SPDX licenses for validation")
|
raise ValidationError("Could not load SPDX licenses for validation")
|
||||||
for item in spdx.get("licenses", []):
|
for item in spdx.get("licenses", []):
|
||||||
if item.get("licenseId") == value:
|
if item.get("licenseId") == value:
|
||||||
return
|
return True
|
||||||
raise ValidationError(
|
raise ValidationError(
|
||||||
"Invalid SPDX license identifier. See valid identifiers at "
|
"Invalid SPDX license identifier. See valid identifiers at "
|
||||||
"https://spdx.org/licenses/"
|
"https://spdx.org/licenses/"
|
||||||
@ -251,9 +251,5 @@ class ManifestSchema(BaseSchema):
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
@memoized(expire="1h")
|
@memoized(expire="1h")
|
||||||
def load_spdx_licenses():
|
def load_spdx_licenses():
|
||||||
version = "3.10"
|
spdx_data_url = "https://dl.bintray.com/platformio/dl-misc/spdx-licenses-3.json"
|
||||||
spdx_data_url = (
|
|
||||||
"https://raw.githubusercontent.com/spdx/license-list-data"
|
|
||||||
"/v%s/json/licenses.json" % version
|
|
||||||
)
|
|
||||||
return json.loads(fetch_remote_content(spdx_data_url))
|
return json.loads(fetch_remote_content(spdx_data_url))
|
||||||
|
Reference in New Issue
Block a user