Skip to content

Commit 5cc1cce

Browse files
authored
Merge pull request #1488 from edgarrmondragon/edgarrmondragon/intersphinx-hashlib-direct-url
Use intersphinx to link to `hashlib` docs
2 parents 8698fda + 177b5db commit 5cc1cce

File tree

4 files changed

+9
-10
lines changed

4 files changed

+9
-10
lines changed

source/specifications/direct-url-data-structure.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,10 @@ MUST be present as a dictionary with the following keys:
7979

8080
These hash names SHOULD always be normalized to be lowercase.
8181

82-
Any hash algorithm available via ``hashlib`` (specifically any that can be passed to
83-
``hashlib.new()`` and do not require additional parameters) can be used as a key for
82+
Any hash algorithm available via :py:mod:`hashlib` (specifically any that can be passed to
83+
:py:func:`hashlib.new()` and do not require additional parameters) can be used as a key for
8484
the hashes dictionary. At least one secure algorithm from
85-
``hashlib.algorithms_guaranteed`` SHOULD always be included. At time of writing,
85+
:py:data:`hashlib.algorithms_guaranteed` SHOULD always be included. At time of writing,
8686
``sha256`` specifically is recommended.
8787

8888
- A deprecated ``hash`` key (type ``string``) MAY be present for backwards compatibility

source/specifications/recording-installed-packages.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ On Windows, directories may be separated either by forward- or backslashes
112112
(``/`` or ``\``).
113113

114114
The *hash* is either an empty string or the name of a hash algorithm from
115-
``hashlib.algorithms_guaranteed``, followed by the equals character ``=`` and
115+
:py:data:`hashlib.algorithms_guaranteed`, followed by the equals character ``=`` and
116116
the digest of the file's contents, encoded with the urlsafe-base64-nopad
117117
encoding (``base64.urlsafe_b64encode(digest)`` with trailing ``=`` removed).
118118

source/specifications/simple-repository-api.rst

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ In addition to the above, the following constraints are placed on the API:
7171
URL.
7272

7373
* Repositories **SHOULD** choose a hash function from one of the ones
74-
guaranteed to be available via the ``hashlib`` module in the Python standard
74+
guaranteed to be available via the :py:mod:`hashlib` module in the Python standard
7575
library (currently ``md5``, ``sha1``, ``sha224``, ``sha256``, ``sha384``,
7676
``sha512``). The current recommendation is to use ``sha256``.
7777

@@ -452,11 +452,10 @@ Each individual file dictionary has the following keys:
452452
for the file, however it is **HIGHLY** recommended that at least one secure,
453453
guaranteed-to-be-available hash is always included.
454454

455-
By default, any hash algorithm available via `hashlib
456-
<https://docs.python.org/3/library/hashlib.html>`_ (specifically any that can
457-
be passed to ``hashlib.new()`` and do not require additional parameters) can
455+
By default, any hash algorithm available via :py:mod:`hashlib` (specifically any that can
456+
be passed to :py:func:`hashlib.new()` and do not require additional parameters) can
458457
be used as a key for the hashes dictionary. At least one secure algorithm from
459-
``hashlib.algorithms_guaranteed`` **SHOULD** always be included. At the time
458+
:py:data:`hashlib.algorithms_guaranteed` **SHOULD** always be included. At the time
460459
of this spec, ``sha256`` specifically is recommended.
461460
- ``requires-python``: An **optional** key that exposes the
462461
:ref:`core-metadata-requires-python`

source/specifications/version-specifiers.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1113,7 +1113,7 @@ and MAY refuse to rely on the URL. If such a direct reference also uses an
11131113
insecure transport, automated tools SHOULD NOT rely on the URL.
11141114

11151115
It is RECOMMENDED that only hashes which are unconditionally provided by
1116-
the latest version of the standard library's ``hashlib`` module be used
1116+
the latest version of the standard library's :py:mod:`hashlib` module be used
11171117
for source archive hashes. At time of writing, that list consists of
11181118
``'md5'``, ``'sha1'``, ``'sha224'``, ``'sha256'``, ``'sha384'``, and
11191119
``'sha512'``.

0 commit comments

Comments
 (0)