Languages

SBOMs for Python

sbombox generate uses uv export when uv.lock is committed and cyclonedx-py for Poetry, Pipenv and pip projects. Dev dependencies are left out for uv. This page covers that path, the manual commands and the gaps to know about.

At a glance

Python package managers and how SBOMBox handles them
Package managerBuilt-in SBOM commandWhat sbombox generate runsLockfile to commit
uv 0.9.11+Yes, uv export --format cyclonedx1.5 (preview)uv export, then cyclonedx-py, then cdxgen or syftuv.lock
pipNocyclonedx-py requirements, then cdxgen or syftrequirements.txt with pinned (==) versions
PoetryNocyclonedx-py poetry, then cdxgen or syftpoetry.lock
PipenvNocyclonedx-py pipenv, then cdxgen or syftPipfile.lock
PDMNocyclonedx-py on the dependencies declared in pyproject.toml (direct only)pdm.lock, plus an exported requirements.txt (see below)

For cyclonedx-py, SBOMBox picks the input in this order: poetry.lock, Pipfile.lock, requirements.txt, uv.lock (converted to pinned requirements with uv export), then [project].dependencies in pyproject.toml.

Generate with SBOMBox

The installer adds the CLI, syft and cyclonedx-py. Run the CLI from the directory that holds pyproject.toml and the lockfile. See Install.

curl -fsSL https://sbombox.com/install.sh | sh

sbombox generate -o sbom.json
sbombox score sbom.json

The CLI prints which tool ran, for example Detected: pypi - generated with uv export. Add --upload to upload in the same step, or use sbombox check --fail-under 7 to gate a commit without uploading.

For uv, SBOMBox runs uv export with --frozen --all-packages --no-dev, so the lockfile is not changed, every workspace member is included and dev dependencies are left out. uv records SHA-256 digests only on each component's distribution links. SBOMBox promotes the sdist digest (or a lone wheel's) to the component hash.

To pin the choice, set SBOMBOX_GENERATOR to one or more generator names, comma-separated. SBOMBox tries them in that order and skips any that are not installed. An unknown name fails with the list of valid names.

SBOMBOX_GENERATOR=cyclonedx-py,syft sbombox generate -o sbom.json

Valid names for Python: uv-cyclonedx, cyclonedx-py (alias pypi), cdxgen, syft.

Use the package manager's own tool

uv 0.9.11 or later. CycloneDX export is still a uv preview feature. uv 0.12 prints a warning that it is experimental and may change; --preview-features sbom-export silences it. With --output-file, uv also echoes the SBOM to stdout, so redirect stdout in scripts.

uv export --format cyclonedx1.5 --frozen --all-packages --no-dev --output-file sbom.json > /dev/null

Measured on 16 November 2026 with uv 0.12 on a 97-package workspace: the raw uv export output scored 4.8/10 (F). It has a full dependency graph but no component hashes, licenses or supplier. Through sbombox generate the same project scored 6.6/10 (D), with 92 of 97 components hashed. Licenses and supplier are still missing. cyclonedx-py on the same requirements scored 4.5/10 and had no dependency graph.

To add license data, build the SBOM from an installed production environment. cyclonedx-py reads each installed package's metadata:

uv sync --frozen --no-dev
cyclonedx-py environment --pyproject pyproject.toml -o sbom.json .venv/bin/python

pip. pip has no SBOM command. Pin every version, then use cyclonedx-py:

cyclonedx-py requirements --pyproject pyproject.toml -o sbom.json requirements.txt

Poetry. Poetry has no SBOM command. --only main keeps dev and other groups out:

cyclonedx-py poetry --only main -o sbom.json .

Pipenv. Pipenv has no SBOM command. cyclonedx-py reads only the default packages unless you pass -d:

cyclonedx-py pipenv -o sbom.json .

PDM. PDM has no SBOM command, and cyclonedx-py does not read pdm.lock. Export pinned production requirements first. sbombox generate then picks up requirements.txt.

pdm export -f requirements -o requirements.txt --prod
sbombox generate -o sbom.json

Then, for a file made by any of these tools:

# See what lowers the score
sbombox score sbom.json --format detailed

# Check a ruleset, e.g. EU Cyber Resilience Act readiness
sbombox compliance sbom.json -p cra-readiness

# Upload it to the active project, labelled with the release
sbombox push sbom.json --version v1.4.0

SBOMs inside wheels (PEP 770)

PEP 770 defines a place for SBOMs inside a wheel: .dist-info/sboms/. auditwheel 6.5 and later writes one for the system libraries it bundles, and Hatch's wheel builder has an sbom-files option for including your own. This is useful for consumers of your package. For your own release evidence, keep generating an SBOM of the application as above.

Monorepos and workspaces

Known gaps and how SBOMBox handles them

Gaps in Python SBOM tooling
GapEffectWhat SBOMBox does
uv puts digests only on distribution linksNo component hashesPromotes the sdist (or lone wheel) SHA-256 to the component hash
uv export has no licenses or supplierLicense and supplier checks failReports them; build from an installed environment for licenses
uv workspace root exports nothing without --all-packagesEmpty SBOMAlways passes --all-packages; an empty result falls through to the next tool
Older uv has no CycloneDX exportBuilt-in not availableConverts uv.lock to pinned requirements and runs cyclonedx-py
cyclonedx-py poetry follows Poetry's default groupsNon-optional groups such as dev can be includedRuns it with defaults; use --only main yourself for a strict release SBOM
cyclonedx-py does not read pdm.lockDirect dependencies only, unpinnedUses requirements.txt when present; export one with pdm export

Troubleshooting

Common Python errors
SymptomCauseFix
uv.lock is out of date. Run uv lock, commit uv.lock, and try again.pyproject.toml changed after the lockRun uv lock, commit uv.lock, run again
Generator cyclonedx-py failed: no requirements.txt, poetry.lock, Pipfile.lock, uv.lock or pyproject.toml found.No Python manifest in the scanned directoryRun from the project root, or pass --dir
No lockfile for pypi: transitive dependencies may be missing and versions may be guessed.No lockfile committedCommit uv.lock, poetry.lock, Pipfile.lock, pdm.lock or a pinned requirements.txt
Generator uv export produced an SBOM with no components.uv found nothing to exportCheck uv.lock is committed; SBOMBox moves on to the next tool
Components with no versionUnpinned requirements.txt or PDM project without an exportPin with ==, or export with pdm export
Warning that --format=cyclonedx1.5 is experimentalCycloneDX export is a uv preview featureSafe to ignore, or pass --preview-features sbom-export

In CI, run the same commands. See GitHub Actions, GitLab CI, Jenkins, Azure Pipelines, Bitbucket Pipelines or CircleCI, or use the GitHub Action.

Frequently asked questions

Does pip have an SBOM command?

No. Use a pinned requirements.txt with sbombox generate or cyclonedx-py requirements.

Why is my uv SBOM scored lower than npm?

uv does not record licenses or supplier. Build from an installed environment with cyclonedx-py environment to add licenses.