You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After the introduction of PEP639, which improves clarity in licenses via better package metadata, various projects are adopting SPDX license expressions in their metadata as a way to specify the package's licenses (vs. the previous License field). Here are some recent examples:
However, LicenseCheck version 2024.3 does not recognise license expressions, and the check for these packages fails.
Is your feature request related to a problem? Please describe
Given that those packages actually have licenses defined in the package's metadata, it'd be great that LicenseCheck identifies the licenses from license expressions. We currently use LicenseCheck in our pipeline, and since more and more packages are using license expressions, the pipelines keep failing.
Describe the solution you'd like
While debugging, I realised that the metadata library does extract the information from the package, it is just embedded into a json, and the keys point to license_expression. So expanding the function getPackageInfoLocal to also extract license_expression would suffice. Something along the lines:
if lice == UNKNOWN:
lice = _pkgMetadataGet(pkgMetadata, "License") or _pkgMetadataGet(pkgMetadata.json, "license_expression")
The text was updated successfully, but these errors were encountered:
I'll check the referencing case as this might just be that we couldn't identify the licence it was using which was a change from the No-License behaviour previously :)
Feature Details
After the introduction of PEP639, which improves clarity in licenses via better package metadata, various projects are adopting SPDX license expressions in their metadata as a way to specify the package's licenses (vs. the previous
License
field). Here are some recent examples:However, LicenseCheck version 2024.3 does not recognise license expressions, and the check for these packages fails.
Is your feature request related to a problem? Please describe
Given that those packages actually have licenses defined in the package's metadata, it'd be great that LicenseCheck identifies the licenses from license expressions. We currently use LicenseCheck in our pipeline, and since more and more packages are using license expressions, the pipelines keep failing.
Describe the solution you'd like
While debugging, I realised that the metadata library does extract the information from the package, it is just embedded into a json, and the keys point to
license_expression
. So expanding the functiongetPackageInfoLocal
to also extract license_expression would suffice. Something along the lines:The text was updated successfully, but these errors were encountered: