-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add license identifier to project metadata #3458
Conversation
@@ -12,6 +12,7 @@ keywords = ["urllib", "httplib", "threadsafe", "filepost", "http", "https", "ssl | |||
authors = [ | |||
{name = "Andrey Petrov", email = "[email protected]"} | |||
] | |||
license = { text = "MIT" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the contribution!
Packaging docs recommend using a classifier instead of this attribute and we already provide it
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.)
It's weird that it's not taken into account by the PyPI API, but I'm not against adding this attribute. Will text = "MIT License"
(as in the docs example and in the existing classifier) work the same as text = "MIT"
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting. I came across an issue and follow-up discussion with the intention to make license classifiers more fine-grained (pypi/warehouse#15901) and it seems it turned into a PEP to improve license clarity (https://discuss.python.org/t/pep-639-round-3-improving-license-clarity-with-better-package-metadata/53020).
Will text = "MIT License" (as in the docs example and in the existing classifier) work the same as text = "MIT"?
I don't think so. Based on my understanding and one case where license = LGPLv3+
was not detected by the scanning tool it seems that it should be a valid SPDX identifier. In this case that's MIT
(https://spdx.org/licenses/).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also agree that if we put something here it should be the SPDX identifier.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(And to be clear I would also prefer for the PEP to be finalized before adding this.)
Closing until PEP 639 is adopted. Thank you! |
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.