Skip to content

Commit 71d702b

Browse files
committed
Cross-link the migrated build specifications and glossary
Link the existing frontend and backend definitions to the interface, and replace normative PEP references with local specification links. Connect backend lookup, dependency specifiers, wheel metadata, and sdist creation without changing the glossary terminology or historical PEP citations. Correct two inherited spellings flagged by codespell. Validation: pixi run build; scoped pre-commit checks; rendered heading hierarchy and 387 links between changed pages; illustrative schema cases. Also compare the unchanged hook signatures, config_settings and invocation text, in-tree restrictions, and build environment recommendations with the imported PEP, accounting for the documented editorial edits.
1 parent 297d78f commit 71d702b

5 files changed

Lines changed: 33 additions & 25 deletions

File tree

‎source/glossary.rst‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Glossary
1919
:term:`built distribution <Built Distribution>` from it.
2020
The build is delegated to the backend by a
2121
:term:`frontend <Build Frontend>`.
22-
All backends offer a standardized interface.
22+
All backends offer a :ref:`standardized interface <build-system-interface>`.
2323

2424
Examples of build backends are
2525
:ref:`flit's flit-core <flit>`,
@@ -40,6 +40,7 @@ Glossary
4040
:term:`build backend <Build Backend>`.
4141

4242
Examples of build frontends are :ref:`pip` and :ref:`build`.
43+
See :ref:`build-system-interface` for the standardized interface they use.
4344

4445

4546
Built Distribution
@@ -207,7 +208,8 @@ Glossary
207208
packaged into a :term:`Distribution <Distribution Package>`.
208209

209210
Since most projects create :term:`Distributions <Distribution Package>`
210-
using either :pep:`518` ``build-system``, :ref:`distutils` or
211+
using either the :ref:`[build-system] table <pyproject-build-system-table>`,
212+
:ref:`distutils` or
211213
:ref:`setuptools`, another practical way to define projects currently
212214
is something that contains a :term:`pyproject.toml`, :term:`setup.py`,
213215
or :term:`setup.cfg` file at the root of the project source directory.
@@ -309,7 +311,7 @@ Glossary
309311
pyproject.toml
310312

311313
The tool-agnostic :term:`Project` specification file.
312-
Defined in :pep:`518`.
314+
Defined in :ref:`pyproject-toml-spec`.
313315

314316
Release
315317

‎source/specifications/binary-distribution-format.rst‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ Wheel distribution format
88
=========================
99

1010
This page specifies the wheel format for Python packages.
11+
The :ref:`build-system-interface` specification describes how wheels are built
12+
from source trees.
1113

1214
A wheel is a ZIP-format archive with a specially formatted file name and
1315
the ``.whl`` extension. It contains a single distribution nearly as it

‎source/specifications/build-system-interface.rst‎

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
Build system interface
55
======================
66

7-
This specification defines a standard interface between build frontends and
8-
build backends to build wheels and source distributions from source trees.
7+
This specification defines a standard interface between
8+
:term:`build frontends <Build Frontend>` and :term:`build backends <Build Backend>`
9+
to build wheels and source distributions from source trees.
910
The project's build system is configured in the
1011
:ref:`[build-system] table <pyproject-build-system-table>` of
1112
:file:`pyproject.toml`.
@@ -85,9 +86,10 @@ avoiding external build dependencies (usually by vendoring them).
8586
Build backend interface
8687
=======================
8788

88-
The build backend object is expected to have attributes which provide
89-
some or all of the following hooks. The common ``config_settings``
90-
argument is described after the individual hooks.
89+
The :ref:`build backend object <pyproject-build-system-build-backend>` is expected
90+
to have attributes which provide some or all of the following hooks. The common
91+
``config_settings`` argument is described in
92+
:ref:`build-system-interface-config-settings`.
9193

9294
Mandatory hooks
9395
---------------
@@ -122,7 +124,8 @@ or else raise an exception when it is set to anything other than ``None``.
122124
To ensure that wheels from different sources are built the same way, frontends
123125
may call ``build_sdist`` first, and then call ``build_wheel`` in the unpacked
124126
sdist. But if the backend indicates that it is missing some requirements for
125-
creating an sdist (see below), the frontend will fall back to calling
127+
creating an sdist (see :ref:`build-system-interface-build-sdist`),
128+
the frontend will fall back to calling
126129
``build_wheel`` in the source directory.
127130

128131
The source directory may be read-only. Backends should therefore be
@@ -176,9 +179,9 @@ get_requires_for_build_wheel
176179
def get_requires_for_build_wheel(config_settings=None):
177180
...
178181

