Skip to content

Commit

Permalink
Replace PEP references with PUG links (#750)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanas authored Dec 14, 2023
1 parent a2b3e34 commit b271d2b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 20 deletions.
22 changes: 12 additions & 10 deletions docs/markers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ Markers

One extra requirement of dealing with dependencies is the ability to specify
if it is required depending on the operating system or Python version in use.
`PEP 508`_ defines the scheme which has been implemented by this module.
The :ref:`specification of dependency specifiers <pypug:dependency-specifiers>`
defines the scheme which has been implemented by this module.

Usage
-----
Expand Down Expand Up @@ -51,7 +52,7 @@ Reference

This class abstracts handling markers for dependencies of a project. It can
be passed a single marker or multiple markers that are ANDed or ORed
together. Each marker will be parsed according to PEP 508.
together. Each marker will be parsed according to the specification.

:param str markers: The string representation of a marker or markers.
:raises InvalidMarker: If the given ``markers`` are not parseable, then
Expand All @@ -63,28 +64,29 @@ Reference

:param dict environment: A dictionary containing keys and values to
override the detected environment.
:raises: UndefinedComparison: If the marker uses a PEP 440 comparison on
strings which are not valid PEP 440 versions.
:raises: UndefinedComparison: If the marker uses a comparison on strings
which are not valid versions per the
:ref:`specification of version specifiers
<pypug:version-specifiers>`.
:raises: UndefinedEnvironmentName: If the marker accesses a value that
isn't present inside of the environment
dictionary.

.. exception:: InvalidMarker

Raised when attempting to create a :class:`Marker` with a string that
does not conform to PEP 508.
does not conform to the specification.


.. exception:: UndefinedComparison

Raised when attempting to evaluate a :class:`Marker` with a PEP 440
comparison operator against values that are not valid PEP 440 versions.
Raised when attempting to evaluate a :class:`Marker` with a
comparison operator against values that are not valid
versions per the :ref:`specification of version specifiers
<pypug:version-specifiers>`.


.. exception:: UndefinedEnvironmentName

Raised when attempting to evaluate a :class:`Marker` with a value that is
missing from the evaluation environment.


.. _`PEP 508`: https://www.python.org/dev/peps/pep-0508/
15 changes: 7 additions & 8 deletions docs/requirements.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ Requirements
.. currentmodule:: packaging.requirements

Parse a given requirements line for specifying dependencies of a Python
project, using `PEP 508`_ which defines the scheme that has been implemented
by this module.
project, using the :ref:`specification of dependency specifiers
<pypug:dependency-specifiers>`, which defines the scheme that has been
implemented by this module.

Usage
-----
Expand Down Expand Up @@ -60,8 +61,8 @@ Usage

When a requirement is specified with a URL, the :class:`Requirement` class
used to check the URL and reject values containing invalid scheme and
netloc combinations. This is no longer performed since PEP 508 does not
specify such rules, and the check incorrectly disallows valid requirement
netloc combinations. This is no longer performed since the specification does
not have such rules, and the check incorrectly disallows valid requirement
strings from being parsed.

Reference
Expand All @@ -70,7 +71,7 @@ Reference
.. class:: Requirement(requirement)

This class abstracts handling the details of a requirement for a project.
Each requirement will be parsed according to PEP 508.
Each requirement will be parsed according to the specification.

:param str requirement: The string representation of a requirement.
:raises InvalidRequirement: If the given ``requirement`` is not parseable,
Expand Down Expand Up @@ -99,6 +100,4 @@ Reference
.. exception:: InvalidRequirement

Raised when attempting to create a :class:`Requirement` with a string that
does not conform to PEP 508.

.. _`PEP 508`: https://www.python.org/dev/peps/pep-0508/
does not conform to the specification.
4 changes: 2 additions & 2 deletions docs/utils.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ Reference

:param str filename: The name of the wheel file.
:raises InvalidWheelFilename: If the filename in question
does not follow conventions outlined in `PEP 427`_.
does not follow the :ref:`wheel specification
<pypug:binary-distribution-format>`.

.. doctest::

Expand Down Expand Up @@ -137,4 +138,3 @@ Reference
Raised when a source distribution file name is considered invalid.

.. _Source distribution format: https://packaging.python.org/specifications/source-distribution-format/#source-distribution-file-name
.. _`PEP 427`: https://peps.python.org/pep-0427/#file-name-convention

0 comments on commit b271d2b

Please sign in to comment.