Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

mschoettle
Copy link

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.

@illia-v illia-v added the Skip Changelog Pull requests that don't require a changelog entry label Aug 23, 2024
@@ -12,6 +12,7 @@ keywords = ["urllib", "httplib", "threadsafe", "filepost", "http", "https", "ssl
authors = [
{name = "Andrey Petrov", email = "andrey.petrov@shazow.net"}
]
license = { text = "MIT" }
Copy link
Member

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"?

Copy link
Author

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/).

Copy link
Member

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.

Copy link
Member

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.)

@pquentin
Copy link
Member

pquentin commented Sep 3, 2024

Closing until PEP 639 is adopted. Thank you!

@pquentin pquentin closed this Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Skip Changelog Pull requests that don't require a changelog entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants