pip icon indicating copy to clipboard operation
pip copied to clipboard

Use dict for project_url in inspect

Open JakobDev opened this issue 3 years ago • 1 comments

What's the problem this feature will solve?

Currently project_url in the output of pip inspect has this format:

"project_url": [
    "Bug Reports, https://github.com/Ousret/charset_normalizer/issues",
    "Documentation, https://charset-normalizer.readthedocs.io/en/latest"
],

If you want to parse this, you first need to do a string split.

Describe the solution you'd like

This would be the better format:

"project_url": {
    "Bug Reports": "https://github.com/Ousret/charset_normalizer/issues",
    "Documentation": "https://charset-normalizer.readthedocs.io/en/latest"
},

Alternative Solutions

None

Additional context

None

Code of Conduct

JakobDev avatar Jul 25 '22 13:07 JakobDev

Hi!

Currently the output of pip inspect is based on standards. In the case of metadata, it is the JSON transformation that is specified in PEP 566.

For interoperability reasons, I think it is better to keep it that way, and let higher libraries provide convenience functions, depending on the use cases.

For instance, I think there is ongoing work in the packaging project to provide a library api to manipulate metadata, and it could be interesting to consider there if a convenience API to manipulate project URLs is worthwhile.

sbidoul avatar Jul 25 '22 15:07 sbidoul