-
-
Notifications
You must be signed in to change notification settings - Fork 71
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
feat: environment licenses as proper SPDX #459
Comments
PEP639 would fix this issue. |
I prepared a script that merges the pypi.org classifier list with the license list from https://spdx.org. For the trove classifieres I removed the sometimes occurring For some spdx license names I implemented a easy string replacement to adapt then on the classifier names.
Output:
Feel free to use and adapt it as you like. |
Note that you should consider using scancode-toolkit for the license detection: it does the work alright! |
Is there any activity on this topic? I would be very interested in it. As an idea for a better mapping of the licenses you could also read in the wheel, the metadata line license_files, or the file and see which license is the most similar? |
topic was solved already in https://github.com/CycloneDX/cyclonedx-python-lib/blob/main/cyclonedx/factory/license.py |
thanks to #571 i learned that the topic is still unsolved. |
re #459 (comment) looks like the license factory is prepared, but it is not used or the input is insufficient. in addition, some inputs are not properly detected as SPDX. for example "MIT" is a known id, but it is not recognized as such |
This feature will be part of the next/upcoming major release. |
Currently the licenses are read from package metadata.
They also come from trove classifiers.
Values are trove classifiers - read list A and list B.
See also: PEP 639 https://peps.python.org/pep-0639
The current implementation results in named licenses like "MIT License" as this is the value from classifier
License :: OSI Approved :: MIT License
.It would be great to have results as SPDX license IDs, instead of named licenses, if possible.
Therefore, some well-known classifiers might be mapped to SPDX names. The library might already to the correct factory behavior that is needed to create SPDX instead of named.
All that is missing is a mapping from classifiers to SPDX ids.
See latest general list of SPDX ids: https://spdx.org/licenses/
See list of library-supported SPDX ids: https://github.com/CycloneDX/cyclonedx-python-lib/blob/main/cyclonedx/schema/spdx.schema.json
some classifiers do not have a unique mapping to SPDX, the map 1:N.
For example trove
License :: Eiffel Forum License (EFL)
could be in SPDX eitherEFL-1.0
orEFL-2.0
.I would suggest skip unclear relations, and just map those that are 1:1.
See the thoughts in https://peps.python.org/pep-0639/#mapping-license-classifiers-to-spdx-identifiers
The text was updated successfully, but these errors were encountered: