44Build 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.
910The 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).
8586Build 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
9294Mandatory hooks
9395---------------
@@ -122,7 +124,8 @@ or else raise an exception when it is set to anything other than ``None``.
122124To ensure that wheels from different sources are built the same way, frontends
123125may call ``build_sdist `` first, and then call ``build_wheel `` in the unpacked
124126sdist. 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
128131The 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
184187Example::
@@ -202,13 +205,13 @@ Must create a ``.dist-info`` directory containing wheel metadata
202205inside the specified ``metadata_directory `` (i.e., creates a directory
203206like ``{metadata_directory}/{package}-{version}.dist-info/ ``). This
204207directory 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
207210directory, and a build frontend MUST preserve, but otherwise ignore, such files;
208211the intention
209212here is that in cases where the metadata depends on build-time
210213decisions, 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
213216This must return the basename (not the full path) of the ``.dist-info ``
214217directory 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
235238If not defined, the default implementation is equivalent to ``return [] ``.
@@ -369,7 +372,7 @@ environment that meets the above criteria. For example, simply
369372installing all build-requirements into the global environment would be
370373sufficient to build any compliant package -- but this would be
371374sub-optimal for a number of reasons. This section contains
372- non-normative advice to frontend implementors .
375+ non-normative advice to frontend implementers .
373376
374377A build frontend SHOULD, by default, create an isolated environment
375378for each build, containing only the standard library and any
0 commit comments