-
Notifications
You must be signed in to change notification settings - Fork 8
Use BSD-2-Clause license identifier #16
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
base: main
Are you sure you want to change the base?
Conversation
The license field is actually free text, there is an ongoing PEP to use SPDX identifiers. |
True. PEP 639 will improve the current situation. The disadvantage of only classifiers is that in the case of BSD it is ambiguous since it maps to multiple possible licenses. |
Thanks for the PR. Does this actually matter if the full and correct license is in the repo? I'm happy to merge this if it's the right thing to do, but I'm not familiar with the situation regarding PyPI and licenses at all. |
It matters in that PyPI artifacts are independent from this github repo! This doesn’t change anything functionally: when you upload to PyPI, you are granting it a license to distribute your files. The impact is on people reviewing their dependencies’ metadata, possibly not by manual inspection but using scanning tools, so there is value in having consistent and correct information. These could be individual developers or OS packagers (downstream in Debian, Fedora, Conda, etc). |
That's basically where this occurred for us. We run dependency scanning in the pipeline (the one from GitLab on GitLab). Besides checking for vulnerable packages/package versions it can also detect the license. I was told by GitLab's support that they rely on the At the same time, that field gets shown on PyPI on the left-hand side under Meta -> License. I noticed that if it is a valid identifier PyPI shows the name with the identifier in parentheses. (compare Django and django-forms-dynamic). |
|
Here is a guide on current best practices: https://hugovk.dev/blog/2025/improving-licence-metadata/ |
Thanks! While it looks right, I don't think it works as is: $ pip show django-forms-dynamic
Name: django-forms-dynamic
Version: 1.0.1
Summary: Resolve form field arguments dynamically when a form is instantiated, not when it's declared.
Home-page: https://github.com/dabapps/django-forms-dynamic
Author: DabApps
Author-email: [email protected]
License: BSD-2-Clause
Location: /usr/local/python/3.12.1/lib/python3.12/site-packages
Requires:
Required-by: Built using I suspect because the use of |
No, running commands like
Do you have pip 25.0 or newer? ref: pypa/pip@41c807c |
@@ -13,7 +13,7 @@ | |||
url = "https://github.com/dabapps/django-forms-dynamic" | |||
author = "DabApps" | |||
author_email = "[email protected]" | |||
license = "BSD" | |||
license = "BSD-2-Clause" |
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.
This is the old free-form license field, not the recent SPDX licence-expression field
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.
Ah, right. Good catch! It still passed the license to the license
argument in setup
. pip show
shows License-Expression
after changing the argument to license_expression
.
That's what the |
BSD
is ambiguous. Since the license is BSD 2 Clause, the SPDX identifier for this license can be used here.