Skip to content

Commit c19e3e7

Browse files
committed
Address review comments
1 parent 1f46c25 commit c19e3e7

1 file changed

Lines changed: 29 additions & 21 deletions

File tree

source/specifications/declaring-project-metadata.rst

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ Declaring project metadata
99
packaging-related tools to consume. It defines the following
1010
specification as the canonical source for the format used.
1111

12+
There are two kinds of metadata: *static* and *dynamic*. Static
13+
metadata is specified in the ``pyproject.toml`` file directly and
14+
cannot be specified or changed by a tool. Dynamic metadata is listed
15+
via the ``dynamic`` field (defined later in this specification) and
16+
represents metadata that a tool will later provide.
17+
1218
The fields defined in this specification MUST be in a table named
1319
``[project]`` in ``pyproject.toml``. No tools may add fields to this
1420
table which are not defined by this specification. For tools wishing
@@ -77,21 +83,22 @@ The summary description of the project.
7783
The full description of the project (i.e. the README).
7884

7985
The field accepts either a string or a table. If it is a string then
80-
it is the relative path to a text file containing the full
81-
description. Tools MUST assume the file's encoding is UTF-8. If the
82-
file path ends in a case-insensitive ``.md`` suffix, then tools MUST
83-
assume the content-type is ``text/markdown``. If the file path ends in
84-
a case-insensitive ``.rst``, then tools MUST assume the content-type
85-
is ``text/x-rst``. If a tool recognizes more extensions than this PEP,
86-
they MAY infer the content-type for the user without specifying this
87-
field as ``dynamic``. For all unrecognized suffixes when a
88-
content-type is not provided, tools MUST raise an error.
86+
it is a path relative to ``pyproject.toml`` to a text file containing
87+
the full description. Tools MUST assume the file's encoding is UTF-8.
88+
If the file path ends in a case-insensitive ``.md`` suffix, then tools
89+
MUST assume the content-type is ``text/markdown``. If the file path
90+
ends in a case-insensitive ``.rst``, then tools MUST assume the
91+
content-type is ``text/x-rst``. If a tool recognizes more extensions
92+
than this PEP, they MAY infer the content-type for the user without
93+
specifying this field as ``dynamic``. For all unrecognized suffixes
94+
when a content-type is not provided, tools MUST raise an error.
8995

9096
The ``readme`` field may also take a table. The ``file`` key has a
91-
string value representing a relative path to a file containing the
92-
full description. The ``text`` key has a string value which is the
93-
full description. These keys are mutually-exclusive, thus tools MUST
94-
raise an error if the metadata specifies both keys.
97+
string value representing a path relative to ``pyproject.toml`` to a
98+
file containing the full description. The ``text`` key has a string
99+
value which is the full description. These keys are
100+
mutually-exclusive, thus tools MUST raise an error if the metadata
101+
specifies both keys.
95102

96103
A table specified in the ``readme`` field also has a ``content-type``
97104
field which takes a string specifying the content-type of the full
@@ -115,18 +122,18 @@ The Python version requirements of the project.
115122

116123

117124
``license``
118-
==========
125+
===========
119126

120127
- TOML_ type: table
121128
- Corresponding :ref:`core metadata <core-metadata>` field:
122129
:ref:`License <core-metadata-license>`
123130

124131
The table may have one of two keys. The ``file`` key has a string
125-
value that is a relative file path to the file which contains the
126-
license for the project. Tools MUST assume the file's encoding is
127-
UTF-8. The ``text`` key has a string value which is the license of the
128-
project. These keys are mutually exclusive, so a tool MUST raise an
129-
error if the metadata specifies both keys.
132+
value that is a file path relative to ``pyproject.toml`` to the file
133+
which contains the license for the project. Tools MUST assume the
134+
file's encoding is UTF-8. The ``text`` key has a string value which is
135+
the license of the project. These keys are mutually exclusive, so a
136+
tool MUST raise an error if the metadata specifies both keys.
130137

131138

132139
``authors``/``maintainers``
@@ -291,8 +298,9 @@ provided via tooling later on.
291298
(i.e. ``dynamic`` is the only way to allow a tool to fill in
292299
metadata and the user must opt into the filling in).
293300
- Build back-ends MUST raise an error if the metadata specifies a
294-
field in dynamic but the build back-end was unable to provide the
295-
data for it.
301+
field in ``dynamic`` but the build back-end was unable to determine
302+
the data for it (omitting the data, if determined to be the accurate
303+
value, is acceptable).
296304

297305

298306
.. _RFC 822: https://tools.ietf.org/html/rfc822

0 commit comments

Comments
 (0)