GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||
GeezerVison is showing peps.python.org — PEP 753 – Uniform project URLs in core metadata | peps.python.org
PEP 753 – Uniform project URLs in core metadata
PEP 753 – Uniform project URLs in core metadata
Important This PEP is a historical document. The up-to-date, canonical spec, Well-known Project URLs in Metadata, is maintained on the PyPA specs page. × See the PyPA specification update process for how to propose changes. AbstractThis PEP recommends two discrete changes to the processing of core metadata by indices (such as PyPI) and other core metadata consumers:
Rationale and MotivationPython’s standard core metadata has gone through many years of revisions, with various standardized milestone versions. These revisions of the core metadata have introduced various mechanisms for expressing a package’s relationship to external resources, via URLs:
Metadata 2.1, 2.2, and 2.3 leave the behavior of these fields as originally specified. Because These conventions have seen significant adoption, with PEP 621 explicitly
choosing to provide only a
This PEP exists to formalize the informal conventions that have arisen, as well
as explicitly document SpecificationThis PEP proposes that Metadata producersThis PEP stipulates the following for metadata producers:
These stipulations do not change the optionality of URL fields in core metadata.
In other words, producers MAY choose to omit This PEP does not propose the outright removal of support for Similarly, this PEP does not propose that metadata producers emit normalized labels. Label normalization is performed solely on the processing and consumption side (i.e. within indices and other consumers of distribution metadata). Package indicesThis PEP stipulates the following for package indices:
These stipulations do not change the optionality of URL processing by indices. In other words, an index that does not process URLs within uploaded distributions may continue to ignore all URL fields entirely. Similarly, these stipulations do not imply that the index should persist any normalizations that it performs to a distribution’s metadata. In other words, this PEP stipulates label normalization for the purpose of user presentation, not for the purpose of modifying an uploaded distribution or its “sidecar” PEP 658 metadata file. Conventions for
|
| Raw | Normalized |
|---|---|
Homepage |
homepage |
Home-page |
homepage |
Home page |
homepage |
Change_Log |
changelog |
What's New? |
whatsnew |
When processing distribution metadata, package indices SHOULD perform label normalization to determine if a given label is well known for subsequent special processing. Labels that are not well-known MUST be processed in their un-normalized form.
Normalization does not change pre-existing semantics around duplicated
Project-URL labels. In other words, normalization may result in duplicate
labels in the project’s metadata, but only in the same manner that was already permitted
(since the core metadata specification does
not stipulate that labels are unique).
Excerpted examples of normalized metadata fields are provided in Appendix A.
In addition to the normalization rules above, this PEP proposes a
fixed (but extensible) set of “well-known” Project-URL labels,
as well as aliases and human-readable equivalents.
The following table lists these labels, in normalized form:
| Label (Human-readable equivalent) | Description | Aliases |
|---|---|---|
homepage (Homepage) |
The project’s home page | (none) |
source (Source Code) |
The project’s hosted source code or repository | repository, sourcecode, github |
download (Download) |
A download URL for the current distribution, equivalent to Download-URL |
(none) |
changelog (Changelog) |
The project’s comprehensive changelog | changes, whatsnew, history |
releasenotes (Release Notes) |
The project’s curated release notes | (none) |
documentation (Documentation) |
The project’s online documentation | docs |
issues (Issue Tracker) |
The project’s bug tracker | bugs, issue, tracker, issuetracker, bugtracker |
funding (Funding) |
Funding Information | sponsor, donate, donation |
Indices MAY choose to use the human-readable equivalents suggested above in their UI elements, if appropriate. Alternatively, indices MAY choose their own appropriate human-readable equivalents for UI elements.
Packagers and metadata producers MAY choose to use any label that normalizes to these labels (or their aliases) to communicate specific URL intents to package indices and downstreams.
Similarly, indices MAY choose to specialize their rendering or presentation of URLs with these labels, e.g. by presenting an appropriate icon or tooltip for each label.
Indices MAY also specialize the rendering or presentation of additional labels or URLs, including (but not limited to), labels that start with a well-known label, and URLs that refer to a known service provider domain (e.g. for documentation hosting or issue tracking).
This PEP recognizes that the list of well-known labels is unlikely to remain static, and that subsequent additions to it should not require the overhead associated with a formal PEP process or new metadata version. As such, this PEP proposes that the list above become a “living” list within the PyPA specifications.
This PEP is expected to have little to no impact on existing packaging tooling or package indices:
This PEP does not stipulate or require any future metadata changes.
However, per Metadata producers and Conventions for Project-URL labels, we identify the following potential future goals for a new major release of the core metadata standards:
Home-page and Download-URL in the
next major core metadata version. If removed, package indices and consumers
MUST reject metadata containing these fields when said metadata is of
the new major version.Project-URL labels when generating
distribution metadata, and package indices and consumers MUST reject
distributions containing non-normalized labels. Note: requiring
normalization merely restricts labels to lowercase text, and excludes
whitespace and punctuation. It does NOT restrict project URLs solely to
the use of “well-known” labels.These potential changes would be backwards incompatible, hence their inclusion only in this section. Acceptance of this PEP does NOT commit any future metadata revision to actually making these changes.
This PEP does not identify any positive or negative security implications
associated with deprecating Home-page and Download-URL or with
label normalization.
The changes in this PEP should be transparent to the majority of the packaging ecosystem’s userbase; the primary beneficiaries of this PEP’s changes are packaging tooling authors and index maintainers, who will be able to reduce the number of unique URL fields produced and checked.
A small number of package maintainers may observe new warnings or notifications
from their index of choice, should the index choose to ignore Home-page
and Download-URL as suggested. Similarly, a small number of package
maintainers may observe that their index of choice no longer renders
their URLs, if only present in the deprecated fields. However, no package
maintainers should observe rejected package uploads or other breaking
changes to packaging workflows due to this PEP’s proposed changes.
Anybody who observes warnings or changes to the presentation of URLs on indices can be taught about this PEP’s behavior via official packaging resources, such as the Python Packaging User Guide and PyPI’s user documentation, the latter of which already contains an informal description of PyPI’s URL handling behavior.
If this PEP is accepted, the authors of this PEP will coordinate to update and cross-link the resources mentioned above.
This appendix provides an illustrative excerpt of a distribution’s metadata, before and after index-side processing:
Before:
Project-URL: Home-page, https://example.com Project-URL: Homepage, https://another.example.com Project-URL: Source, https://github.com/example/example Project-URL: GitHub, https://github.com/example/example Project-URL: Another Service, https://custom.example.com
After:
Project-URL: homepage, https://example.com Project-URL: homepage, https://another.example.com Project-URL: source, https://github.com/example/example Project-URL: github, https://github.com/example/example Project-URL: Another Service, https://custom.example.com
In particular, observe:
Home-page and Homepage
become homepage);Source and GitHub are both normalized into their respective forms,
but github is not transformed into source.Another Service is not normalized, since its normal form
(anotherservice) is not a well-known label.This document is placed in the public domain or under the CC0-1.0-Universal license, whichever is more permissive.