Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: tox-dev/python-sbom
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0.2.0
Choose a base ref
...
head repository: tox-dev/python-sbom
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 0.3.0
Choose a head ref
  • 2 commits
  • 144 files changed
  • 2 contributors

Commits on Nov 9, 2026

  1. ✨ feat(sbom): link and check other tools' SBOMs (#8)

    Wheels built with [maturin](https://www.maturin.rs/sbom) or repaired
    with [auditwheel](https://github.com/pypa/auditwheel) already carry an
    SBOM of their own: maturin lists the Rust crates, auditwheel the system
    libraries it bundled. python-sbom's SBOM sat next to them without naming
    them, and `python-sbom validate` skipped maturin's `.cyclonedx.json`
    file, reporting "no SBOM found" on a wheel that held one. 🔗
    
    Now the SBOM python-sbom writes links to every other file in the wheel's
    `.dist-info/sboms/` directory, so a scanner reading it can find the Rust
    crates or bundled libraries too. `validate` checks maturin's file
    alongside the `.cdx.json` ones.
    
    The how-to guides gain a backends section with one page per build
    backend: hatchling, pdm-backend, setuptools, meson-python,
    scikit-build-core, maturin, flit-core, poetry-core and uv-build, plus
    the wrapper page for any other. Each page pulls its code from an example
    project under `docs/examples/`, and one tox environment per backend
    (`tox r -e example-maturin`, or `tox r -m examples` for all) builds that
    project and compares python-sbom's output with what the page shows. CI
    runs them, so a page that drifts from the code fails the check. 📚
    
    ### Architecture
    
    When python-sbom reads a wheel, it now also collects the other files
    under `sboms/` with their SHA-256, leaving out python-sbom's own so a
    second `embed` does not link to the copy it replaces. The root component
    gets one CycloneDX `bom` external reference per file: a URL relative to
    its own SBOM, which sits in the same directory, plus the file's digest,
    so a reader can tell whether a later step changed it. The links are
    format-agnostic, so an SPDX file gets linked too; `validate` still
    checks CycloneDX files alone.
    
    ### Impact
    
    I checked two wheels from PyPI. On peryx 2026.1104.0, `validate` now
    passes and checks maturin's SBOM. On pipdeptree 4.2.14's musllinux wheel
    it now fails: the `auditwheel.cdx.json` that auditwheel 6.8.2 wrote
    lists the root package twice under the same `bom-ref`, which CycloneDX
    forbids, because auditwheel puts [the same
    component](https://github.com/pypa/auditwheel/blob/bf54f3b4e8ef5de1db9e117b5920f50978674ad1/src/auditwheel/sboms.py#L45-L66)
    in both `metadata.component` and `components`. The auditwheel example
    hits the same failure, and its page says so. I reported it as
    [pypa/auditwheel#750](pypa/auditwheel#750).
    Until auditwheel fixes it, `validate` fails on wheels where auditwheel
    copied in a library and wrote its SBOM.
    
    The backend guides moved from `how-to/<backend>` to
    `how-to/backends/<backend>`, so links to the old pages on Read the Docs
    break unless the project adds redirects there. The delocate example runs
    only on the macOS job, and the test compares output with the wheel tags
    masked, so the macOS wheel name its page shows is not checked.
    gaborbernat authored Nov 9, 2026
    Configuration menu
    Copy the full SHA
    0c2f96f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    775b5be View commit details
    Browse the repository at this point in the history
Loading