From b96c506f593f9ea6a65afd7b00a31a6c00552744 Mon Sep 17 00:00:00 2001 From: Jean Abou Samra Date: Fri, 17 Nov 2023 23:00:17 +0100 Subject: [PATCH] Replace some PEP references with internal references Use internal references when the PEPs have been imported into the PUG. --- .../discussions/deploying-python-applications.rst | 3 ++- source/glossary.rst | 14 ++++++++------ source/guides/packaging-namespace-packages.rst | 11 ++++++----- source/guides/writing-pyproject-toml.rst | 1 + source/key_projects.rst | 6 +++--- source/specifications/entry-points.rst | 3 ++- source/specifications/pyproject-toml.rst | 12 ++++++------ 7 files changed, 28 insertions(+), 22 deletions(-) diff --git a/source/discussions/deploying-python-applications.rst b/source/discussions/deploying-python-applications.rst index 19ecd398e..0babd047c 100644 --- a/source/discussions/deploying-python-applications.rst +++ b/source/discussions/deploying-python-applications.rst @@ -119,7 +119,8 @@ pex `pex `__ is a library for generating .pex (Python EXecutable) files which are executable Python environments in the -spirit of virtualenvs. pex is an expansion upon the ideas outlined in :pep:`441` +spirit of virtualenvs. pex is an expansion upon the ideas +found in :doc:`zipapps ` and makes the deployment of Python applications as simple as cp. pex files may even include multiple platform-specific Python distributions, meaning that a single pex file can be portable across Linux and macOS. pex is released under the diff --git a/source/glossary.rst b/source/glossary.rst index f9f2abc29..2220408e8 100644 --- a/source/glossary.rst +++ b/source/glossary.rst @@ -130,11 +130,13 @@ Glossary or other resources, or some combination thereof that is intended to be packaged into a :term:`Distribution `. - Since most projects create :term:`Distributions ` - using either :pep:`518` ``build-system``, :ref:`distutils` or - :ref:`setuptools`, another practical way to define projects currently - is something that contains a :term:`pyproject.toml`, :term:`setup.py`, - or :term:`setup.cfg` file at the root of the project source directory. + Since projects create :term:`Distributions ` using + a :term:`build backend` specified in the :ref:`[build-system] table + ` of their ``pyproject.toml`` file + (or with the deprecated practice of having a ``setup.py`` without an + accompanying ``pyproject.toml``), another practical way to define + projects currently is something that contains a :term:`pyproject.toml` + or :term:`setup.py` file at the root of the project source directory. Python projects must have unique names, which are registered on :term:`PyPI `. Each project will then @@ -182,7 +184,7 @@ Glossary pyproject.toml The tool-agnostic :term:`Project` specification file. - Defined in :pep:`518`. + See :ref:`writing-pyproject-toml`. Release diff --git a/source/guides/packaging-namespace-packages.rst b/source/guides/packaging-namespace-packages.rst index 548020239..e960ca1c5 100644 --- a/source/guides/packaging-namespace-packages.rst +++ b/source/guides/packaging-namespace-packages.rst @@ -62,8 +62,8 @@ Creating a namespace package There are currently two different approaches to creating namespace packages, from which the latter is discouraged: -#. Use `native namespace packages`_. This type of namespace package is defined - in :pep:`420` and is available in Python 3.3 and later. This is recommended if +#. Use `native namespace packages`_. This type of namespace package + is available in Python 3.3 and later. This is recommended if packages in your namespace only ever need to support Python 3 and installation via ``pip``. #. Use `legacy namespace packages`_. This comprises `pkgutil-style namespace packages`_ @@ -72,8 +72,9 @@ from which the latter is discouraged: Native namespace packages ------------------------- -Python 3.3 added **implicit** namespace packages from :pep:`420`. All that is -required to create a native namespace package is that you just omit +Python 3.3 added **implicit** namespace packages +(documented in :doc:`python:reference/import`). +All that is required to create a native namespace package is that you just omit :file:`__init__.py` from the namespace package directory. An example file structure (following :ref:`src-layout `): @@ -155,7 +156,7 @@ the `native namespace package example project`_. Legacy namespace packages ------------------------- -These two methods, that were used to create namespace packages prior to :pep:`420`, +These two methods, that were used to create namespace packages prior to Python 3.3, are now considered to be obsolete and should not be used unless you need compatibility with packages already using this method. Also, :doc:`pkg_resources ` has been deprecated. diff --git a/source/guides/writing-pyproject-toml.rst b/source/guides/writing-pyproject-toml.rst index 41456da08..7fe1ddd3f 100644 --- a/source/guides/writing-pyproject-toml.rst +++ b/source/guides/writing-pyproject-toml.rst @@ -40,6 +40,7 @@ three possible TOML tables in this file. :ref:`setup-py-deprecated`. +.. _pyproject-guide-build-system-table: Declaring the build backend =========================== diff --git a/source/key_projects.rst b/source/key_projects.rst index 671675641..8af3c4de1 100644 --- a/source/key_projects.rst +++ b/source/key_projects.rst @@ -102,7 +102,7 @@ not only provides features that plain :ref:`distutils` doesn't offer also provides a consistent build interface and feature set across all supported Python versions. -Consequently, :ref:`distutils` was deprecated in Python 3.10 by :pep:`632` and +Consequently, :ref:`distutils` was deprecated in Python 3.10 (by :pep:`632`) and has been :doc:`removed ` from the standard library in Python 3.12. Setuptools bundles the standalone copy of distutils, and it is injected even on Python < 3.12 if you import setuptools first or use pip. @@ -523,7 +523,7 @@ pdm `PyPI `__ PDM is a modern Python package manager. It uses :term:`pyproject.toml` to store -project metadata as defined in :pep:`621`. +project metadata in the :ref:`[project] table `. .. _pex: @@ -665,7 +665,7 @@ shiv `PyPI `__ shiv is a command line utility for building fully self contained -Python zipapps as outlined in :pep:`441`, but with all their +Python :doc:`zipapps `, with all their dependencies included. Its primary goal is making distributing Python applications and command line tools fast & easy. diff --git a/source/specifications/entry-points.rst b/source/specifications/entry-points.rst index a11f3ca93..1c0edacfe 100644 --- a/source/specifications/entry-points.rst +++ b/source/specifications/entry-points.rst @@ -106,7 +106,8 @@ Within a value, readers must accept and ignore spaces (including multiple consecutive spaces) before or after the colon, between the object reference and the left square bracket, between the extra names and the square brackets and colons delimiting them, and after the right square bracket. The syntax for -extras is formally specified as part of :pep:`508` (as ``extras``) and +extras is formally specified in the :ref:`dependency specifier specification +` (as ``extras``) and restrictions on values specified in :pep:`685`. For tools writing the file, it is recommended only to insert a space between the object reference and the left square bracket. diff --git a/source/specifications/pyproject-toml.rst b/source/specifications/pyproject-toml.rst index 21cd2340d..7a8946760 100644 --- a/source/specifications/pyproject-toml.rst +++ b/source/specifications/pyproject-toml.rst @@ -352,9 +352,8 @@ be ambiguous in the face of ``[project.scripts]`` and ``dependencies``/``optional-dependencies`` ------------------------------------------ -- TOML_ type: Array of :pep:`508` strings (``dependencies``), and a - table with values of arrays of :pep:`508` strings - (``optional-dependencies``) +- TOML_ type: Array of strings (``dependencies``), and a + table with values of arrays of strings (``optional-dependencies``) - Corresponding :ref:`core metadata ` field: :ref:`Requires-Dist ` and :ref:`Provides-Extra ` @@ -363,12 +362,13 @@ The (optional) dependencies of the project. For ``dependencies``, it is a key whose value is an array of strings. Each string represents a dependency of the project and MUST be -formatted as a valid :pep:`508` string. Each string maps directly to -a :ref:`Requires-Dist ` entry. +formatted as a valid :ref:`dependency specifier `. +Each string maps directly to a :ref:`Requires-Dist ` entry. For ``optional-dependencies``, it is a table where each key specifies an extra and whose value is an array of strings. The strings of the -arrays must be valid :pep:`508` strings. The keys MUST be valid values +arrays must be valid :ref:`dependency specifiers `. +The keys MUST be valid values for :ref:`Provides-Extra `. Each value in the array thus becomes a corresponding :ref:`Requires-Dist ` entry for the