Skip to content

Commit 56a280b

Browse files
committed
Add root SBOM directory terminology, more tweaks
1 parent cd7a24a commit 56a280b

File tree

1 file changed

+40
-16
lines changed

1 file changed

+40
-16
lines changed

peps/pep-0770.rst

Lines changed: 40 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,20 @@ Post-History:
1515
Abstract
1616
========
1717

18+
Almost all Python packages today are accurately measurable by software
19+
composition analysis (SCA) tools and therefore do not need additional metadata
20+
to improve measurability. For projects that are not accurately measurable, there
21+
is no existing mechanism to annotate a Python package with composition data to
22+
improve measurability.
23+
1824
Software Bill-of-Materials (SBOM) is a technology-and-ecosystem-agnostic
1925
method for describing software composition, provenance, heritage, and more.
20-
SBOMs are used as inputs for software composition analysis (SCA) tools,
21-
such as scanners for vulnerabilities and licenses, and have been gaining
22-
traction in global software regulations and frameworks.
26+
SBOMs are used as inputs for SCA tools, such as scanners for vulnerabilities and
27+
licenses, and have been gaining traction in global software regulations and
28+
frameworks.
2329

2430
This PEP proposes using SBOM documents included in Python packages as a
25-
means to improve software measurability for Python packages.
31+
means to improve automated software measurability for Python packages.
2632

2733
The changes will update the
2834
`Core Metadata specification <coremetadataspec_>`__ to version 2.5.
@@ -141,6 +147,24 @@ In addition to the above, an informational PEP will be created for tools
141147
consuming included SBOM documents and other Python package metadata to
142148
generate complete SBOM documents for Python packages.
143149

150+
Terminology
151+
-----------
152+
153+
This section describes terminology used later in the document:
154+
155+
* **Root SBOM directory**: This is the directory within a Python project source
156+
tree or package archive that SBOM documents are stored in. For
157+
:term:`Project source trees <Project source tree>` and
158+
:term:`Source Distributions <Source Distribution (or "sdist")>` the root SBOM
159+
directory is the same directory containing ``pyproject.toml`` or other "root"
160+
metadata file like ``PKG-INFO``/``setup.py``.
161+
162+
For :term:`Built Distribution`s and
163+
:term:`Installed projects <Installed project>` the root SBOM directory is
164+
defined as ``.dist-info/sboms``. The new ``Sbom-File`` Core Metadata
165+
field defined below always specifies SBOM documents relative to the root SBOM
166+
directory for the specific project format.
167+
144168
.. _770-spec-core-metadata:
145169

146170
Core Metadata
@@ -149,9 +173,9 @@ Core Metadata
149173
Add ``Sbom-File`` field
150174
~~~~~~~~~~~~~~~~~~~~~~~
151175

152-
The ``Sbom-File`` is an optional Core Metadata field. Each instance contains a
153-
string representation of the path of an SBOM document. The path is located
154-
within the project source tree, relative to the project root directory. It is a
176+
The ``Sbom-File`` is a new optional Core Metadata field. Each instance contains a
177+
string representation of the path to an SBOM document. The path is specified
178+
relative to the root SBOM directory for all project types. It is a
155179
multi-use field that MAY appear zero or more times and each instance lists the
156180
path to one such file. Files specified under this field are SBOM documents
157181
that are distributed with the package.
@@ -170,8 +194,7 @@ If an ``Sbom-File`` is listed in a
170194
relative path.
171195
* Inside the root SBOM directory, packaging tools MUST reproduce the directory
172196
structure under which the source files are located relative to the project
173-
root. The root SBOM directory is
174-
`specified in a later section <#770-spec-project-formats>`__.
197+
root.
175198
* Path delimiters MUST be the forward slash character (``/``), and parent
176199
directory indicators (``..``) MUST NOT be used.
177200

@@ -191,10 +214,10 @@ This PEP specifies changes to the project's source metadata under a
191214
Add ``sbom-files`` key
192215
~~~~~~~~~~~~~~~~~~~~~~
193216

194-
A new ``sbom-files`` key is added to the ``[project]`` table for specifying
195-
paths in the project source tree relative to ``pyproject.toml`` to file(s)
196-
containing SBOMs to be distributed with the package. This key corresponds to the
197-
``Sbom-File`` fields in the Core Metadata.
217+
A new optional ``sbom-files`` key is added to the ``[project]`` table for
218+
specifying paths in the project source tree relative to ``pyproject.toml`` to
219+
file(s) containing SBOMs to be distributed with the package. This key
220+
corresponds to the ``Sbom-File`` fields in the Core Metadata.
198221

199222
Its value is an array of strings which MUST contain valid glob patterns, as
200223
specified below:
@@ -384,8 +407,8 @@ added to the Python Packaging User Guide for how to specify and maintain
384407
SBOM documents for Python packages in source code.
385408

386409
There are two groups of projects that contain other software, those from
387-
a "packaging ecosystem" (PyPI, Linux distros, Crates.io, NPM, etc) and those from
388-
outside a packaging ecosystem (vendored C, C++, Fortran). Software that is
410+
a "packaging ecosystem" (PyPI, Linux distros, Crates.io, NPM, etc) and those
411+
from outside a packaging ecosystem (vendored C, C++, Fortran). Software that is
389412
a part of a packaging ecosystem is much easier to identify meaning
390413
that package maintainers may have their package SBOM data annotated
391414
automatically by common build tools (
@@ -480,7 +503,8 @@ Open Issues
480503
Conditional project source SBOM files
481504
-------------------------------------
482505

483-
How can a project specify an SBOM file that is conditional? Under what circumstances would an SBOM document be conditional?
506+
How can a project specify an SBOM file that is conditional? Under what
507+
circumstances would an SBOM document be conditional?
484508

485509
Selecting a single SBOM standard
486510
--------------------------------

0 commit comments

Comments
 (0)