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

pip show "License: UNKNOWN" despite license in Trove classifiers #6677

Closed
hugovk opened this issue Jul 2, 2019 · 6 comments
Closed

pip show "License: UNKNOWN" despite license in Trove classifiers #6677

hugovk opened this issue Jul 2, 2019 · 6 comments
Labels
C: list/show 'pip list' or 'pip show' state: needs discussion This needs some more discussion type: enhancement Improvements to functionality

Comments

@hugovk
Copy link
Contributor

hugovk commented Jul 2, 2019

Environment

  • pip version: pip 19.1.1 from /usr/local/lib/python3.7/site-packages/pip (python 3.7)
  • Python version: 3.7
  • OS: macOS Mojave 10.14.5

Description

License is UNKNOWN:

$ pip show pillow
Name: Pillow
Version: 6.1.0
Summary: Python Imaging Library (Fork)
Home-page: http://python-pillow.org
Author: Alex Clark (Fork Author)
Author-email: [email protected]
License: UNKNOWN
Location: /usr/local/lib/python3.7/site-packages/Pillow-6.1.0-py3.7-macosx-10.14-x86_64.egg
Requires:
Required-by:

Expected behavior

Pillow has no license= in setup() but has a known licence in the Trove classifiers:

        classifiers=[
...
            "License :: OSI Approved :: Historical Permission Notice and Disclaimer (HPND)",
...
        ],

These suggest license= shouldn't be used when there's a license in the Trove classifiers= (emphasis mine):

Text indicating the license covering the distribution where the license is not a selection from the “License” Trove classifiers. See “Classifier” below. This field may also be used to specify a particular version of a license which is named via the Classifier field, or to indicate a variation or exception to such a license.

The license argument doesn’t have to indicate the license under which your package is being released, although you may optionally do so if you want. If you’re using a standard, well-known license, then your main indication can and should be via the classifiers argument. Classifiers exist for all major open-source licenses.

The “license” argument is more typically used to indicate differences from well-known licenses, or to include your own, unique license. As a general rule, it’s a good idea to use a standard, well-known license, both to avoid confusion and because some organizations avoid software whose license is unapproved.

The PR (pypa/packaging.python.org#492) for this latter said it's to "Indicate that this argument is meant for deviations from the Trove classifier, not instead of it."

Where does License from pip show come from?

Do we need to include license= to show the correct license in pip show, or is something extra needed in pip?

Thank you!

@triage-new-issues triage-new-issues bot added the S: needs triage Issues/PRs that need to be triaged label Jul 2, 2019
@xavfernandez xavfernandez added the type: enhancement Improvements to functionality label Jul 2, 2019
@triage-new-issues triage-new-issues bot removed the S: needs triage Issues/PRs that need to be triaged label Jul 2, 2019
@xavfernandez
Copy link
Member

pip show output could be improved to extract license from classifiers.
FWIW, in the meantime pip show -v can be used to output classifiers.

@xavfernandez xavfernandez added the C: list/show 'pip list' or 'pip show' label Jul 2, 2019
@cjerdonek
Copy link
Member

I think it would probably be good to be able to tell from the output where the information is coming from, too. For example, there could be separate “License” and “License-classifiers” fields. And maybe “unknown” is suppressed if a classifier is present.

@hugovk
Copy link
Contributor Author

hugovk commented Jul 3, 2019

The use case: a user runs pip show package to show the licence without having an additional step of visiting the repository to check the licence type for those that have to worry about such things (re: python-pillow/Pillow#3938).

In the short-term, we'll add license=, and suggest using pip show -v for other projects.

@pradyunsg
Copy link
Member

Related discussion at: https://github.com/pypa/warehouse/issues/2996#issuecomment-425761711

I'm of the opinion that it'd be better to have someone spend the time and effort to fix the big fish here -- better specification of license metadata -- rather than add more bandages that need to be removed later.

@chrahunt
Copy link
Member

Given the pending PEP mentioned in the linked issue, I would vote in favor of status quo (continuing to read from the license field). Hopefully with that initiative the metadata in general will improve over time, and we don't need to worry about backwards compatibility or supporting additional configuration like we would if implementing this issue.

@hugovk
Copy link
Contributor Author

hugovk commented Oct 26, 2024

This is no longer a problem for Pillow, we've since added licence= to our metadata:

pip show pillow
Name: pillow
Version: 11.0.0
Summary: Python Imaging Library (Fork)
Home-page: https://python-pillow.org
Author:
Author-email: "Jeffrey A. Clark" <[email protected]>
License: MIT-CMU
Location: /Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages
Requires:
Required-by: matplotlib, pillow_heif

I'm of the opinion that it'd be better to have someone spend the time and effort to fix the big fish here -- better specification of license metadata -- rather than add more bandages that need to be removed later.

The bigger fish are being dealt with in PEP 639 – Improving License Clarity with Better Package Metadata, provisionally accepted and being implemented across the packaging ecosystem.

I think we can close this now.

@hugovk hugovk closed this as completed Oct 26, 2024
@hugovk hugovk closed this as not planned Won't fix, can't repro, duplicate, stale Oct 26, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
C: list/show 'pip list' or 'pip show' state: needs discussion This needs some more discussion type: enhancement Improvements to functionality
Projects
None yet
Development

No branches or pull requests

5 participants