Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
8525b2e
✨ feat(backends): support every build backend
gaborbernat Nov 9, 2026
44ecfbb
🔒 build(lock): add the backends the tests build with
gaborbernat Nov 9, 2026
3456413
📝 docs: restructure along Diátaxis
gaborbernat Nov 9, 2026
ccff6f0
🐛 fix(backends): close review gaps
gaborbernat Nov 9, 2026
99d2960
📝 docs: one page per Diátaxis quadrant
gaborbernat Nov 9, 2026
9bc5364
📝 docs: label sections instead of muting dupes
gaborbernat Nov 9, 2026
9e5d0f6
📝 docs: split each quadrant into sub-pages
gaborbernat Nov 9, 2026
49b57be
🐛 fix: address review on the backends PR
gaborbernat Nov 9, 2026
9aff04e
🐛 fix(ci): exempt nab where the lock check runs
gaborbernat Nov 9, 2026
2ef1850
🐛 fix(ci): exempt every nab 0.0.26 package
gaborbernat Nov 9, 2026
7efea6b
🎨 docs: add the python-sbom logo
gaborbernat Nov 9, 2026
18b8bb7
🐛 docs: show the README logo on every branch
gaborbernat Nov 9, 2026
d6a13a4
🎨 docs: space the logo's items, clear the favicon
gaborbernat Nov 9, 2026
ca92926
🎨 style(docs): recompose logo around the wheel
gaborbernat Nov 9, 2026
fd93fca
📝 docs: restyle landing page like simplint
gaborbernat Nov 9, 2026
2a4c7ab
♻️ refactor: regroup modules by concern
gaborbernat Nov 9, 2026
3f8b035
✅ test(model): cover graph, names and archive order
gaborbernat Nov 9, 2026
b90ca94
📝 docs: add glossary, drop code layout
gaborbernat Nov 9, 2026
30a0926
🎨 style(docs): set logo items in a triangle
gaborbernat Nov 9, 2026
3424e0d
💄 style(docs): show icon logo, label index Home
gaborbernat Nov 9, 2026
ebac62d
📝 docs: define abbreviations, link terms
gaborbernat Nov 9, 2026
a4b9229
💄 style(docs): clear the favicon's hexagon
gaborbernat Nov 9, 2026
75058eb
💄 style(docs): fill wide windows, then center
gaborbernat Nov 9, 2026
b2b23d7
🎨 style(docs): widen logo item gaps to 2px
gaborbernat Nov 9, 2026
4426281
📝 docs: make section titles unique and shorter
gaborbernat Nov 9, 2026
310317f
📝 docs: anchor labelled headings by their label
gaborbernat Nov 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/news.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,11 @@ jobs:
venv: ${{ runner.temp }}/release-tools
- name: 🔍 Validate changelog fragments
uses: tox-dev/github-workflows/validate-news@0c4cffd63033d38196319524d101caae1eef925b # 6.7.2
with:
exclude-newer-package: |
nab=2026-11-05T05:51:00Z
nab-index=2026-11-05T05:51:00Z
nab-markersets=2026-11-05T05:51:00Z
nab-project=2026-11-05T05:51:00Z
nab-provider=2026-11-05T05:51:00Z
nab-resolver=2026-11-05T05:51:00Z
68 changes: 44 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
<picture>
<source media="(prefers-color-scheme: dark)" srcset="docs/_static/logo-horizontal-dark.svg">
<img alt="python-sbom" src="docs/_static/logo-horizontal-light.svg" width="480">
</picture>

# python-sbom

