Automatically generate a SBOM file when vendoring array-api-compat
and array-api-extra
#31343
+129
−64
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is an experimental branch to explore a way to adopt PEP 770 for our vendored runtime dependencies. The goal is to make software composition analysis (SCA) tools such as syft able to properly report metadata about vendored components for vulnerability detection or licensing compliance concerns.
This involves using the development branch of vendoring as documented in the
sklearn/_vendored/README.md
file instead of custom bash scripts.vendoring
allows ignoring a list of files in the destination folder but not folders. Hence, I decided to movearray-api-extra
andarray-api-compat
tosklearn/_vendored
instead ofsklearn/externals
to avoid deleting oursklearn/externals/_scipy
compat folder structure. Note thatsklearn/externals
should better be renamed tosklearn/_compat
because the code there cannot be automatically managed by a vendoring tool.Also note that the current state of this PR is not enough to implement PEP 770 for our vendored runtime dependencies, as we would also need to move the generated SBOM file under
.dist-info/sboms
when building the wheel: psf/sboms-for-python-packages#5 (comment)Note that a SBOM file for vendored build-time injected native runtime dependencies (such as
libgomp
on Linux) will be generated by auditwheel repair once pypa/auditwheel#577 is merged and released. Similar efforts in wheel post-processing tools will be necessary for macOS and Windows.This PR is loosely related to #28151, in the sense that #28151 might also involve adopting SBOM files, although for another purpose: explicitly recording metadata of build-time dependencies (including compilers) for the sake of making the build bitwise reproducible.
TODO:
.dist-info/sboms
folder when building the wheel.vendoring
? Instruct maintainainers to use install a specific commit hash ofvendoring
if no planned release?