Skip to content

Commit e0e93b3

Browse files
sethmlarsonhugovk
andauthored
Apply suggestions from code review
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
1 parent 86f4d99 commit e0e93b3

File tree

1 file changed

+27
-30
lines changed

1 file changed

+27
-30
lines changed

peps/pep-770.rst

Lines changed: 27 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ Discussions-To: https://discuss.python.org/t/70261
77
Status: Draft
88
Type: Standards Track
99
Topic: Packaging
10-
Created: 15-Nov-2024
10+
Created: 02-Jan-2025
1111

1212
Abstract
1313
========
1414

15-
Software Bill-of-Materials (SBOM) are a technology-and-ecosystem-agnostic
15+
Software Bill-of-Materials (SBOM) is a technology-and-ecosystem-agnostic
1616
method for describing software composition, provenance, heritage, and more.
1717
SBOMs are used as inputs for software composition analysis (SCA) tools,
1818
such as scanners for vulnerabilities and licenses, and have been gaining
@@ -120,12 +120,12 @@ Specification
120120

121121
The changes necessary to implement this PEP include:
122122

123-
* Additions to `Core Metadata <770-spec-core-metadata>`_, as defined in the
124-
`Core Metadata specification <coremetadataspec>`__.
123+
* Additions to `Core Metadata <770-spec-core-metadata_>`_, as defined in the
124+
`Core Metadata specification <coremetadataspec_>`__.
125125
* Additions to the author-provided
126-
`project source metadata <770-spec-source-metadata>`_, as defined in the
126+
`project source metadata <770-spec-project-source-metadata_>`_, as defined in the
127127
`pyproject.toml specification <pyprojecttoml_>`__.
128-
* `Additions <770-spec-project-formats>`_ to the source distribution (sdist),
128+
* `Additions <770-spec-project-formats_>`_ to the source distribution (sdist),
129129
built distribution (wheel), and installed project specifications.
130130

131131
In addition to the above, an informational PEP will be created for tools
@@ -151,7 +151,7 @@ As `specified by this PEP <#770-spec-project-formats>`__, its value is also
151151
that file's path relative to the root SBOM directory in both installed projects
152152
and the standardized Distribution Package types.
153153

154-
If a ``Sbom-File`` is listed in a
154+
If an ``Sbom-File`` is listed in a
155155
:term:`Source Distribution <Source Distribution (or "sdist")>` or
156156
:term:`Built Distribution`'s Core Metadata:
157157

@@ -168,7 +168,7 @@ If a ``Sbom-File`` is listed in a
168168
* SBOM document contents MUST be UTF-8 encoded JSON according to :rfc:`8259`.
169169
* SBOM document contents MUST use an SBOM standard, and for better
170170
interoperability SHOULD be a well-known SBOM standard such as
171-
`CycloneDX <cyclonedx>`_ or `SPDX <spdx>`_.
171+
`CycloneDX <cyclonedxspec_>`_ or `SPDX <spdxspec_>`_.
172172
* The "primary" component being described in included SBOM documents MUST be the
173173
Python package. This is achieved in CycloneDX using the ``metadata.component``
174174
field and in SPDX using the ``DESCRIBES`` relationship.
@@ -233,7 +233,7 @@ Build tools:
233233
pattern contains invalid glob syntax.
234234
* MUST include all files matched by a listed pattern in all distribution
235235
archives.
236-
* MUST list each matched file path under a ``Sbom-File`` field in the
236+
* MUST list each matched file path under an ``Sbom-File`` field in the
237237
Core Metadata.
238238
* MUST raise an error if any individual user-specified pattern does not match
239239
at least one file.
@@ -272,7 +272,7 @@ must be used.
272272
[project]
273273
sbom-files = ["bom{.json*"]
274274
275-
Reason: "bom{.json" is not a valid glob.
275+
Reason: ``bom{.json`` is not a valid glob.
276276

277277
.. _770-spec-project-formats:
278278

@@ -281,7 +281,7 @@ SBOM files in project formats
281281

282282
A few additions will be made to the existing specifications.
283283

284-
:term:`Project source tree`\s
284+
:term:`Project source trees <Project source tree>`
285285
Per :ref:`639-spec-source-metadata` section, the
286286
`Declaring Project Metadata specification <pyprojecttoml_>`__
287287
will be updated to reflect that SBOM file paths MUST be relative to the
@@ -290,28 +290,25 @@ A few additions will be made to the existing specifications.
290290
e.g. ``setup.py``, ``setup.cfg``, etc).
291291

292292
:term:`Source distributions (sdists) <Source Distribution (or "sdist")>`
293-
294293
The sdist specification will be updated to reflect that if the
295294
``Metadata-Version`` is ``2.5`` or greater, the sdist MUST contain any SBOM
296295
files specified by the ``Sbom-File`` field in the ``PKG-INFO`` at their
297296
respective paths relative to the sdist (containing the ``pyproject.toml`` and
298297
the ``PKG-INFO`` Core Metadata).
299298

300-
:term:`Built distribution`\s (:term:`wheel`\s)
301-
299+
:term:`Built distributions <Built distribution>` (:term:`wheels <wheel>`)
302300
The wheel specification will be updated to reflect that if the
303301
``Metadata-Version`` is ``2.5`` or greater and one or more ``Sbom-File``
304-
fields are specified, the ``.dist-info`` directory MUST contain a ``sboms``
302+
fields are specified, the ``.dist-info`` directory MUST contain an ``sboms``
305303
subdirectory, which MUST contain the files listed in the ``Sbom-File`` fields
306304
in the ``METADATA`` file at their respective paths relative to the ``sboms``
307305
directory.
308306

309-
:term:`Installed project`\s
310-
307+
:term:`Installed projects <Installed project>`
311308
The Recording Installed Projects specification will be updated to reflect that
312309
if the ``Metadata-Version`` is ``2.5`` or greater and one or more
313310
``Sbom-File`` fields is specified, the ``.dist-info`` directory MUST contain
314-
a ``sboms`` subdirectory which MUST contain the files listed in the
311+
an ``sboms`` subdirectory which MUST contain the files listed in the
315312
``Sbom-File`` fields in the ``METADATA`` file at their respective paths
316313
relative to the ``sboms`` directory, and that any files in this directory MUST
317314
be copied from wheels by install tools.
@@ -356,7 +353,7 @@ SBOM generation tools and vulnerability scanners.
356353

357354
Most Python packages don't contain code from other software components and thus
358355
are already measurable by SCA tools without the need of this standard or
359-
additional SBOM documents. Pure-Python packages are about `~90% <pypi-data>`__
356+
additional SBOM documents. Pure-Python packages are about `~90% <pypi-data_>`__
360357
of popular packages on PyPI.
361358

362359
For projects that do contain other software components, documentation will be
@@ -365,15 +362,15 @@ SBOM documents for Python packages in source code.
365362

366363
A follow-up informational PEP will be authored to describe how to transform
367364
Python packaging metadata, including the mechanism described in this PEP,
368-
into a SBOM document describing Python packages.
365+
into an SBOM document describing Python packages.
369366

370367
Reference Implementation
371368
========================
372369

373-
* `Auditwheel fork <https://sethmlarson.dev/early-promising-results-with-sboms-and-python-packages>`_
374-
which generates CycloneDX SBOM documents to include in wheels describing
375-
bundled shared library files. These SBOM documents worked as expected for the
376-
Syft and Grype SBOM and vulnerability scanners.
370+
`Auditwheel fork <https://sethmlarson.dev/early-promising-results-with-sboms-and-python-packages>`_
371+
which generates CycloneDX SBOM documents to include in wheels describing
372+
bundled shared library files. These SBOM documents worked as expected for the
373+
Syft and Grype SBOM and vulnerability scanners.
377374

378375
Rejected Ideas
379376
==============
@@ -382,7 +379,7 @@ Why not require a single SBOM standard?
382379
---------------------------------------
383380

384381
Most discussion and development around SBOMs today focuses on two SBOM
385-
standards: `CycloneDX <cyclonedx>`_ and `SPDX <spdx>`_. There is no clear
382+
standards: `CycloneDX <cyclonedxspec_>`_ and `SPDX <spdxspec_>`_. There is no clear
386383
"winner" between these two standards, both standards are frequently used by
387384
projects and software ecosystems.
388385

@@ -415,16 +412,16 @@ References
415412
.. _phantom dependency: https://www.endorlabs.com/learn/dependency-resolution-in-python-beware-the-phantom-dependency
416413
.. _coremetadataspec: https://packaging.python.org/specifications/core-metadata
417414
.. _pyprojecttoml: https://packaging.python.org/en/latest/specifications/pyproject-toml/
418-
.. _spdx: https://spdx.dev/use/specifications/
419-
.. _cyclonedx: https://cyclonedx.org/specification/overview/
415+
.. _spdxspec: https://spdx.dev/use/specifications/
416+
.. _cyclonedxspec: https://cyclonedx.org/specification/overview/
420417
.. _pypi-data: https://github.com/sethmlarson/pypi-data
421418

422419
Acknowledgements
423420
================
424421

425-
* Thanks to Karolina Surma for authoring and leading :pep:`639` to acceptance.
426-
This PEP copies the specification from :pep:`639` for specifying files in
427-
project source metadata, Core Metadata, and project formats is based on.
422+
Thanks to Karolina Surma for authoring and leading :pep:`639` to acceptance.
423+
This PEP copies the specification from :pep:`!639` for specifying files in
424+
project source metadata, Core Metadata, and project formats is based on.
428425

429426
Copyright
430427
=========

0 commit comments

Comments
 (0)