-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Describe the bug
PEP 621 allows project metadata to be defined in pyproject.toml
. This uses a list of dictionaries to represent the project's authors. Each dictionary contains two keys, "name" and "email".
To map these fields to core metadata, PEP 621 says:
- If only name is provided, the value goes in Author.
- If only email is provided, the value goes in Author-email.
- If both email and name are provided, the value goes in Author-email, with the format {name} <{email}> (with appropriate quoting, e.g. using email.headerregistry.Address).
Based on that, in my build backend whey I am generating metadata that looks like:
Metadata-Version: 2.1
Name: tox-envlist
Version: 0.3.0
Summary: Allows selection of a different tox envlist.
Author-email: Dominic Davis-Foster <[email protected]>
However, on PyPI this renders in the sidebar as:
(this example from https://pypi.org/project/tox-envlist/)
It's also wrong in the JSON API:
{
"info": {
"author": "",
"author_email": "Dominic Davis-Foster <[email protected]>"
}
}
This causes further issues with tools using the API, such as https://pypistats.org, which leaves the author field blank:
Expected behavior
Compare this with another project created using setuptools:
where the metadata is:
Metadata-Version: 2.1
Name: domdf-python-tools
Version: 2.9.0
Summary: Helpful functions for Python 🐍 🛠️
Home-page: https://github.com/domdfcoding/domdf_python_tools
Author: Dominic Davis-Foster
Author-email: [email protected]
and the response from the JSON API:
{
"info":{
"author":"Dominic Davis-Foster",
"author_email":"[email protected]"
}
}
(this example from https://pypi.org/project/domdf-python-tools)
I would have expected warehouse to parse the Author-email
field into the name and email address, and treat them the same as if they has been defined separately in Author
and Author-email
.
To Reproduce
Visible at https://pypi.org/project/tox-envlist/
See also https://pypi.org/project/flit/3.2.0/, which uses PEP 621 metadata and has the same problem but uses a different build backend.
My Platform
N/A
Additional context