Skip to content

Commit b78a63b

Browse files
authored
Merge pull request #1329 from sinoroc/add-glossary-build-backend-frontend
Add build backend and frontend to the glossary
2 parents 870a1bc + 1cc4e2c commit b78a63b

File tree

6 files changed

+43
-9
lines changed

6 files changed

+43
-9
lines changed

source/flow.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,12 @@ For example, here is a table for using :ref:`hatch`:
8282
requires = ["hatchling"]
8383
build-backend = "hatchling.build"
8484
85-
With such a table in the :file:`pyproject.toml` file, a "frontend" tool like
86-
:ref:`build` can run your chosen build tool's "backend" to create the build
87-
artifacts. Your build tool may also provide its own frontend. An install tool
85+
With such a table in the :file:`pyproject.toml` file,
86+
a ":term:`frontend <Build Frontend>`" tool like
87+
:ref:`build` can run your chosen
88+
build tool's ":term:`backend <Build Backend>`"
89+
to create the build artifacts.
90+
Your build tool may also provide its own frontend. An install tool
8891
like :ref:`pip` also acts as a frontend when it runs your build tool's backend
8992
to install from a source distribution.
9093

source/glossary.rst

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,36 @@ Glossary
1212
extensions.
1313

1414

15+
Build Backend
16+
17+
A library that takes a source tree or
18+
:term:`source distribution <Source Distribution (or "sdist")>`
19+
and builds a source distribution or :term:`wheel <Wheel>` from it.
20+
The build is delegated to the backend by a
21+
:term:`frontend <Build Frontend>`.
22+
All backends offer a standardized interface.
23+
24+
Examples of build backends are
25+
:ref:`flit's flit-core <flit>`,
26+
:ref:`hatch's hatchling <hatch>`,
27+
:ref:`maturin`,
28+
:ref:`meson-python`,
29+
:ref:`scikit-build-core`,
30+
and :ref:`setuptools`.
31+
32+
33+
Build Frontend
34+
35+
A tool that users might run
36+
that takes arbitrary source trees or
37+
:term:`source distributions <Source Distribution (or "sdist")>`
38+
and builds source distributions or :term:`wheels <Wheel>` from them.
39+
The actual building is delegated to each source tree's
40+
:term:`build backend <Build Backend>`.
41+
42+
Examples of build frontends are :ref:`pip` and :ref:`build`.
43+
44+
1545
Built Distribution
1646

1747
A :term:`Distribution <Distribution Package>` format containing files

source/key_projects.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ hatch
140140

141141
Hatch is a unified command-line tool meant to conveniently manage
142142
dependencies and environment isolation for Python developers. Python
143-
package developers use Hatch and its build backend Hatchling to
143+
package developers use Hatch and its :term:`build backend <Build Backend>` Hatchling to
144144
configure, version, specify dependencies for, and publish packages
145145
to PyPI. Its plugin system allows for easily extending functionality.
146146

source/specifications/declaring-project-metadata.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ table which are not defined by this specification. For tools wishing
2727
to store their own settings in ``pyproject.toml``, they may use the
2828
``[tool]`` table as defined in the
2929
:ref:`build dependency declaration specification <declaring-build-dependencies>`.
30-
The lack of a ``[project]`` table implicitly means the build back-end
30+
The lack of a ``[project]`` table implicitly means the :term:`build backend <Build Backend>`
3131
will dynamically provide all keys.
3232

3333
The only keys required to be statically defined are:

source/specifications/source-distribution-format.rst

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

4545
Code that produces a source distribution file MUST give the file a name that matches
46-
this specification. This includes the ``build_sdist`` hook of a build backend.
46+
this specification. This includes the ``build_sdist`` hook of a
47+
:term:`build backend <Build Backend>`.
4748

4849
Code that processes source distribution files MAY recognise source distribution files
4950
by the ``.tar.gz`` suffix and the presence of precisely *one* hyphen in the filename.

source/tutorials/packaging-projects.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ Choosing a build backend
108108

109109
Tools like :ref:`pip` and :ref:`build` do not actually convert your sources
110110
into a :term:`distribution package <Distribution Package>` (like a wheel);
111-
that job is performed by a *build backend*. The build backend determines how
111+
that job is performed by a :term:`build backend <Build Backend>`. The build backend determines how
112112
your project will specify its configuration, including metadata (information
113113
about the project, for example, the name and tags that are displayed on PyPI)
114114
and input files. Build backends have different levels of functionality, such as
@@ -127,7 +127,7 @@ table for :ref:`metadata <configuring metadata>`.
127127
management, as well as building, uploading, and installing packages. This
128128
tutorial uses single-purpose tools that work independently.
129129

130-
The :file:`pyproject.toml` tells "front end" build tools like :ref:`pip` and
130+
The :file:`pyproject.toml` tells :term:`build frontend <Build Frontend>` tools like :ref:`pip` and
131131
:ref:`build` which backend to use for your project. Below are some
132132
examples for common build backends, but check your backend's own documentation
133133
for more details.
@@ -166,7 +166,7 @@ for more details.
166166
167167
168168
The ``requires`` key is a list of packages that are needed to build your package.
169-
The frontend should install them automatically when building your package.
169+
The :term:`frontend <Build Frontend>` should install them automatically when building your package.
170170
Frontends usually run builds in isolated environments, so omitting dependencies
171171
here may cause build-time errors.
172172
This should always include your backend's package, and might have other build-time

0 commit comments

Comments
 (0)