Generate and add an SBOM to wheels (PEP 770)#130
Generate and add an SBOM to wheels (PEP 770)#130StanFromIreland wants to merge 6 commits intopython:masterfrom
Conversation
|
Ah, |
sethmlarson
left a comment
There was a problem hiding this comment.
In general this looks good to me, do you have the "built" SBOM available so I can poke around with it with some validators?
| "$schema": "http://cyclonedx.org/schema/bom-1.7.schema.json", | ||
| "version": 1, | ||
| "bomFormat": "CycloneDX", | ||
| "specVersion": "1.7", |
There was a problem hiding this comment.
Funnily enough, many scanners don't recognize later SBOM versions. If you're not using new features it's better to use a lower version (like 1.4).
There was a problem hiding this comment.
Oh, that's not ideal, IIRC since it has been a few days I think there was something only in the newer ones.
|
Here are the extracted contents: Detailstzdata-2026.1.dist-info/sboms$ cat sbom.cdx.json
{
"$schema": "http://cyclonedx.org/schema/bom-1.7.schema.json",
"version": 1,
"bomFormat": "CycloneDX",
"specVersion": "1.7",
"metadata": {
"component": {
"bom-ref": "pkg:pypi/tzdata@2026.1",
"name": "tzdata",
"version": "2026.1",
"purl": "pkg:pypi/tzdata@2026.1",
"type": "library",
"components": [
{
"bom-ref": "https://www.iana.org/time-zones",
"name": "tz",
"version": "2026a",
"type": "data",
"data": [
{
"type": "dataset",
"name": "IANA Time Zone Database",
"description": "zic-compiled TZif timezone files"
}
],
"licenses": [
{
"license": {
"name": "tz database license",
"url": "https://data.iana.org/time-zones/tz-link.html"
}
}
]
}
]
}
}
} |
pganssle
left a comment
There was a problem hiding this comment.
Sorry I could have sworn I left this comment already, but is there a way to do this without adding a setup.py? This is a very simple package, surely there is an existing backend that can handle packaging up a data-only package and including a SBOM automatically, or a plugin for setuptools for this?
|
Not yet it seems per pypa/setuptools#4821. Would you prefer we run |
Yeah I looked into this a bit and it seems to me like the best ways forward are one of:
Also, I'm guessing based on the commit history that the |
They would still require a script to generate the SBOM at build time, I think storing the template and a copy made during the update is a little duplicative. |
I am not sure I fully understand why the build-time script to generate the SBOM is necessary? Looked to me like if we generate the SBOM at update time and check it in, hatchling will just include it for us in the wheel build and If we used |
@sethmlarson, could you please review?