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

Allowed values for license #563

Closed
erzoe opened this issue Jan 3, 2022 · 6 comments
Closed

Allowed values for license #563

erzoe opened this issue Jan 3, 2022 · 6 comments

Comments

@erzoe
Copy link

erzoe commented Jan 3, 2022

OS version

Debian 11

Python version

Python 3.9.2

Pip version

pip 21.3.1

Guide link

https://packaging.python.org/en/latest/tutorials/packaging-projects/

Problem description

Trying to upload a package licensed under WTFPL to pypi with python3 -m twine upload dist/* I am getting the error message

Invalid value for classifiers. Error: Classifier 'License :: WTFPL' is not a valid classifier.

I have specified the license in setup.cfg as:

classifiers =
    Programming Language :: Python :: 3
    License :: WTFPL
    Operating System :: OS Independent

I have not seen any limitation for the allowed licenses on Packaging Python Projects and the setuptools help for the license field.
It does, of course, make a lot of sense to not allow any string to avoid different names for the same license but I am missing the information which values I can use.

I have somehow found this link which seems to provide the list I am searching for but it does not list the WTFPL. Is it a deliberate decision that some licenses are not allowed or has this license just never been considered? How should users deal with that if the license they want to use is not allowed?

Error message

Content received from server:
<html>
 <head>
  <title>400 Invalid value for classifiers. Error: Classifier 'License :: WTFPL' is not a valid classifier.</title>
 </head>
 <body>
  <h1>400 Invalid value for classifiers. Error: Classifier 'License :: WTFPL' is not a valid classifier.</h1>
  The server could not comply with the request since it is either malformed or otherwise incorrect.<br/><br/>
Invalid value for classifiers. Error: Classifier &#x27;License :: WTFPL&#x27; is not a valid classifier.


 </body>
</html>
HTTPError: 400 Bad Request from https://upload.pypi.org/legacy/
Invalid value for classifiers. Error: Classifier 'License :: WTFPL' is not a valid classifier.
@merwok
Copy link

merwok commented Jan 3, 2022

The doc here: https://packaging.python.org/en/latest/specifications/core-metadata/#core-metadata-classifier
leads to the list of valid classifiers: https://pypi.org/classifiers/
which surprisingly does not include WTFPLv2

@erzoe
Copy link
Author

erzoe commented Jan 3, 2022

thank you very much, that link is very useful. Not only for licenses, I have also found a matching topic and environment there. I didn't even know such classifiers existed.

I have decided to go with 0BSD instead and declare it as License :: OSI Approved :: BSD License. That may be somewhat ambiguous but better than nothing I suppose.

@KOLANICH
Copy link

KOLANICH commented Jan 3, 2022

which surprisingly does not include WTFPLv2

WTFPL v2 is not OSI approved, so not under License :: OSI Approved :: . But since proprietary ones live under just License :: and since WTFPL is a public domain-like, I guess it should be License :: Public Domain :: WTFPLv2.

@layday
Copy link
Member

layday commented Jan 3, 2022

"Public Domain" is not a category and no other licenses should inhabit it. It is specifically for releasing something in the public domain.

Please open an issue or a PR at https://github.com/pypa/trove-classifiers if you'd like to add a WTFPL classifier, but note that at least one other PR for a license classifier is blocked pending resolution of PEP 639, which is also blocked for lack of a PEP delegate.

@layday
Copy link
Member

layday commented Jan 3, 2022

How should users deal with that if the license they want to use is not allowed?

Classifiers are not exhaustive. If your license is not listed that doesn't mean that it's not allowed. There exists a free-form "License" field. In setuptools, it's exposed as "license" (in lowercase).

@layday
Copy link
Member

layday commented Jan 4, 2022

I'll close this now but feel free to open an issue if you face any other problems :)

@layday layday closed this as completed Jan 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants