Description
Describe the bug
PEP 691 states that the key name for metadata files in the JSON index should be dist-info-metadata
:
dist-info-metadata
: An optional key that indicates that metadata for this file is available, via the same location as specified in PEP 658 ({file_url}.metadata
).
However, warehouse is providing it under the data-dist-info-metadata
key instead:
$ curl -H 'Accept: application/vnd.pypi.simple.v1+json' https://pypi.org/simple/fluffy-server/ | jq .files
[...]
{
"data-dist-info-metadata": {
"sha256": "4db99543165cbdeef42ccb6257545911ccd7865d65e304e3e056f383a25f309c"
},
"filename": "fluffy_server-1.39.2-py3-none-any.whl",
[...]
This is causing pip to not use the metadata files as it is looking for the dist-info-metadata
key only:
https://github.com/pypa/pip/blob/f25f8fffbbd16fdb13a4f8977946afe9a3248453/src/pip/_internal/models/link.py#L265
Additional context
There are two bugs discovered recently in pip which may make this tricky to fix:
- pip parses
dist-info-metadata
key from JSON indexes incorrectly pypa/pip#12042 - pip install fails when PEP658 metadata is present if the user tries to install using a non-normalized package name pypa/pip#12038
I believe if we simply fix the key name in pypi.org, it will break existing pip versions as it will cause users to encounter these bugs. It may be necessary to coordinate this fix with fixes to the above bugs in pip to avoid disruption?