Use it with uv-build¶
uv_build has no plugin interface, so its projects get the SBOM through the wrapper backend. Make
python_sbom.backend the project’s backend, keep uv-build in the build requirements, and name uv_build in
[tool.python-sbom] build-backend:
pyproject.toml¶
[build-system]
build-backend = "python_sbom.backend"
requires = [ "python-sbom>=0.3", "uv-build>=0.9" ]
[project]
name = "greet"
version = "1.0"
description = "says hello"
license = "MIT"
requires-python = ">=3.11"
classifiers = [
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: 3.15",
]
dependencies = [ "packaging>=24" ]
[tool.python-sbom]
build-backend = "uv_build"
supplier = { name = "You", url = [ "https://github.com/you" ] }
Then build a wheel and check it:
$ python -m build --wheel
$ python-sbom validate dist/
SBOM in greet-1.0-py3-none-any.whl is valid
docs/examples/uv-build holds the whole project. Use it with any other backend describes what the wrapper does with each hook.
Pitfall: uv build without the wrapper¶
uv build builds a uv_build project in its own process when uv_build is the backend, so no build hook runs. With
the wrapper as the backend, uv calls the build interface, and the wrapper runs.