Skip to content

Commit 441d38e

Browse files
committed
pyproject.toml specification: Harmonize structure
Move the description of the tool table to its own section, and use consistent titles and labels.
1 parent 66460e3 commit 441d38e

File tree

1 file changed

+28
-31
lines changed

1 file changed

+28
-31
lines changed

source/specifications/pyproject-toml.rst

Lines changed: 28 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
The ``pyproject.toml`` file acts as a configuration file for packaging-related
1414
tools (as well as other tools).
1515

16-
.. _declaring-build-dependencies:
1716

18-
===================================
19-
Declaring build system dependencies
20-
===================================
17+
.. _pyproject-build-system-table:
18+
19+
Declaring build system dependencies: the ``[build-system]`` table
20+
=================================================================
2121

2222
The ``pyproject.toml`` file is written in `TOML <https://toml.io>`_.
2323
Among other metadata (such as :ref:`project metadata <declaring-project-metadata>`),
@@ -28,9 +28,6 @@ run the project's build system successfully.
2828
2929
Tables not defined by PyPA specifications are reserved for future use.
3030

31-
build-system table
32-
------------------
33-
3431
.. TODO: merge with PEP 517
3532
3633
The ``[build-system]`` table is used to store build-related data.
@@ -61,28 +58,6 @@ If the table is specified but is missing required fields then the tool
6158
should consider it an error.
6259

6360

64-
.. TODO: move elsewhere
65-
66-
.. _pyproject-tool-table:
67-
68-
tool table
69-
----------
70-
71-
The ``[tool]`` table is where any tool related to your Python
72-
project, not just build tools, can have users specify configuration
73-
data as long as they use a sub-table within ``[tool]``, e.g. the
74-
`flit <https://pypi.python.org/pypi/flit>`_ tool would store its
75-
configuration in ``[tool.flit]``.
76-
77-
A mechanism is needed to allocate names within the ``tool.*``
78-
namespace, to make sure that different projects do not attempt to use
79-
the same sub-table and collide. Our rule is that a project can use
80-
the subtable ``tool.$NAME`` if, and only if, they own the entry for
81-
``$NAME`` in the Cheeseshop/PyPI.
82-
83-
JSON Schema
84-
-----------
85-
8661
To provide a type-specific representation of the resulting data from
8762
the TOML file for illustrative purposes only, the following
8863
`JSON Schema <https://json-schema.org>`_ would match the data format:
@@ -117,8 +92,11 @@ the TOML file for illustrative purposes only, the following
11792
}
11893
}
11994
120-
Specification
121-
=============
95+
96+
.. _pyproject-project-table:
97+
98+
Declaring project metadata: the ``[project]`` table
99+
===================================================
122100

123101
There are two kinds of metadata: *static* and *dynamic*. Static
124102
metadata is specified in the ``pyproject.toml`` file directly and
@@ -441,6 +419,25 @@ provided via tooling later on.
441419

442420

443421

422+
.. _pyproject-tool-table:
423+
424+
Arbitrary tool configuration: the ``[tool]`` table
425+
==================================================
426+
427+
The ``[tool]`` table is where any tool related to your Python
428+
project, not just build tools, can have users specify configuration
429+
data as long as they use a sub-table within ``[tool]``, e.g. the
430+
`flit <https://pypi.python.org/pypi/flit>`_ tool would store its
431+
configuration in ``[tool.flit]``.
432+
433+
A mechanism is needed to allocate names within the ``tool.*``
434+
namespace, to make sure that different projects do not attempt to use
435+
the same sub-table and collide. Our rule is that a project can use
436+
the subtable ``tool.$NAME`` if, and only if, they own the entry for
437+
``$NAME`` in the Cheeseshop/PyPI.
438+
439+
440+
444441
History
445442
=======
446443

0 commit comments

Comments
 (0)