-
-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add pip to SBOM at release stage #96
Conversation
raise ValueError(f"Couldn't fetch metadata for project '{project}' from PyPI: {e}") | ||
|
||
|
||
def remove_pip_from_sbom(sbom_data: dict[str, typing.Any]) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll be able to remove this function once I remove pip from the SBOM in the CPython source code.
@@ -163,9 +347,9 @@ def create_sbom_for_source_tarball(tarball_path: str): | |||
"Tarball doesn't contain an SBOM at 'Misc/sbom.spdx.json'" | |||
) from None | |||
sbom_bytes = tarball.extractfile(sbom_tarball_member).read() | |||
sbom_data = json.loads(sbom_bytes) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed this variable name to match everywhere in this script.
Co-authored-by: Ezio Melotti <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There will be a follow-up PR to the CPython repository removing the machinery there once this PR lands.
And after that update https://devguide.python.org/developer-workflow/sbom/.
Closes #91 This moves the pip SBOM discovery machinery from the CPython repository to this repository to not require pip maintainers to update the SBOM every time, saving difficulties with backporting and a bunch of manual effort.
There will be a follow-up PR to the CPython repository removing the machinery there once this PR lands.
The SBOM diff between running this script on
Python-3.12.2.tgz
:Notice this removes all the direct relationships between CPython and pip's subpackages, this is a good thing IMO since CPython doesn't directly depend on these packages. This still lets tools like scanners discover vulnerabilities because CPython still has a dependency relationship with pip.