Skip to content

Commit 1415b22

Browse files
refactor: include build system tabs from shared file instead of duplicating them
1 parent a81a2d0 commit 1415b22

File tree

3 files changed

+35
-64
lines changed

3 files changed

+35
-64
lines changed

source/guides/writing-pyproject-toml.rst

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -56,38 +56,7 @@ Usually, you'll just copy what your build backend's documentation
5656
suggests (after :ref:`choosing your build backend <choosing-build-backend>`).
5757
Here are the values for some common build backends:
5858

59-
.. tab:: Hatchling
60-
61-
.. code-block:: toml
62-
63-
[build-system]
64-
requires = ["hatchling"]
65-
build-backend = "hatchling.build"
66-
67-
.. tab:: setuptools
68-
69-
.. code-block:: toml
70-
71-
[build-system]
72-
requires = ["setuptools >= 61.0"]
73-
build-backend = "setuptools.build_meta"
74-
75-
.. tab:: Flit
76-
77-
.. code-block:: toml
78-
79-
[build-system]
80-
requires = ["flit_core >= 3.4"]
81-
build-backend = "flit_core.buildapi"
82-
83-
.. tab:: PDM
84-
85-
.. code-block:: toml
86-
87-
[build-system]
88-
requires = ["pdm-backend"]
89-
build-backend = "pdm.backend"
90-
59+
.. include:: ../shared/build-backend-tabs.rst
9160

9261

9362
Static vs. dynamic metadata

source/shared/build-backend-tabs.rst

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
.. (comment) This file is included in guides/writing-pyproject-toml.rst and tutorials/packaging-projects.rst.
2+
3+
.. tab:: Hatchling
4+
5+
.. code-block:: toml
6+
7+
[build-system]
8+
requires = ["hatchling"]
9+
build-backend = "hatchling.build"
10+
11+
.. tab:: setuptools
12+
13+
.. code-block:: toml
14+
15+
[build-system]
16+
requires = ["setuptools >= 61.0"]
17+
build-backend = "setuptools.build_meta"
18+
19+
.. tab:: Flit
20+
21+
.. code-block:: toml
22+
23+
[build-system]
24+
requires = ["flit_core >= 3.4"]
25+
build-backend = "flit_core.buildapi"
26+
27+
.. tab:: PDM
28+
29+
.. code-block:: toml
30+
31+
[build-system]
32+
requires = ["pdm-backend"]
33+
build-backend = "pdm.backend"

source/tutorials/packaging-projects.rst

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -136,38 +136,7 @@ The :file:`pyproject.toml` tells :term:`build frontend <Build Frontend>` tools l
136136
examples for common build backends, but check your backend's own documentation
137137
for more details.
138138

139-
.. tab:: Hatchling
140-
141-
.. code-block:: toml
142-
143-
[build-system]
144-
requires = ["hatchling"]
145-
build-backend = "hatchling.build"
146-
147-
.. tab:: setuptools
148-
149-
.. code-block:: toml
150-
151-
[build-system]
152-
requires = ["setuptools>=61.0"]
153-
build-backend = "setuptools.build_meta"
154-
155-
.. tab:: Flit
156-
157-
.. code-block:: toml
158-
159-
[build-system]
160-
requires = ["flit_core>=3.4"]
161-
build-backend = "flit_core.buildapi"
162-
163-
.. tab:: PDM
164-
165-
.. code-block:: toml
166-
167-
[build-system]
168-
requires = ["pdm-backend"]
169-
build-backend = "pdm.backend"
170-
139+
.. include:: ../shared/build-backend-tabs.rst
171140

172141
The ``requires`` key is a list of packages that are needed to build your package.
173142
The :term:`frontend <Build Frontend>` should install them automatically when building your package.

0 commit comments

Comments
 (0)