Skip to content

Commit 367e5e8

Browse files
committed
Update references to PEP 440
1 parent 085a016 commit 367e5e8

9 files changed

+45
-36
lines changed

source/glossary.rst

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -222,11 +222,10 @@ Glossary
222222
Version Specifier
223223

224224
The version component of a :term:`Requirement Specifier`. For example,
225-
the ">=1.3" portion of "foo>=1.3". :pep:`440` contains
226-
a :pep:`full specification
227-
<440#version-specifiers>` of the
228-
specifiers that Python packaging currently supports. Support for PEP440
229-
was implemented in :ref:`setuptools` v8.0 and :ref:`pip` v6.0.
225+
the ">=1.3" portion of "foo>=1.3". Read the :ref:`Version specifier specification
226+
<version-specifiers>` for a full description of the
227+
specifiers that Python packaging currently supports. Support for this
228+
specification was implemented in :ref:`setuptools` v8.0 and :ref:`pip` v6.0.
230229

231230
Virtual Environment
232231

source/specifications/binary-distribution-format.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,8 @@ this character cannot appear within any component. This is handled as follows:
182182
Tools consuming wheels must be prepared to accept ``.`` (FULL STOP) and
183183
uppercase letters, however, as these were allowed by an earlier version of
184184
this specification.
185-
- Version numbers should be normalised according to :pep:`440`. Normalised
186-
version numbers cannot contain ``-``.
185+
- Version numbers should be normalised according to the :ref:`Version specifier
186+
specification <version-specifiers>`. Normalised version numbers cannot contain ``-``.
187187
- The remaining components may not contain ``-`` characters, so no escaping
188188
is necessary.
189189

source/specifications/core-metadata.rst

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,9 @@ Version of the file format; legal values are "1.0", "1.1", "1.2", "2.1",
5353
Automated tools consuming metadata SHOULD warn if ``metadata_version`` is
5454
greater than the highest version they support, and MUST fail if
5555
``metadata_version`` has a greater major version than the highest
56-
version they support (as described in :pep:`440`, the major version is the
57-
value before the first dot).
56+
version they support (as described in the
57+
:ref:`Version specifier specification <version-specifiers>`,
58+
the major version is the value before the first dot).
5859

5960
For broader compatibility, build tools MAY choose to produce
6061
distribution metadata using the lowest metadata version that includes
@@ -96,7 +97,8 @@ Version
9697
.. versionadded:: 1.0
9798

9899
A string containing the distribution's version number. This
99-
field must be in the format specified in :pep:`440`.
100+
field must be in the format specified in the
101+
:ref:`Version specifier specification <version-specifiers>`.
100102

101103
Example::
102104

@@ -587,8 +589,8 @@ This field may be followed by an environment marker after a semicolon.
587589

588590
Because they refer to non-Python software releases, version numbers
589591
for this field are **not** required to conform to the format
590-
specified in :pep:`440`: they should correspond to the
591-
version scheme used by the external dependency.
592+
specified in the :ref:`Version specifier specification <version-specifiers>`:
593+
they should correspond to the version scheme used by the external dependency.
592594

593595
Notice that there is no particular rule on the strings to be used.
594596

source/specifications/declaring-project-metadata.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ as it is read for internal consistency.
8787
- Corresponding :ref:`core metadata <core-metadata>` field:
8888
:ref:`Version <core-metadata-version>`
8989

90-
The version of the project as supported by :pep:`440`.
90+
The version of the project, as defined in the
91+
:ref:`Version specifier specification <version-specifiers>`.
9192

9293
Users SHOULD prefer to specify already-normalized versions.
9394

source/specifications/dependency-specifiers.rst

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ acceptable, so the language permits describing all these cases.
1616
The language defined is a compact line based format which is already in
1717
widespread use in pip requirements files, though we do not specify the command
1818
line option handling that those files permit. There is one caveat - the
19-
URL reference form, specified in :pep:`440` is not actually
20-
implemented in pip, but since :pep:`440` is accepted, we use that format rather
19+
URL reference form, specified in :ref:`Versioning specifier specification <version-specifiers>`
20+
is not actually implemented in pip, but we use that format rather
2121
than pip's current native format.
2222

2323
Specification
@@ -57,7 +57,8 @@ as comments, multiple line support via continuations, or other such features.
5757
The full grammar including annotations to build a useful parse tree is
5858
included at the end of this document.
5959

