Dependencies generated during Python builds

Direct pip dependency pulls a transitive sdist whose PEP 517 backend generates the installed module

Test case
python-pep517
Ecosystems
pypi
Scanned at
source, artefact

The application and how it is built

A Python application whose requirements.txt names one package, reportkit. reportkit's metadata requires tracehook-demo, which is available only as a source distribution. When pip installs it, pip runs the build backend the package nominates, tracehook_backend, and that backend generates the module that gets installed.

What gets hidden, and how

Installing a source distribution means running code the dependency supplies. The installed files are the output of that code, and the transitive dependency is not written anywhere in the application's own files.

ComponentMechanismIn the artefact?What happens to it
tracehook-demo@1.0.0pep517-generatedshipstransitive, sdist-only; its __init__.py and build-hook.json were created by tracehook_backend during pip install

What a true SBOM would say

2 components ship, 1 of them transformed on the way in. 1 are known not to ship (1 build-tooling). Those influence the build or run during it; a tool may list them, as long as it marks them.

The list was written by hand from the build files, the lockfiles and the listing of the built archive, and the project's own proof-check.sh asserts what ends up in the artefact. It is in expected.json, and the full list of what ships is at the foot of this page.

What the tools reported

Component by component

Ships: Y exact version, v wrong version, p wrong group or namespace, n not named. Does not ship: L listed and marked, X listed unmarked, · not listed. A tool appears under a stage only if it was run there, so an empty column never stands for a miss. Select a cell to see what is behind it.

Select a cell.

sourceartefact
Componentcapyclicdxgencyclonedx-pythonsbom-toolsyfttrivycyclonedx-pythonsbom4pythonsyfttrivy
Ships. In the artefact, including components that were shaded or bundled on the way in.
reportkit@1.0.0
tracehook-demo@1.0.0 pep517-generated

Every document

Content accuracyBaseline conformance
ToolFormatCompsIn scopeShipped foundWrong verWrong purlLeakedLabelledHashes okNTIA 2021NTIA/CISA 2026BSI v2.1
source
capycli 2.12.0cyclonedx111/200000/08.86.95.0
cdxgen 11.3.2cyclonedx221/200000/08.66.14.5
cyclonedx-python 8.0.1cyclonedx111/200000/08.85.65.3
sbom-tool 4.1.13spdx111/200000/010.05.94.0
syft 1.51.0cyclonedx111/200000/04.54.33.4
trivy 0.74.0cyclonedx321/200000/04.94.03.6
artefact
cyclonedx-python 8.0.1cyclonedx332/200100/08.65.34.4
sbom4python 0.12.6cyclonedx221/200000/06.15.24.3
syft 1.51.0cyclonedx932/200100/04.54.42.9
trivy 0.74.0cyclonedx110/200000/03.14.44.1

Details

Reading the result

From requirements.txt alone a tool cannot name tracehook-demo, because it is not written there and has to be resolved. A tool that reads the installed environment can. None can say that the module's contents were generated at install time. pip is also in the environment, as tooling, and a tool that lists it without a mark counts as a leak here.

This is our interpretation. The counts above are what the run recorded; why a tool found or missed something is inferred from how the tool works, not established by the data. Limits of the benchmark.

Evidence

Ground truth: what ships

ComponentNote
pkg:pypi/reportkit@1.0.0the only declared dependency
pkg:pypi/tracehook-demo@1.0.0transitive, sdist-only; its __init__.py and build-hook.json were created by tracehook_backend during pip install