pilosus / pip-license-checker

Check license types for third-party dependencies: permissive, copyleft, proprietory, etc.
https://blog.pilosus.org/posts/2021/09/07/pip-license-checker/
Other
68 stars 3 forks source link

License :: OSI Approved trove classifier should not be considered as a license name #43

Closed pilosus closed 3 years ago

pilosus commented 3 years ago

For now scikit-learn gets recognized as Other type, because it has the following in metadata:

"classifiers": [
      ...
      "License :: OSI Approved",
      ...
]
"license": "new BSD"

PyPI page shows license as OSI Approved (new BSD), meaning it recognizes that classifier has only common type without specific license name.

Packaging docs says:

The license argument doesn’t have to indicate the license under which your package is being released, although you may optionally do so if you want. If you’re using a standard, well-known license, then your main indication can and should be via the classifiers argument. Classifiers exist for all major open-source licenses.

The “license” argument is more typically used to indicate differences from well-known licenses, or to include your own, unique license. As a general rule, it’s a good idea to use a standard, well-known license, both to avoid confusion and because some organizations avoid software whose license is unapproved.

So the algorithm for choosing the licenses should be amended so that:

  1. Check license in classifiers first, if specific license found, use it, if not go p.2 License :: OSI Approved is considered to be a common license description, not the license name!
  2. Check license field, if found use it, if not go p.3
  3. Check github repo license