60-
Versions may be specified according to the :pep:`440` rules. (Note:
60+
Versions may be specified according to the rules of the
61+
:ref:`Version specifier specification <version-specifiers>`. (Note:
6162
URI is defined in :rfc:`std-66 <3986>`)::
6263

6364
version_cmp = wsp* '<' | '<=' | '!=' | '==' | '>=' | '>' | '~=' | '==='
@@ -159,12 +160,13 @@ If multiple extras are listed, all the dependencies are unioned together.
159160
Versions
160161
--------
161162

162-
See :pep:`440` for more detail on both version numbers and version
163-
comparisons. Version specifications limit the versions of a distribution that
164-
can be used. They only apply to distributions looked up by name, rather than
163+
See the :ref:`Version specifier specification <version-specifiers>` for
164+
more detail on both version numbers and version comparisons. Version
165+
specifications limit the versions of a distribution that can be
166+
used. They only apply to distributions looked up by name, rather than
165167
via a URL. Version comparison are also used in the markers feature. The
166-
optional brackets around a version are present for compatibility with :pep:`345`
167-
but should not be generated, only accepted.
168+
optional brackets around a version are present for compatibility with
169+
:pep:`345` but should not be generated, only accepted.
168170

169171
Environment Markers
170172
-------------------
@@ -186,10 +188,11 @@ fixes some issues that were observed in the design described in :pep:`426`.
186188

187189
Comparisons in marker expressions are typed by the comparison operator. The
188190
<marker_op> operators that are not in <version_cmp> perform the same as they
189-
do for strings in Python. The <version_cmp> operators use the :pep:`440`
190-
version comparison rules when those are defined (that is when both
191-
sides have a valid version specifier). If there is no defined :pep:`440`
192-
behaviour and the operator exists in Python, then the operator falls back to
191+
do for strings in Python. The <version_cmp> operators use the version comparison
192+
rules of the :ref:`Version specifier specification <version-specifiers>`
193+
when those are defined (that is when both sides have a valid
194+
version specifier). If there is no defined behaviour of this specification
195+
and the operator exists in Python, then the operator falls back to
193196
the Python behaviour. Otherwise an error should be raised. e.g. the following
194197
will result in errors::
195198

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ source trees, source distributions and wheels.
1111

1212
The representation of the components of this data structure as a :rfc:`1738` URL
1313
is not formally specified at time of writing. A common representation is the pip URL
14-
format. Other examples are provided in :pep:`440`.
14+
format. Other examples are provided in the :ref:`Version specifier specification <version-specifiers>`.
1515

1616
.. contents:: Contents
1717
:local:

source/specifications/recording-installed-packages.rst

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,11 @@ packages (commonly, the ``site-packages`` directory).
4242

4343
This directory is named as ``{name}-{version}.dist-info``, with ``name`` and
4444
``version`` fields corresponding to :ref:`core-metadata`. Both fields must be
45-
normalized (see :ref:`name-normalization` and
46-
:pep:`PEP 440 <440#normalization>` for the definition of normalization for
47-
each field respectively), and replace dash (``-``) characters with
48-
underscore (``_``) characters, so the ``.dist-info`` directory always has
49-
exactly one dash (``-``) character in its stem, separating the ``name`` and
50-
``version`` fields.
45+
normalized (see the :ref:`name normalization specification <name-normalization>`
46+
and the :ref:`version normalization specification <version-specifiers-normalization>`),
47+
and replace dash (``-``) characters with underscore (``_``) characters,
48+
so the ``.dist-info`` directory always has exactly one dash (``-``) character in
49+
its stem, separating the ``name`` and ``version`` fields.
5150

5251
Historically, tools have failed to replace dot characters or normalize case in
5352
the ``name`` field, or not perform normalization in the ``version`` field.

source/specifications/version-specifiers.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,9 @@ from an earlier epoch::
385385
1!1.1
386386
1!2.0
387387

388+
389+
.. _version-specifiers-normalization:
390+
388391
Normalization
389392
-------------
390393

@@ -805,6 +808,8 @@ entirely when checking if candidate versions match a given version
805808
specifier.
806809

807810

811+
.. _version-specifiers-compatible-release:
812+
808813
Compatible release
809814
------------------
810815

source/tutorials/installing-packages.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -308,9 +308,9 @@ The most common usage of :ref:`pip` is to install from the :term:`Python Package
308308
Index <Python Package Index (PyPI)>` using a :term:`requirement specifier
309309
<Requirement Specifier>`. Generally speaking, a requirement specifier is
310310
composed of a project name followed by an optional :term:`version specifier
311-
<Version Specifier>`. :pep:`440` contains a :pep:`full
312-
specification <440#version-specifiers>`
313-
of the currently supported specifiers. Below are some examples.
311+
<Version Specifier>`. A full description of the supported specifiers can be
312+
found in the :ref:`Version specifier specification <version-specifiers>`.
313+
Below are some examples.
314314

315315
To install the latest version of "SomeProject":
316316

@@ -355,7 +355,7 @@ To install greater than or equal to one version and less than another:
355355
py -m pip install "SomeProject>=1,<2"
356356
357357
358-
To install a version that's :pep:`"compatible" <440#compatible-release>`
358+
To install a version that's :ref:`compatible <version-specifiers-compatible-release>`
359359
with a certain version: [4]_
360360

361361
.. tab:: Unix/macOS

0 commit comments

Comments
 (0)