Skip to content

Commit ca4d4e3

Browse files
committed
PEP 517: Final editing to fit the PUG
1 parent 0375ae1 commit ca4d4e3

File tree

1 file changed

+31
-23
lines changed

1 file changed

+31
-23
lines changed

source/specifications/build-system-interface.rst

+31-23
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.. _build-system-interface:
2+
13
======================
24
Build system interface
35
======================
@@ -6,6 +8,11 @@ This specifications describes a standardized interface for installation
68
tools like ``pip`` to interact with package source trees and source
79
distributions.
810

11+
The project's chosen build system is read from the :ref:`[build-system]
12+
table <pyproject-build-system-table>` of the ``pyproject.toml`` file.
13+
The ``requires`` key defines the build requirements and the
14+
``build-backend`` key specifies a build backend object to use.
15+
916

1017
Terminology
1118
===========
@@ -27,9 +34,10 @@ lxml==2.4.0``, pip is acting as an integration frontend.
2734
Build requirements
2835
==================
2936

30-
This PEP places a number of additional requirements on the "build requirements"
31-
section of ``pyproject.toml``. These are intended to ensure that projects do
32-
not create impossible to satisfy conditions with their build requirements.
37+
This specification places a number of requirements on the ``requires``
38+
key from the ``[build-system]`` section of ``pyproject.toml``. These are
39+
intended to ensure that projects do not create impossible to satisfy
40+
conditions with their build requirements.
3341

3442
- Project build requirements will define a directed graph of requirements
3543
(project A needs B to build, B needs C and D, etc.) This graph MUST NOT
@@ -53,9 +61,11 @@ avoiding external build dependencies (usually by vendoring them).
5361
Build backend interface
5462
========================
5563

56-
The build backend object is expected to have attributes which provide
57-
some or all of the following hooks. The common ``config_settings``
58-
argument is described after the individual hooks.
64+
The build backend object is looked up according to the ``build-backend``
65+
field of the ``[build-system]`` table. It is expected to have attributes
66+
which provide some or all of the following hooks. The common
67+
``config_settings`` argument is described after the individual hooks.
68+
5969

6070
Mandatory hooks
6171
---------------
@@ -124,6 +134,8 @@ for a wheel, it should fall back to building a wheel directly.
124134
The backend does not need to define this exception type if it would never raise
125135
it.
126136

137+
138+
127139
Optional hooks
128140
--------------
129141

@@ -135,9 +147,10 @@ get_requires_for_build_wheel
135147
def get_requires_for_build_wheel(config_settings=None):
136148
...
137149

138-
This hook MUST return an additional list of strings containing :pep:`508`
139-
dependency specifications, above and beyond those specified in the
140-
``pyproject.toml`` file, to be installed when calling the ``build_wheel`` or
150+
This hook MUST return an additional list of strings containing
151+
:ref:`dependency specifiers <dependency-specifiers>`, above and
152+
beyond those specified in the ``pyproject.toml`` file, to be
153+
installed when calling the ``build_wheel`` or
141154
``prepare_metadata_for_build_wheel`` hooks.
142155

143156
Example::
@@ -165,7 +178,7 @@ directory, and a build frontend MUST preserve, but otherwise ignore, such files;
165178
the intention
166179
here is that in cases where the metadata depends on build-time
167180
decisions, the build backend may need to record these decisions in
168-
some convenient format for re-use by the actual wheel-building step.
181+
some convenient format for reuse by the actual wheel-building step.
169182

170183
This must return the basename (not the full path) of the ``.dist-info``
171184
directory it creates, as a unicode string.
@@ -190,16 +203,8 @@ dependency specifications, above and beyond those specified in the
190203
If not defined, the default implementation is equivalent to ``return []``.
191204

192205

193-
.. note:: Editable installs
206+
.. todo:: Import :pep:`660` (editable installs) here.
194207

195-
This PEP originally specified another hook, ``install_editable``, to do an
196-
editable install (as with ``pip install -e``). It was removed due to the
197-
complexity of the topic, but may be specified in a later PEP.
198-
199-
Briefly, the questions to be answered include: what reasonable ways existing
200-
of implementing an 'editable install'? Should the backend or the frontend
201-
pick how to make an editable install? And if the frontend does, what does it
202-
need from the backend to do so.
203208

204209
Config settings
205210
---------------
@@ -327,7 +332,7 @@ environment that meets the above criteria. For example, simply
327332
installing all build-requirements into the global environment would be
328333
sufficient to build any compliant package -- but this would be
329334
sub-optimal for a number of reasons. This section contains
330-
non-normative advice to frontend implementors.
335+
non-normative advice to frontend implementers.
331336

332337
A build frontend SHOULD, by default, create an isolated environment
333338
for each build, containing only the standard library and any
@@ -421,13 +426,16 @@ the locations in ``backend-path``.
421426
History
422427
=======
423428

424-
The following changes were made to this PEP after the initial reference
429+
This specification was originally proposed and approved as :pep:`517`.
430+
431+
The following changes were made to this specification after the initial reference
425432
implementation was released in pip 19.0.
426433

427434
* Cycles in build requirements were explicitly prohibited.
428435
* Support for in-tree backends and self-hosting of backends was added by
429436
the introduction of the ``backend-path`` key in the ``[build-system]``
430437
table.
431-
* Clarified that the ``setuptools.build_meta:__legacy__`` :pep:`517` backend is
438+
* Clarified that the ``setuptools.build_meta:__legacy__`` backend is
432439
an acceptable alternative to directly invoking ``setup.py`` for source trees
433-
that don't specify ``build-backend`` explicitly.
440+
that don't specify ``build-backend`` explicitly. (This clarification
441+
is now in the :ref:`pyproject.toml specification <pyproject-toml-spec>`.)

0 commit comments

Comments
 (0)