[![PyPI](https://img.shields.io/pypi/v/python-sbom?style=flat-square)](https://pypi.org/project/python-sbom/)
Expand All @@ -7,45 +12,60 @@
[![Downloads](https://static.pepy.tech/badge/python-sbom/month)](https://pepy.tech/project/python-sbom)
[![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/tox-dev/python-sbom/badge)](https://scorecard.dev/viewer/?uri=github.com/tox-dev/python-sbom)

SBOMs for Python distributions. python-sbom writes a [CycloneDX](https://cyclonedx.org/) SBOM into every wheel you
build, where [PEP 770](https://peps.python.org/pep-0770/) tells installers to keep it. The SBOM records your project,
the runtime dependencies it declares, any wheels it bundles, and the build toolchain, and a rebuild with the same inputs
reproduces it byte for byte.
Software bills of materials (SBOMs) for Python distributions. python-sbom writes a [CycloneDX](https://cyclonedx.org/)
SBOM into every [wheel](https://packaging.python.org/en/latest/specifications/binary-distribution-format/) you build,
where [PEP 770](https://peps.python.org/pep-0770/) (a Python Enhancement Proposal) tells installers to keep it. The SBOM
records your project, the runtime dependencies it declares, any wheels it bundles, and the build toolchain, and a
rebuild with the same inputs reproduces it byte for byte.

## Install
## Use

A hatchling project names `python-sbom[hatch]` in its build requirements, as shown below. To embed an SBOM into a wheel
another backend built, install the command line into the environment that built the wheel, since the SBOM lists that
environment's packages as the build tools (or point `--build-env` at it):
python-sbom works with every [build backend](https://peps.python.org/pep-0517/). Pick the integration for yours:

```console
python -m pip install python-sbom
```
| Backend | Add to `[build-system] requires` | Turn it on |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------- | --------------------------------------------------------------------------------- |
| [hatchling](https://hatch.pypa.io/latest/) | `python-sbom[hatch]` | `[tool.hatch.build.hooks.python-sbom]` |
| [pdm-backend](https://backend.pdm-project.org/) | `python-sbom[pdm]` | `[tool.python-sbom]` |
| [setuptools](https://setuptools.pypa.io/) | `python-sbom[setuptools]` | `[tool.python-sbom]` |
| any other, such as [meson-python](https://mesonbuild.com/meson-python/), [maturin](https://www.maturin.rs/), [scikit-build-core](https://scikit-build-core.readthedocs.io/) or [flit-core](https://flit.pypa.io/) | `python-sbom` | `build-backend = "python_sbom.backend"`, and your backend in `[tool.python-sbom]` |

To convert and validate SBOMs in CI, a separate tool environment is fine:
With hatchling:

```console
pipx install 'python-sbom[validate]'
```
```toml
[build-system]
build-backend = "hatchling.build"
requires = ["hatchling>=1.28", "python-sbom[hatch]>=0.2"]

## Use
[tool.hatch.build.hooks.python-sbom]
```

With [hatchling](https://hatch.pypa.io/latest/), add the hook to the build requirements and enable it:
With meson-python, or any backend without a plugin, python-sbom wraps it:

```toml
[build-system]
build-backend = "hatchling.build"
requires = ["hatchling>=1.28", "python-sbom[hatch]>=0.1"]
build-backend = "python_sbom.backend"
requires = ["meson-python>=0.18", "python-sbom>=0.2"]

[tool.hatch.build.hooks.python-sbom]
[tool.python-sbom]
build-backend = "mesonpy"
```

With another build backend, such as meson-python, embed the SBOM after the build:
For a wheel built outside the build interface, such as with [`maturin build`](https://www.maturin.rs/), or renamed after
it by [`auditwheel repair`](https://github.com/pypa/auditwheel), embed the SBOM afterwards:

```console
python-sbom embed dist/*.whl
```

Describe another zip archive the project publishes, such as a zipapp, with `python-sbom archive`. The
[documentation](https://python-sbom.readthedocs.io) covers the options, adding project knowledge through a content
provider, rendering an SBOM as SPDX and validating it.
To convert and validate SBOMs in continuous integration (CI), install the command line in a tool environment of its own
with [pipx](https://pipx.pypa.io/) or [uv](https://docs.astral.sh/uv/):

```console
pipx install 'python-sbom[validate]'
python-sbom validate dist/
```

The [documentation](https://python-sbom.readthedocs.io) starts with a tutorial, then has a guide per backend, the
options and commands, and how the SBOM is built. It also covers describing a
[zipapp](https://docs.python.org/3/library/zipapp.html), adding project knowledge through a content provider, and
rendering an SBOM as [SPDX](https://spdx.dev/) (Software Package Data Exchange).
17 changes: 17 additions & 0 deletions docs/_static/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions docs/_static/logo-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions docs/_static/logo-horizontal-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions docs/_static/logo-horizontal-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions docs/_static/logo-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading