Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a307eb4

Browse files
committed
Address review comments
1 parent 5946028 commit a307eb4

File tree

1 file changed

+45
-7
lines changed

1 file changed

+45
-7
lines changed

peps/pep-0770.rst

Lines changed: 45 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,29 @@ These decisions mean this PEP is capable of supporting any SBOM standard
139139
and does not favor one over the other, instead deferring the decision to
140140
producing projects and tools and consuming user tooling.
141141

142+
Adding data to Python packages without new metadata versions
143+
------------------------------------------------------------
144+
145+
The rollout of a new metadata version and field requires that many different
146+
projects and teams need to adopt the metadata version in sequence to avoid
147+
widespread breakage. This effect usually means a substantial delay in how
148+
quickly users and tools can start using new packaging features.
149+
150+
For example, a single metadata version bump requires
151+
updates to PyPI, various ``pyproject.toml`` parsing and schema projects,
152+
the ``packaging`` library, wait for releases, then ``pip`` and other installers
153+
need to bundle the changes to ``packaging`` and release, then build backends can
154+
begin emitting the new metadata version, again wait for releases, and only then
155+
can projects begin using the new features. Even with this careful approach it's
156+
not guaranteed that tools won't break on new metadata versions and fields.
157+
158+
To avoid this delay, this PEP proposes a new mechanism ``[additional-files]``
159+
to safely add data to a Python package through a registry of reserved names that
160+
avoids the need for new metadata fields and versions. This mechanism allows
161+
build backends and tools to begin using the features described in this PEP
162+
immediately after acceptance without the head-of-line blocking on other
163+
projects adopting the PEP.
164+
142165
What are the differences between PEP 770 and PEP 725?
143166
-----------------------------------------------------
144167

@@ -149,8 +172,10 @@ software within Python packaging metadata. This section aims to show how these
149172
two PEPs are tracking different information and serving different use-cases:
150173

151174
* PEP 725 describes **abstract dependencies**, such as requiring "a C compiler"
152-
as a build-time dependency (``virtual:compiler/c``). PEP 770 describes
153-
**concrete dependencies**, such as an exact name, version, architecture, and
175+
as a build-time dependency (``virtual:compiler/c``) or an "OpenSSL-like
176+
library" (``pkg:generic/openssl``). PEP 770 describes
177+
**concrete dependencies**, more akin to dependencies in a "lock file", such as
178+
an exact name, version, architecture, and
154179
hash of a software library distributed through AlmaLinux distribution
155180
(``pkg:rpm/almalinux/[email protected]``). For cases like build dependencies this
156181
might result in a dependency being requested via PEP 725 and then recorded
@@ -208,12 +233,16 @@ will be made through the PEP process. The initial values in this registry are:
208233
================= ==========
209234
``licenses`` :pep:`639`
210235
``license_files`` N/A (See :ref:`770-backwards-compat`)
236+
``LICENSES`` N/A (See :ref:`770-backwards-compat`)
211237
``sboms`` :pep:`770`
212238
================= ==========
213239

214240
Build backends MUST NOT create subdirectories in the ``.dist-info`` directory
215241
beyond the names in the registry to avoid collisions with future reserved names.
216242

243+
Build frontends and publishing tools MAY warn users or raise a validation error
244+
if any ``.dist-info`` subdirectories aren't in the registry.
245+
217246
.. _770-spec-project-source-metadata:
218247

219248
Project source metadata
@@ -406,13 +435,17 @@ Not shown above are around ~50 other subdirectory names that are used in a
406435
single project. From these results we can see:
407436

408437
* Most subdirectories under ``.dist-info`` are to do with licensing,
409-
one of which (``licenses``) is specified by :pep:`639` and other
410-
(``license_files``) which is being used by the Hatch build backend.
438+
one of which (``licenses``) is specified by :pep:`639` and others
439+
(``license_files``, ``LICENSES``) are from draft implementations
440+
of :pep:`639`.
411441
* The ``sboms`` subdirectory doesn't collide with existing use.
412442
* Other subdirectory names under ``.dist-info`` appear to be either not
413443
widespread or accidental.
414444

415-
As a result of this query
445+
As a result of this query we can see there are already some projects placing
446+
directories under ``.dist-info``, so we can't require that build frontends
447+
raise errors for unregistered subdirectories. Instead the recommendation is
448+
that build frontends MAY warn the user or raise an error in this scenario.
416449

417450
Security Implications
418451
=====================
@@ -509,6 +542,12 @@ documented and recommended to users. For projects which require
509542
additional manual SBOM annotation: tips for contributing this data and tools for
510543
maintaining the data can be recommended.
511544

545+
Note that SBOM documents can vary across different Python package archives
546+
due to variance in dependencies, Python version, platform, architecture, etc.
547+
For this reason users SHOULD only use the SBOM documents contained within
548+
the actual downloaded and installed Python package archive and not assume that
549+
the SBOM documents are the same for all archives in a given package release.
550+
512551
Reference Implementation
513552
========================
514553

@@ -613,8 +652,7 @@ Acknowledgements
613652
================
614653

615654
Thanks to Karolina Surma for authoring and leading :pep:`639` to acceptance.
616-
This PEP copies the specification from :pep:`639` for specifying files in
617-
project source metadata, Core Metadata, and project formats is based on.
655+
This PEP's initial design was heavily based on 639
618656

619657
Copyright
620658
=========

0 commit comments

Comments
 (0)