Hatch SBOM
| CI/CD |
|
|---|---|
| Package |
|
| Meta |
|
A Hatchling build hook plugin to automatically generate a Software Bill of Materials (SBOM) during wheel creation.
Usage
To use this plugin, configure your pyproject.toml to require both hatchling (>=1.28.0) and hatch-sbom in your build-system.
For a requirements.txt SBOM:
[build-system]
requires = ["hatchling>=1.28.0", "hatch-sbom[cdx]"]
build-backend = "hatchling.build"
The base install is minimal. Install extras only for the backend used by your selected source:
requirements,poetry,pipenv, andenvironmentusecyclonedx-pyand needhatch-sbom[cdx].uvusesuv exportdirectly and needshatch-sbom[uv].pdmuses bothpdm exportandcyclonedx-py, so it needshatch-sbom[pdm,cdx].
Next, configure the build hook specifically for the wheel target:
[tool.hatch.build.targets.wheel.hooks.sbom]
source = "requirements"
path = "requirements.txt"
format = "json" # Optional, defaults to "json"
spec-version = "1.6" # Optional, defaults to "1.6"
Supported Sources
The source field determines how the SBOM is built.
| Source | Requires | Backend | Path behavior |
|---|---|---|---|
requirements |
hatch-sbom[cdx] |
cyclonedx-py requirements |
Optional; defaults to requirements.txt when present. |
poetry |
hatch-sbom[cdx] |
cyclonedx-py poetry |
Optional; defaults to the current directory. |
pipenv |
hatch-sbom[cdx] |
cyclonedx-py pipenv |
Optional; defaults to the current directory. |
environment |
hatch-sbom[cdx] |
cyclonedx-py environment |
Optional; defaults to the current directory. |
uv |
hatch-sbom[uv] |
uv export |
Optional; defaults to the current directory. Requires uv.lock. |
pdm |
hatch-sbom[pdm,cdx] |
pdm export, then cyclonedx-py requirements |
Optional; defaults to the current directory. Requires pdm.lock. |
The uv source only supports json format and CycloneDX 1.5.
Source-Specific Arguments
You can pass extra arguments to the underlying tool (e.g., uv export, pdm export, or cyclonedx-py <source>) by creating a nested table named after the source.
This is useful for passing flags like --without, --no-dev, etc.
For example, to omit the dev and test groups when using Poetry:
[tool.hatch.build.targets.wheel.hooks.sbom.poetry]
without = ["dev", "test"] # Appends `--without dev --without test`
To include all extras when using uv:
[tool.hatch.build.targets.wheel.hooks.sbom.uv]
all-extras = true # Appends `--all-extras`
You can use the extra-args key to pass an arbitrary list of raw arguments:
[tool.hatch.build.targets.wheel.hooks.sbom.pipenv]
extra-args = ["--mc-type", "firmware"]
The generated SBOM file (e.g., sbom.cdx.json) will be automatically placed in the .dist-info/sboms/ directory of the resulting wheel.
Metadata
Release files for hatch-sbom 0.4.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| hatch_sbom-0.4.2.tar.gz | 123.5 kB | With provenance | Details for hatch_sbom-0.4.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| hatch_sbom-0.4.2-py3-none-any.whl | Python 3 | none | any | Details for hatch_sbom-0.4.2-py3-none-any.whl |
Total release size: 136.8 kB
Release files / hatch_sbom-0.4.2.tar.gz
| Download URL | hatch_sbom-0.4.2.tar.gz |
|---|---|
| Size | 123.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6539360cae31e807be0154a292fea2d842a173b314ed567804044a5b1a7f3ce0
|
|
BLAKE2b-256 checksum How to use checksums |
4971d2a5b8ecf6d123f2c3c15ebff5af300702701f59ead3132ea08813acb4bf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 18, 2026.
Transparency logRelease files / hatch_sbom-0.4.2-py3-none-any.whl
| Download URL | hatch_sbom-0.4.2-py3-none-any.whl |
|---|---|
| Size | 13.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
99060f7a2003a5e42f564ed919512968f0a83288640989ddd31d4b6921570429
|
|
BLAKE2b-256 checksum How to use checksums |
07f73dc7691292396ec35490a5f52439b1bc7a058ed4b12c1c6c54c341d01356
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 18, 2026.
Transparency logSecurity for hatch-sbom 0.4.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for hatch_sbom-0.4.2.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 18, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.