@@ -139,6 +139,29 @@ These decisions mean this PEP is capable of supporting any SBOM standard
139
139
and does not favor one over the other, instead deferring the decision to
140
140
producing projects and tools and consuming user tooling.
141
141
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
+
142
165
What are the differences between PEP 770 and PEP 725?
143
166
-----------------------------------------------------
144
167
@@ -149,8 +172,10 @@ software within Python packaging metadata. This section aims to show how these
149
172
two PEPs are tracking different information and serving different use-cases:
150
173
151
174
* 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
154
179
hash of a software library distributed through AlmaLinux distribution
155
180
(``
pkg:rpm/almalinux/[email protected] ``). For cases like build dependencies this
156
181
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:
208
233
================= ==========
209
234
``licenses `` :pep: `639 `
210
235
``license_files `` N/A (See :ref: `770-backwards-compat `)
236
+ ``LICENSES `` N/A (See :ref: `770-backwards-compat `)
211
237
``sboms `` :pep: `770 `
212
238
================= ==========
213
239
214
240
Build backends MUST NOT create subdirectories in the ``.dist-info `` directory
215
241
beyond the names in the registry to avoid collisions with future reserved names.
216
242
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
+
217
246
.. _770-spec-project-source-metadata :
218
247
219
248
Project source metadata
@@ -406,13 +435,17 @@ Not shown above are around ~50 other subdirectory names that are used in a
406
435
single project. From these results we can see:
407
436
408
437
* 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 `.
411
441
* The ``sboms `` subdirectory doesn't collide with existing use.
412
442
* Other subdirectory names under ``.dist-info `` appear to be either not
413
443
widespread or accidental.
414
444
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.
416
449
417
450
Security Implications
418
451
=====================
@@ -509,6 +542,12 @@ documented and recommended to users. For projects which require
509
542
additional manual SBOM annotation: tips for contributing this data and tools for
510
543
maintaining the data can be recommended.
511
544
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
+
512
551
Reference Implementation
513
552
========================
514
553
@@ -613,8 +652,7 @@ Acknowledgements
613
652
================
614
653
615
654
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
618
656
619
657
Copyright
620
658
=========
0 commit comments