Hey all! I tried looking for a previous conversation about this, but couldn’t find one. Apologies if I’ve missed it; if there is one, I’d be happy to close this and follow up there instead.
The Core metadata specifications is the living (PyPA) spec for distribution metadata. Within the living spec, there are two different ways to express a project’s URLs:
Project-URL is present in metadata 1.2 and newer, and is a multi-use field for specifying arbitary URLs.
Home-page and Download-URL are present in 1.0 and 1.1 (respectively) and are single use fields for specifying the release’s homepage and (non-index) download URL, respectively.
To the best of my understanding, Home-page and Download-URL are intentionally not exposed in the standard pyproject.toml representation of project metadata, with the expectation that users fill in the project.urls table with appropriately tagged URLs to signify equivalency with the old fields. For example, empirically, the following project.urls table is treated by PyPI as supplying the homepage and download URLs:
So, my actual question: should the Home-page and Download-URL fields be deprecated, at least in newer versions of the core metadata? It seems as though standard project metadata representations are moving away from having separate fields for these URLs and indices are expected to extract their equivalents from the Project-URLs instead, so having these be explicitly marked as deprecated/not preferred might reduce some confusion around what role they play.
Based on those GitHub threads, it seems like there’s broad consensus that Home-page and Download-URL should be deprecated (and that PyPI is waiting on normative language around “which” URLs are authoritative before making more changes to its URL handling).
Given that, I’m curious what you and others think the best path forwards here is. The PyPA specs suggest writing a PEP for updates to living specifications; I’m happy to look into that if that sounds right.
I also think deprecation makes sense, however I’d like for the Project-URL description in the packaging guide to be a little more opinionated:
The label is free text limited to 32 characters.
I think there are clearly a set of common conventions that folks[1] cargo cult to new projects. Does it make sense to at least enumerate those common conventions and their meanings?
Yep, completely agreed! From PyPI’s issues it looks like normalization of the label has also been a source of (mild) confusion, so I’ll likely propose the following in the PEP:
Labels should be normalized via lower().replace("-", "").replace("_", ""), meaning that Homepage, homepage, home-page, and home_page all refer to the same label. As a corrollary, duplicate labels should be warned on (or cause an outright failure?)
The homepage project URL corresponds directly to the Home-page field’s semantics
The download project URL corresponds directly to the Download-URL field’s semantics
There are others that might make sense to stipulate as well, but I’m mildly concerned that enumerating more of them might push the PEP outside of the orbit of uncontroversial metadata fixes. But perhaps I’m being overly conservative there!
The PyPI docs were recently updated to list the URL categories that get dedicated icons: Project Metadata - PyPI Docs
A deprecation PEP should reference that, since affecting how your project gets displayed on PyPI is the main immediate benefit of sticking with conventional URL labels.
The two (minor!) issues I noticed were that the change log aliases haven’t been added yet, and the wildcard aliases aren’t clearly distinguished from the exact aliases (so someone reading the table might mistakenly think “Issue Tracker” isn’t supported).
What’s there is still a major improvement from where we were before the addition of those tables, though.
If anybody is so inclined, please give it a look! I’m also hereby requesting volunteers for Sponsor and PEP-Delegate before I formally open this on the upstream PEPs repo
LGTM! I’m happy to be PEP delegate for this (I think it comes under my remit) unless someone else wants to volunteer.
One thought - maybe it would be a good idea if the PEP explicitly said that additional well-known labels can be added without needing a new metadata version, or a formal PEP? I don’t see any reason to require a lot of ceremony to add new labels, and being explicit about that now might save some debate later.