Skip to content

Commit 0901f17

Browse files
committed
A few clarifications based on early reviews
1 parent 4a94f6c commit 0901f17

File tree

2 files changed

+26
-31
lines changed

2 files changed

+26
-31
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,7 @@ peps/pep-0825.rst @warsaw @dstufft
702702
peps/pep-0826.rst @savannahostrowski
703703
peps/pep-0827.rst @1st1
704704
peps/pep-0828.rst @ZeroIntensity
705+
peps/pep-0829.rst @warsaw
705706
# ...
706707
peps/pep-2026.rst @hugovk
707708
# ...

peps/pep-0829.rst

Lines changed: 25 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,14 @@ File Naming and Discovery
9494
``<package>.site.toml``, just like the current ``.pth`` file
9595
convention.
9696

97-
* The naming convention is ``<package>.site.toml``. The ``.site``
98-
marker distinguishes these from other TOML files that might exist in
99-
site-packages and describes the file's purpose (processed by
100-
``site.py``).
97+
* The file naming format is ``<package>.site.toml``. The ``.site`` marker
98+
distinguishes these from other TOML files that might exist in site-packages
99+
and describes the file's purpose (processed by ``site.py``).
100+
101+
* The ``<package>`` prefix should match the package name, but just
102+
like with ``.pth`` files, the interpreter does not enforce this.
103+
Build backends and installers :ref:`**MAY** <tool-authors>` impose
104+
stricter constraints if they so choose.
101105

102106
* ``<package>.site.toml`` files live in the same site-packages directories
103107
where ``<package>.pth`` files are found today.
@@ -162,9 +166,6 @@ are optional:
162166
163167
[metadata]
164168
schema_version = 1
165-
package = "foo"
166-
version = "2.3.4"
167-
author = "A Person <aperson@example.com>"
168169
169170
[paths]
170171
dirs = ["../lib", "/opt/mylib", "{sitedir}/extra"]
@@ -176,12 +177,8 @@ are optional:
176177
The ``[metadata]`` section
177178
''''''''''''''''''''''''''
178179

179-
This section contains package and/or file metadata. There are no required
180-
keys, and no semantics are assigned to any keys in this section *except* for
181-
the optional ``schema_version`` key (see below). Any additional keys are
182-
permitted and preserved.
183-
184-
Defined keys:
180+
This section contains package and/or file metadata. The only defined key is
181+
the the optional ``schema_version`` key.
185182

186183
``schema_version`` (integer, recommended)
187184
The TOML file schema version number. Must be the integer ``1``
@@ -193,19 +190,8 @@ Defined keys:
193190
``schema_version`` is omitted, the file is processed on a
194191
best-effort basis with no forward-compatibility guarantees.
195192

196-
Recommended keys:
197-
198-
``package`` (string)
199-
The package name.
200-
201-
``version`` (string)
202-
The package version.
203-
204-
``author`` (string)
205-
The package author. Should be
206-
``email.utils.parseaddr()``-compatible, e.g.,
207-
``"A person <aperson@example.com>"`` or
208-
``"aperson@example.com"``.
193+
Additional keys are permitted and preserved, although they are ignored for the
194+
purposes of this PEP.
209195

210196

211197
The ``[paths]`` section
@@ -247,9 +233,10 @@ Directories that do not exist on the filesystem are silently skipped, matching
247233
The ``[entrypoints]`` section
248234
'''''''''''''''''''''''''''''
249235

250-
``init`` -- a list of strings specifying entry point references to
251-
execute at startup. Each item uses the standard Python entry point
252-
syntax: ``package.module:callable``.
236+
``init`` -- a list of strings specifying `entry point
237+
<https://packaging.python.org/en/latest/specifications/entry-points/>`_
238+
references to execute at startup. Each item uses the standard Python
239+
entry point syntax: ``package.module:callable``.
253240

254241
* The ``:callable`` portion is optional. If omitted (e.g.,
255242
``package.module``), the module is imported via
@@ -448,16 +435,23 @@ migration. If both exist for the same package, only the
448435
``<package>.site.toml`` is processed. Thus it is recommended that
449436
packages compatible with older Pythons ship both files.
450437

438+
.. _tool-authors:
451439

452-
For tool authors
453-
----------------
440+
For tool makers
441+
---------------
454442

455443
Build backends and installers should generate ``<package>.site.toml``
456444
files alongside or instead of ``<package>.pth`` files, depending on
457445
the package's Python support matrix. The TOML format is easy to
458446
generate programmatically using ``tomllib`` (for reading) or string
459447
formatting (for writing, since the schema is simple).
460448

449+
Build backends **SHOULD** ensure that the ``<package>`` prefix matches
450+
the package name.
451+
452+
Installers **MAY** validate or enforce that the ``<package>`` prefix
453+
matches the package name.
454+
461455

462456
Reference Implementation
463457
=========================

0 commit comments

Comments
 (0)