Skip to content

Implement PEP 753: "Well-known Project URLs in Metadata" #13135

@ichard26

Description

@ichard26

A few months ago, PEP 753 was accepted. It is now known as the "Well-known Project URLs in Metadata" standard. We should implement it as pip does consume project URL metadata.

I haven't looked at pip's existing Project-URL or Home-page handling, so it's possible that there is very little or nothing to do on pip's end, but I wanted to file this issue to make sure we take a look at some point. The logic that mirrors PyPI's old homepage Project-URL aliasing probably needs a some tweaking to have it conform to the specification.

if not homepage:
# It's common that there is a "homepage" Project-URL, but Home-page
# remains unset (especially as PEP 621 doesn't surface the field).
#
# This logic was taken from PyPI's codebase.
for url in project_urls:
url_label, url = url.split(",", maxsplit=1)
normalized_label = (
url_label.casefold().replace("-", "").replace("_", "").strip()
)
if normalized_label == "homepage":
homepage = url.strip()
break

cc @woodruffw

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions