Skip to content

📚 docs: reorganize using Diataxis framework#988

Merged
gaborbernat merged 4 commits intopypa:mainfrom
gaborbernat:docs/diataxis-reorganization
Mar 7, 2026
Merged

📚 docs: reorganize using Diataxis framework#988
gaborbernat merged 4 commits intopypa:mainfrom
gaborbernat:docs/diataxis-reorganization

Conversation

@gaborbernat
Copy link
Contributor

@gaborbernat gaborbernat commented Mar 4, 2026

This reorganization adopts the Diataxis framework to provide clear pathways for different documentation needs. 📚 The framework separates content into tutorials for learning-oriented tasks, how-to guides for problem-solving, reference material for technical specifications, and explanations for understanding core concepts. This structure helps users navigate directly to the information they need based on their current goal.

The documentation now addresses common questions identified from the issue tracker, including workflows for corporate environments with private indexes, debugging techniques using backend logs and temporary directories, and programmatic API usage patterns. Technical terms throughout link to packaging.python.org specifications and Python documentation, providing context without requiring prior packaging knowledge. 🔗

Documentation quality tools docstrfmt and proselint are integrated into the build process through tox, matching virtualenv's approach and maintaining consistent formatting and prose quality in CI. The environment variables reference has been reorganized into logical sections with descriptive introductions for common use cases like ccache integration and corporate proxy configuration.

Preview: https://pypa-build--988.org.readthedocs.build/en/988/

Closes #517, #725, #727, #409, #482, #268, #438, #966, #310, #439, #655, #729, #198, #485, #640

@gaborbernat gaborbernat added the documentation Improvements or additions to documentation label Mar 4, 2026
@gaborbernat gaborbernat force-pushed the docs/diataxis-reorganization branch 3 times, most recently from 6e906fb to e1b2b00 Compare March 4, 2026 04:37
@gaborbernat gaborbernat enabled auto-merge (squash) March 4, 2026 04:41
@gaborbernat gaborbernat force-pushed the docs/diataxis-reorganization branch 4 times, most recently from 2798431 to fb091c3 Compare March 4, 2026 04:50
Restructure documentation following the Diataxis framework with four distinct sections: tutorials for learning, how-to guides for solving problems, reference for technical details, and explanation for understanding concepts.

New documentation:
- tutorial/getting-started.rst - complete beginner tutorial
- how-to/basic-usage.rst - common workflows and commands
- how-to/config-settings.rst - backend configuration examples (addresses pypa#517)
- how-to/corporate-environments.rst - proxy, SSL, private indexes (addresses pypa#725, pypa#727, pypa#409, pypa#482)
- how-to/choosing-tools.rst - when to use build vs other tools (addresses pypa#268)
- how-to/troubleshooting.rst - common issues and solutions
- how-to/ci-cd.rst - CI/CD integration examples
- reference/cli.rst - command-line interface documentation
- reference/environment-variables.rst - environment variable reference
- explanation/how-it-works.rst - build process internals
- explanation/build-backends.rst - backend concepts and selection
- development/contributing.rst - contribution guidelines

Moved existing files to appropriate Diataxis sections:
- installation.rst → how-to/install.rst
- mission.rst → explanation/mission.rst
- differences.rst → explanation/differences.rst
- api.rst → reference/api.rst
- test_suite.rst → development/test-suite.rst
- release.rst → development/release.rst

Updated conf.py to add sphinx-copybutton and sphinx-inline-tabs extensions for better documentation formatting.

Signed-off-by: Bernát Gábor <bgabor8@bloomberg.net>
@gaborbernat gaborbernat force-pushed the docs/diataxis-reorganization branch from fb091c3 to b29c121 Compare March 4, 2026 05:03
@gaborbernat gaborbernat changed the title 📝 docs: reorganize documentation following Diataxis framework 📚 docs: reorganize using Diataxis framework Mar 4, 2026
- Fix API metadata example - builder.metadata doesn't exist, use metadata_path()
- Clarify TMPDIR behavior - directory is cleaned up after success, persists on failure
- Add note about backend availability requirement for API examples

Signed-off-by: Bernát Gábor <bgabor8@bloomberg.net>
@gaborbernat gaborbernat force-pushed the docs/diataxis-reorganization branch from 2cf3fad to e75ed2e Compare March 4, 2026 05:34
@henryiii
Copy link
Contributor

henryiii commented Mar 4, 2026

Just have time to review page 1: I don't like a few things about the comparisons to other tools.

offers additional options like --no-isolation for advanced use cases

So does uv build , it's just called --no-build-isolation. I'd highlight something like our --config-json support instead.

build is roughly the equivalent of setup.py sdist bdist_wheel but with PEP 517 support

I'd rather this be rewritten to be something more like "build is the modern equivalent of this, but supporting any backend" (also I think we are avoiding mentioning PEPs all the time).

I think I'd not mention pep517.build at all.

I like comparing to other tools, but this is also 50% of the first page on build, and one key takeaway is due to standardization, all these tools do the same thing.

We are "better" (sort of) than flit build, since flit-core doesn't build the same SDist if it's being built by flit, vs. all other tools. So supporting build means you support everyone. :)

cibuildwheel might be another to compare to - that's actually different, and people do get confused on that one.

@gaborbernat
Copy link
Contributor Author

Yeah a lot of them were there before, tried to update as much as I could think, but likely could do a bit more, incorporating your first round of feedback.

Reviewer pointed out that the uv build comparison incorrectly claimed
--no-isolation as a differentiator (uv has --no-build-isolation), and that
the pep517.build section was unnecessary. Also suggested adding flit build
and cibuildwheel comparisons since users frequently confuse these tools.

Replaced --no-isolation with --config-json as a differentiator, rewrote the
setup.py comparison to avoid PEP references, removed pep517.build, added
flit build (sdist consistency benefit) and cibuildwheel (different tool
category), and framed the section with a note that standardization means
all frontends produce the same outputs.
@henryiii
Copy link
Contributor

henryiii commented Mar 6, 2026

Last suggestion on the difference in the main page:

uv build is essentially equivalent to python -m build --installer=uv. Both follow packaging standards. build offers features like --config-json for passing complex nested configuration to backends, and the pip installer works on systems that don't have pre-compiled uv wheels.

And the other pages:

Installation: conda - I think making this tabbed, and showing mamba/micromamba/pixi would be nice. Can easily be a followup and I don't mind doing it.

Basic usage: "This is equivalent to:" is wrong. It is not equivalent to that at all, though it usually produces the same outputs. The first example builds an SDist then a wheel from it, the second example builds a wheel from source instead.

CI/CI: For the manual build example (and ci in general if it's installing stuff), I'd use pipx, since it's a supported package manager on all GitHub Actions images.

Backend configuration: I wonder if it's worth mentioning that setuptools doesn't support -C very well; anything there gets passed to all commands, not just relevant ones, meaning it's not always possible to control setuptools correctly via -C. Maybe not worth mentioning though.

Troubleshooting: No need to install wheel.

Environment variables: These are pip specific. uv installer has different ones. Might be worth toggles, or a mention, or something.

Reword uv build comparison per reviewer suggestion highlighting pip
availability on systems without pre-compiled uv wheels. Fix incorrect
equivalence claim between default build and --sdist --wheel (they
differ: default builds wheel from sdist, explicit flags build both
from source). Use pipx in CI manual example since it's pre-installed
on GitHub Actions runners. Remove unnecessary wheel package from
install commands. Add note that PIP_* env vars are pip-specific and
link to uv's environment variables for --installer=uv users.
@gaborbernat gaborbernat merged commit a77870d into pypa:main Mar 7, 2026
63 of 64 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docs need better examples of how to use --config-setting

4 participants