evansd / whitenoise

Radically simplified static file serving for Python web apps
https://whitenoise.readthedocs.io
MIT License
2.52k stars 148 forks source link

Add license identifier to project metadata #601

Closed mschoettle closed 3 weeks ago

mschoettle commented 3 weeks ago

License scanning tools (such as the one used by GitLab) rely on the project metadata (made available via the PyPi API) to detect the license for a package.

Currently, license: null is returned.

This PR adds the license to the project metadata.

adamchainz commented 3 weeks ago

The project already follows the packaging standard:

If you are using a standard, well-known license, it is not necessary to use this field. Instead, you should use one of the classifiers starting with License ::. (As a general rule, it is a good idea to use a standard, well-known license, both to avoid confusion and because some organizations avoid software whose license is unapproved.)

No license field is required, since the classifier is specified.

I think the GitLab scanner needs updating to read classifiers instead.

mschoettle commented 1 week ago

Fair enough. Unfortunately, the classifiers are ambiguous in some cases, although not for MIT (see https://github.com/pypa/trove-classifiers/issues/17). And PyPI for some reason does not use the classifier to return the license in its API: https://pypi.org/pypi/whitenoise/json

In any case, PEP 639 aims to improve on this and it has been provisionally accepted. It makes sense to wait until PyPI and build tools added support for it.