pypi / warehouse

The Python Package Index
https://pypi.org
Apache License 2.0
3.54k stars 952 forks source link

Possible to support displaying all `authors` on PyPI page? #12877

Closed matthewfeickert closed 1 year ago

matthewfeickert commented 1 year ago

What's the problem this feature will solve?

:wave: Hi. Our project pyhf just switched (c.f. https://github.com/scikit-hep/pyhf/pull/2095) from having our PyPI metadata in setup.cfg to pyproject.toml. In doing so, we also changed from having our author metadata for the 3 authors be across author and author_email to having it be contained in authors following PEP 621's requirements of

These fields accept an array of tables with 2 keys: name and email. Both values must be strings. The name value MUST be a valid email name (i.e. whatever can be put as a name, before an email, in RFC 822) and not contain commas. The email value MUST be a valid email address. Both keys are optional.

pip is recognizing all the metadata as we would expect

$ python -m pip show pyhf
Name: pyhf
Version: 0.7.1.dev43
Summary: pure-Python HistFactory implementation with tensors and autodiff
Home-page: 
Author: 
Author-email: Lukas Heinrich <lukas.heinrich@cern.ch>, Matthew Feickert <matthew.feickert@cern.ch>, Giordon Stark <gstark@cern.ch>
License: Apache-2.0
Location: /home/feickert/.pyenv/versions/3.10.6/envs/pyhf-dev-CPU/lib/python3.10/site-packages
Requires: click, jsonpatch, jsonschema, numpy, pyyaml, scipy, tqdm
Required-by:

However, when we published this to TestPyPI to check how things looked after switching over we noticed that TestPyPI is displaying only the first author and linking their email

testPyPI

Previously when we shoved all our names and emails into author and author_email we could at least have all our names be displayed (no surprise there as we were abusing the field)

PyPI-0 7 0

I assume that this behavior with authors is because warehouse uses only the core metadata here (?) following PEP 621's instructions of:

Using the data to fill in core metadata is as follows:

  1. If only name is provided, the value goes in Author/Maintainer as appropriate.
  2. If only email is provided, the value goes in Author-email/Maintainer-email as appropriate.
  3. If both email and name are provided, the value goes in Author-email/Maintainer-email as appropriate, with the format {name} <{email}> (with appropriate quoting, e.g. using email.headerregistry.Address).
  4. Multiple values should be separated by commas.

Would it be possible for warehouse to display all authors information if it exists? Or is that something that is outside the scope of how warehouse interacts with metadata?

Describe the solution you'd like

Have warehouse be able to parse the existence of PEP 621 authors and display all names and associated emails of authors on the package webpage.

Additional context

di commented 1 year ago

Is this a duplicate of #9400?

matthewfeickert commented 1 year ago

Is this a duplicate of #9400?

Hm I think so. I'll assume yes and close here in favor of it, but actually check when I'm out of my next meeting.

Apologies for the noise: I searched "authors" in the Issues and so missed this as I didn't check all the ones just matching "author".