Repository navigation
✨ feat(backends): support every build backend - #7
Merged
Merged
Conversation
Split the pages into a tutorial, a how-to guide per build backend and task, reference and explanation, and document the new backend integrations. Lint every page with proselint, not only the top-level ones.
- add_to_sdist closes the sdist before replacing it, which Windows requires, and leaves the file name out of the gzip header so a rewrite reproduces - the pdm hook writes the sdist revision outside pdm-backend's build directory, whose .gitignore otherwise lands in the sdist - the setuptools plugin fails when [tool.setuptools.cmdclass] replaces bdist_wheel or sdist, instead of building a wheel with no SBOM - the docs drop the in-tree backend claim, since frontends refuse the wrapper under backend-path, and tell setuptools users to ignore build/ and the egg-info directory
Documentation build overview
31 files changed ·
|
Follow sphinx-autodoc-typehints' layout: a landing page with install steps and cards into each quadrant, then a single tutorials, how-to, reference and concepts page each. The architecture diagram now follows one build instead of every import between subpackages, which made it unreadable.
Keep autosectionlabel at two levels, where every heading is unique, and give the three deeper sections the index links to explicit labels. The changelog's category headings rely on towncrier's own release labels.
One page per quadrant grew too long to scan. Each quadrant is now a section with an index that lists one page per guide, reference topic or concept, under the same landing page.
- filter setuptools-scm's file finder warning in the setuptools tests, which fail in the dev environment where hatch-vcs pulls it in - build a wheel from the wrapper's and the setuptools plugin's sdist and check its SBOM names the commit, as the pdm test does - keep module docstrings to one line; the guides carry the usage - wrap the docs at 120 characters - exempt nab 0.0.26, which the lock pins, from the News job's cooldown
validate-news runs the nested lock check with its own cutoff input, so the exemption belongs there, not on install-locked-tools.
nab 0.0.26 pins nab-index, nab-markersets, nab-project, nab-provider and nab-resolver at the same release, all uploaded with it.
Light and dark logos in the docs sidebar, a favicon, and the horizontal logo at the top of the README. The theme colors are written into each SVG, since CSS variables in presentation attributes do not render everywhere.
Point the README at the logo by relative path, which GitHub resolves on the branch being viewed, and rewrite it to the default branch's raw URL for the PyPI description.
The document, package and check no longer overlap: each sits 1px apart at the logo's 512px size, centered in the hexagon. The favicon drops its white tile and keeps a transparent background.
JSON loading moves to _formats, so the spdx command no longer imports validation. RECORD parsing joins the model, sdist rewriting joins _wheel, the document header and reference checks merge into _bom, and script_tool moves next to the other build tools. Wheel tests move from test_bom to test_wheel to mirror the source.
A glossary page defines the terms the docs use and shows how they relate. The architecture page and the contributing guide no longer list module and test paths, which went stale with each refactor; the contributing guide states the guarantees as behavior instead.
Each page links the first mention of a glossary term and of every external project, so readers who land on a page directly can look up what an abbreviation means. The glossary expands each abbreviation and links its specification; the README spells them out inline.
gaborbernat
marked this pull request as ready for review
November 9, 2026 19:53
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
python-sbom wrote PEP 770 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
python_sbom.backend, with optional hooks present only when the wrapped backend has them, behaves like the wrapped backend for pip, uv andbuild.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.build.hookentry point group.setuptools.finalize_distribution_optionsgroup, the onesetuptools-scmuses. It wraps the project'sbdist_wheelandsdistcommands, including subclasses passed tosetup(cmdclass=...).python_sbom.backend, a PEP 517 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.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 buildrun bymaturin-action, and wheels thatauditwheel repairordelocaterename afterwards still needpython-sbom embedas the last step. A backend in the project's own tree can't be wrapped, because frontends load only a backend found on itsbackend-path.setuptools applies
[tool.setuptools.cmdclass]after plugins run, so abdist_wheelorsdistnamed 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, grouped by Diátaxis 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, and the logo puts the SBOM document above the package it describes.
This adds the
python-sbom[pdm]andpython-sbom[setuptools]extras. The docs ask for>=0.2, so this should ship as 0.2.0.