Open elrayle opened 8 months ago
@elrayle This will be a good topic to discuss in our next community meeting. Historically, license was only parsed from classifiers. This commit adds the functionality to extract license from info.license. To avoid any breaking changes, extracting from info.license is added as a fallback if no valid license is parsed from classifiers.
In addition to the precedence order, this calculation/extraction of declared license is better done in service in my opinion. Reasons see comment
Another case: https://clearlydefined.io/definitions/pypi/pypi/-/UpSetPlot/0.9.0.
Description
It appears that for pypi, classifiers take precedence over the license field when extracting the license information. It is clear from the code how this is happening. I'm wondering about the rationale for this approach. Also if it is determined that one is correct and the other is not, is there a process for updating the license or the classifier as needed?
Test
Fixture Data
classifiers
license
Expected
With a specific license given in
info.license
, I would expect the license to be eitherLGPL-2.0-or-later
orLGPL-2.1-only
.Actual
Precedence is given to classifiers in function _extractDeclaredLicense, which produces license
LGPL-2.0-only
.