-
Notifications
You must be signed in to change notification settings - Fork 986
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
PEP 621-style license field shows the entire license text #12392
Comments
Some related discussion is here: https://github.com/FFY00/meson-python/issues/129 |
Thanks for the context! I think that the current UX needs to be improved regardless of how PEP 639 goes, the "Meta" section is really messed up for anyone who follows PEP 621 right now (which is the accepted standard at the moment). I think showing the (short) license name from the trove classifier there is more than enough (when available) with a fallback to the first line of the license text or so. PEP 639 would use different fields anyways, so even if that gets accepted you need to be able to deal with all the "legacy" approaches like PEP 621 or anything from before. It seems to me that that area in the PyPI UI is not meant for displaying anything more than a short-ish line anyhow, so at the very least the excess text should be truncated/hidden. |
I must add that currently setuptools just copies the contents of the referenced license file into the "License" field in PKG-INFO, so it can be interpreted that the contents of the field are the actual license text of the package. I can imagine that displaying the entire license on PyPI would be potentially useful, just not in the way it is done at the moment. |
Lastly, I see what you mean by https://packaging.python.org/en/latest/specifications/core-metadata/#license and so I believe setuptools does the right thing, we should probably just not use the license field together with the trove classifiers (in light of the core metadata specification). Nonetheless, even if someone used the license field according to the PyPA specification and added a longer custom license text there, the Meta section on PyPI would be still messed up, so I think this is indeed a valid bug, regardless of the slightly confusing specifications surrounding license information. |
The repo moved, here is the new link: mesonbuild/meson-python#129 |
The issue isn't fully resolved yet. Reopening. |
What would you like PyPI to do here that isn't already covered by #1354? We unfortunately have no way to distinguish that contents of the |
It kinda works for me, even though the current implementation with just the truncation is a bit rough. I guess having a preference to just show the license as parsed from the trove classifier when there's one would be more elegant. Is there anything against doing just that? |
Yes. Here's what I wrote in mesonbuild/meson-python#129 (comment):
So if you don't want to see the truncated bit, the solution is to not specify it as |
I understand, it's just that this approach seems to be very counter-intuitive in light of PEP 621. What you are saying essentially means we must not use the Perhaps what was proposed in #1354 would indeed be the most elegant solution after all. Having a link saying "see full license text" instead of the current truncated sentence seems like the most user- and package author-friendly approach. |
I guess the core issue is solved, although the truncation is not a particularly elegant approach. There's other issues tracking better alternatives (e.g. #1354), so I'll close this issue in favor of those. |
Describe the bug
When using PEP 621-style project metadata with a license file (see https://peps.python.org/pep-0621/#license), the entire license text is shown in the Meta -> License section of a package on pypi. For an example see https://pypi.org/project/pytest-logikal/ and the relevant pyproject.toml file https://github.com/logikal-io/pytest-logikal/blob/main/pyproject.toml#L10. Showing the entire license text makes the Meta section almost useless by pushing the rest of the metadata quite far to the bottom.
Expected behavior
The license text should be hidden by default and perhaps shown with a modal upon clicking "see full text". Note that the issue is similar to #1354, however, it is a little different due to the PEP 621 standard causing this behavior. With more and more projects adopting PEP 621 I would expect this to be a bigger issue over time.
The text was updated successfully, but these errors were encountered: