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.1.2
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.2.0
Choose a head ref
  • 2 commits
  • 81 files changed
  • 2 contributors

Commits on Nov 9, 2026

  1. ✨ feat(backends): support every build backend (#7)

    python-sbom wrote [PEP 770](https://peps.python.org/pep-0770/) SBOMs
    only for hatchling projects. This PR adds pdm-backend, setuptools,
    meson-python, maturin, scikit-build-core, flit-core, poetry-core and
    uv_build, so projects on those backends can ship an SBOM in their wheels
    too. 📦
    
    ### Review focus
    
    - Whether forwarding hooks through `python_sbom.backend`, with optional
    hooks present only when the wrapped backend has them, behaves like the
    wrapped backend for pip, uv and `build`.
    - Whether the setuptools plugin should wrap commands, or setuptools
    projects should use the wrapper backend instead.
    - Whether the new docs layout reads well; the
    [preview](https://python-sbom--7.org.readthedocs.build/en/7/) has it.
    
    ### Architecture
    
    Each backend gets the lightest integration it allows. All of them read
    the same `[tool.python-sbom]` table and write the same document:
    
    - pdm-backend: a build hook in its
    [`pdm.build.hook`](https://backend.pdm-project.org/hooks/) entry point
    group.
    - setuptools: a plugin in the `setuptools.finalize_distribution_options`
    group, the one `setuptools-scm` uses. It wraps the project's
    `bdist_wheel` and `sdist` commands, including subclasses passed to
    `setup(cmdclass=...)`.
    - The rest: `python_sbom.backend`, a [PEP
    517](https://peps.python.org/pep-0517/) backend that wraps the one named
    in `[tool.python-sbom] build-backend`. It forwards each hook unchanged,
    offers an optional hook only when the wrapped backend has it, and writes
    the SBOM once the wheel exists.
    
    pdm-backend and setuptools load any plugin installed in the build
    environment, so for them the `[tool.python-sbom]` table is what turns
    python-sbom on. Each integration also records the source revision in the
    sdists it builds, so a wheel built later from that sdist still names its
    commit.
    
    ```mermaid
    flowchart LR
        F[Frontend: pip, uv, build] --> H[hatchling hook]
        F --> P[pdm-backend hook]
        F --> S[setuptools plugin]
        F --> W[python_sbom.backend]
        W --> B[meson-python, maturin, scikit-build-core, ...]
        H & P & S & W --> D[Same SBOM document]
        classDef accent fill:#cfe4ff,stroke:#1f6feb,color:#0b1f3a;
        classDef warn fill:#ffe3a3,stroke:#d29200,color:#3a2c00;
        class F,B accent;
        class H,P,S,W,D warn;
    ```
    
    ### Limits
    
    Wheels built outside the build interface, such as `maturin build` run by
    [`maturin-action`](https://github.com/PyO3/maturin-action), and wheels
    that `auditwheel repair` or `delocate` rename afterwards still need
    `python-sbom embed` as the last step. A backend in the project's own
    tree can't be wrapped, because frontends load only a backend found on
    its `backend-path`.
    
    setuptools applies `[tool.setuptools.cmdclass]` after plugins run, so a
    `bdist_wheel` or `sdist` named there would replace the plugin's command
    and drop the SBOM. The plugin stops such a build with an error.
    
    ### Docs
    
    The docs now follow the layout of
    [sphinx-autodoc-typehints](https://sphinx-autodoc-typehints.readthedocs.io/en/latest/index.html),
    grouped by [Diátaxis](https://diataxis.fr/) quadrant. A landing page
    with install steps and cards leads to a section per quadrant, each with
    an index page and one page per guide, reference topic or concept. A
    glossary defines the terms and how they relate, and the architecture
    page traces one build instead of listing modules, so a refactor no
    longer leaves it stale. The theme, landing page and copy buttons follow
    [simplint](https://github.com/tox-dev/simplint), and the logo puts the
    SBOM document above the package it describes.
    
    This adds the `python-sbom[pdm]` and `python-sbom[setuptools]` extras.
    The docs ask for `>=0.2`, so this should ship as 0.2.0.
    gaborbernat authored Nov 9, 2026
    Configuration menu
    Copy the full SHA
    f56c81b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a3ecc8d View commit details
    Browse the repository at this point in the history
Loading