You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Example package leads to author name being munged with author_email #1134
Following the example package from here, in particular the method of specifier author/email it demonstrates causes pip show to get confused. An example pyproject.toml:
dict(importlib.metadata.distribution("test-package")) gives the same pattern. This happens irregardless of build backend. What is the reasoning behind this discrepancy? Is the Author field in packaging land being phased out or is this a bug somwhere?
Hmm, so Author-email includes author's name and Author includes the author's email. Why have separate fields for the two then if Author is a superset of Author-email?
I believe this is also the interpretation setuptools follows.
@bwoodsend this is in accordance with the text of PEP 621:
If only name is provided, the value goes in Author/Maintainer as appropriate.
If only email is provided, the value goes in Author-email/Maintainer-email as appropriate.
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). https://peps.python.org/pep-0621/#authors-maintainers
Or would it be a different problem?
Note: According to core metadata, I belive that both Author and Author-email could be used when both pieces if information are available, but PEP 621 restricts that to Author-email.
If you disagree with the approach described in the PEP, I suggest creating a discussion in https://discuss.python.org/c/packaging/14 and possibly volunteering to write another PEP changing that.
Activity
ofek commentedon Aug 29, 2022
Hatchling interprets https://packaging.python.org/en/latest/specifications/core-metadata/#author as https://github.com/pypa/hatch/blob/hatchling-v1.8.1/backend/src/hatchling/metadata/core.py#L681-L686
bwoodsend commentedon Aug 29, 2022
Hmm, so
Author-emailincludes author's name andAuthorincludes the author's email. Why have separate fields for the two then ifAuthoris a superset ofAuthor-email?abravalheri commentedon Aug 30, 2022
I believe this is also the interpretation setuptools follows.
@bwoodsend this is in accordance with the text of PEP 621:
Or would it be a different problem?
Note: According to core metadata, I belive that both
AuthorandAuthor-emailcould be used when both pieces if information are available, but PEP 621 restricts that toAuthor-email.If you disagree with the approach described in the PEP, I suggest creating a discussion in https://discuss.python.org/c/packaging/14 and possibly volunteering to write another PEP changing that.
bwoodsend commentedon Aug 30, 2022
It is indeed what the PEP says. I can't say I like it but you're right - this isn't the place.