Skip to content

Commit 68d342c

Browse files
committed
simple-repository-api: clean up PEP 658/PEP 714 bits
Signed-off-by: William Woodruff <[email protected]>
1 parent c07b39a commit 68d342c

File tree

1 file changed

+33
-43
lines changed

1 file changed

+33
-43
lines changed

source/specifications/simple-repository-api.rst

Lines changed: 33 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,26 @@ In addition to the above, the following constraints are placed on the API:
8888
associated signature, the signature would be located at
8989
``/packages/HolyGrail-1.0.tar.gz.asc``.
9090

91+
* A repository **MAY** include a ``data-core-metadata`` attribute on a file
92+
link.
93+
94+
The repository **SHOULD** provide the hash of the Core Metadata file as the
95+
``data-core-metadata`` attribute's value using the syntax
96+
``<hashname>=<hashvalue>``, where ``<hashname>`` is the lower cased name of
97+
the hash function used, and ``<hashvalue>`` is the hex encoded digest. The
98+
repository **MAY** use ``true`` as the attribute's value if a hash is unavailable.
99+
100+
* A repository **MAY** include a ``data-dist-info-metadata`` attribute on a
101+
file link.
102+
103+
Index clients **MAY** consume this key if present, as a legacy fallback
104+
for ``data-core-metadata``.
105+
106+
.. important::
107+
108+
``data-dist-info-metadata`` was standardized with :pep:`658` and renamed to
109+
``data-core-metadata`` with :pep:`714`.
110+
91111
* A repository **MAY** include a ``data-gpg-sig`` attribute on a file link with
92112
a value of either ``true`` or ``false`` to indicate whether or not there is a
93113
GPG signature. Repositories that do this **SHOULD** include it on every link.
@@ -523,7 +543,7 @@ Each individual file dictionary has the following keys:
523543
Unlike ``data-requires-python`` in :ref:`the base HTML API specification
524544
<simple-repository-api-base>`, the ``requires-python`` key does not
525545
require any special escaping other than anything JSON does naturally.
526-
- ``dist-info-metadata``: An **optional** key that indicates
546+
- ``core-metadata``: An **optional** key that indicates
527547
that metadata for this file is available, via the same location as specified in
528548
:ref:`the API metadata file specification
529549
<simple-repository-api-metadata-file>` (``{file_url}.metadata``). Where this
@@ -541,11 +561,23 @@ Each individual file dictionary has the following keys:
541561

542562
It is recommended that servers make the hashes of the metadata file available if
543563
possible.
564+
565+
- ``dist-info-metadata``: An **optional**, deprecated alias for ``core-metadata``.
566+
567+
Index clients **MAY** consume this key if present, as a legacy fallback
568+
for ``core-metadata``.
569+
570+
.. important::
571+
572+
``dist-info-metadata`` was standardized with :pep:`658` and renamed to
573+
``core-metadata`` with :pep:`714`.
574+
544575
- ``gpg-sig``: An **optional** key that acts a boolean to indicate if the file has
545576
an associated GPG signature or not. The URL for the signature file follows what
546577
is specified in :ref:`the base HTML API specification
547578
<simple-repository-api-base>` (``{file_url}.asc``). If this key does not exist, then
548579
the signature may or may not exist.
580+
549581
- ``yanked``: An **optional** key which may be either a boolean to indicate if the
550582
file has been yanked, or a non empty, but otherwise arbitrary, string to indicate
551583
that a file has been yanked with a specific reason. If the ``yanked`` key is present
@@ -955,48 +987,6 @@ It is recommended that clients:
955987
- Check the ``Content-Type`` of the response and ensure it matches something
956988
that you were expecting.
957989

958-
959-
Rename dist-info-metadata in the Simple API
960-
===========================================
961-
962-
Servers
963-
-------
964-
965-
The :ref:`the API metadata file specification
966-
<simple-repository-api-metadata-file>` metadata, when used in the HTML
967-
representation of the Simple API,
968-
**MUST** be emitted using the attribute name ``data-core-metadata``, with the
969-
supported values remaining the same.
970-
971-
The :ref:`the API metadata file specification
972-
<simple-repository-api-metadata-file>` metadata, when used in the :ref:`the
973-
JSON API specification <simple-repository-api-base>` JSON representation of the
974-
Simple API, **MUST** be emitted using the key ``core-metadata``, with the
975-
supported values remaining the same.
976-
977-
To support clients that used the previous key names, the HTML representation
978-
**MAY** also be emitted using the ``data-dist-info-metadata``, and if it does
979-
so it **MUST** match the value of ``data-core-metadata``.
980-
981-
982-
983-
Clients
984-
-------
985-
986-
Clients consuming any of the HTML representations of the Simple API **MUST**
987-
read the :ref:`the API metadata file specification
988-
<simple-repository-api-metadata-file>` metadata from the key
989-
``data-core-metadata`` if it is
990-
present. They **MAY** optionally use the legacy ``data-dist-info-metadata`` if
991-
it is present but ``data-core-metadata`` is not.
992-
993-
Clients consuming the JSON representation of the Simple API **MUST** read the
994-
:ref:`the API metadata file specification
995-
<simple-repository-api-metadata-file>` metadata from the key ``core-metadata``
996-
if it is present. They
997-
**MAY** optionally use the legacy ``dist-info-metadata`` key if it is present
998-
but ``core-metadata`` is not.
999-
1000990
.. _simple-repository-history:
1001991

1002992
History

0 commit comments

Comments
 (0)