Use it with flit-core¶
flit-core has no plugin interface, so its projects get the SBOM through the wrapper backend. Make
python_sbom.backend the project’s backend, keep flit-core in the build requirements, and name flit_core.buildapi
in [tool.python-sbom] build-backend:
pyproject.toml¶
[build-system]
build-backend = "python_sbom.backend"
requires = [ "flit-core>=3.12", "python-sbom>=0.3" ]
[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 = "flit_core.buildapi"
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/flit-core holds the whole project. Use it with any other backend describes what the wrapper does with each hook.