179-
This hook MUST return an additional list of strings containing :pep:`508`
180-
dependency specifications, above and beyond those specified in the
181-
``pyproject.toml`` file, to be installed when calling the ``build_wheel`` or
182+
This hook MUST return an additional list of strings containing
183+
:ref:`dependency specifiers <dependency-specifiers>`, above and beyond those
184+
specified in the ``pyproject.toml`` file, to be installed when calling the ``build_wheel`` or
182185
``prepare_metadata_for_build_wheel`` hooks.
183186

184187
Example::
@@ -202,13 +205,13 @@ Must create a ``.dist-info`` directory containing wheel metadata
202205
inside the specified ``metadata_directory`` (i.e., creates a directory
203206
like ``{metadata_directory}/{package}-{version}.dist-info/``). This
204207
directory MUST be a valid ``.dist-info`` directory as defined in the
205-
wheel specification, except that it need not contain ``RECORD`` or
206-
signatures. The hook MAY also create other files inside this
208+
:ref:`wheel specification <binary-distribution-format>`, except that it need not
209+
contain ``RECORD`` or signatures. The hook MAY also create other files inside this
207210
directory, and a build frontend MUST preserve, but otherwise ignore, such files;
208211
the intention
209212
here is that in cases where the metadata depends on build-time
210213
decisions, the build backend may need to record these decisions in
211-
some convenient format for re-use by the actual wheel-building step.
214+
some convenient format for reuse by the actual wheel-building step.
212215

213216
This must return the basename (not the full path) of the ``.dist-info``
214217
directory it creates, as a unicode string.
@@ -227,9 +230,9 @@ get_requires_for_build_sdist
227230
def get_requires_for_build_sdist(config_settings=None):
228231
...
229232

230-
This hook MUST return an additional list of strings containing :pep:`508`
231-
dependency specifications, above and beyond those specified in the
232-
``pyproject.toml`` file. These dependencies will be installed when calling the
233+
This hook MUST return an additional list of strings containing
234+
:ref:`dependency specifiers <dependency-specifiers>`, above and beyond those
235+
specified in the ``pyproject.toml`` file. These dependencies will be installed when calling the
233236
``build_sdist`` hook.
234237

235238
If not defined, the default implementation is equivalent to ``return []``.
@@ -369,7 +372,7 @@ environment that meets the above criteria. For example, simply
369372
installing all build-requirements into the global environment would be
370373
sufficient to build any compliant package -- but this would be
371374
sub-optimal for a number of reasons. This section contains
372-
non-normative advice to frontend implementors.
375+
non-normative advice to frontend implementers.
373376

374377
A build frontend SHOULD, by default, create an isolated environment
375378
for each build, containing only the standard library and any

‎source/specifications/pyproject-toml.rst‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@ key. Here's an example of how it would look::
9494

9595
``build-backend`` is a string naming a Python object that will be
9696
used to perform the build (see :ref:`build-system-interface` for details).
97-
This is formatted following the same ``module:object`` syntax as a ``setuptools`` entry
98-
point. For instance, if the string is ``"flit.api:main"`` as in the
99-
example above, this object would be looked up by executing the
97+
This is formatted following the same ``module:object`` syntax as an
98+
:ref:`entry point <entry-points>`. For instance, if the string is
99+
``"flit.api:main"`` as in the example above, this object would be looked up by executing the
100100
equivalent of::
101101

102102
import flit.api
@@ -130,8 +130,8 @@ not be affected by this.
130130

131131
If the ``pyproject.toml`` file is absent, or the ``build-backend``
132132
key is missing, the source tree is not using the :ref:`build-system-interface`
133-
specification, and tools should revert to the legacy behaviour of running ``setup.py`` (either
134-
directly, or by implicitly invoking the ``setuptools.build_meta:__legacy__``
133+
specification, and tools should revert to the legacy behaviour of running
134+
``setup.py`` (either directly, or by implicitly invoking the ``setuptools.build_meta:__legacy__``
135135
backend).
136136

137137
Where the ``build-backend`` key exists, this takes precedence and the source tree follows the format and

‎source/specifications/source-distribution-format.rst‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ The name and version components of the filename MUST match the values stored
4747
in the metadata contained in the file.
4848

4949
Code that produces a source distribution file MUST give the file a name that matches
50-
this specification. This includes the ``build_sdist`` hook of a
50+
this specification. This includes the
51+
:ref:`build_sdist <build-system-interface-build-sdist>` hook of a
5152
:term:`build backend <Build Backend>`.
5253

5354
Code that processes source distribution files MAY recognise source distribution files

0 commit comments

Comments
 (0)