Skip to content

Commit b44a886

Browse files
henryiiigaborbernat
authored andcommitted
docs: more info in README
Signed-off-by: Henry Schreiner <[email protected]>
1 parent 8e19948 commit b44a886

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

README.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,66 @@ This will build the package in an isolated environment, generating a
3030
source-distribution and wheel in the directory `dist/`.
3131
See the [documentation](https://build.pypa.io) for full information.
3232

33+
### Common arguments
34+
35+
- `--sdist` (`-s`): Produce just an SDist
36+
- `--wheel` (`-w`): Produce just a wheel
37+
- `-C<option>=<value>`: A Config-setting, the PEP 517 way of passing options to a backend. Can be passed multiple times. Matching options will make a list. Note that setuptools has very limited support.
38+
- `--installer`: Pick an installer for the isolated build (`pip` or `uv`).
39+
- `--no-isolation` (`-n`): Disable build isolation.
40+
- `--skip-dependency-check` (`-x`): Disable dependency checking when not isolated; this should be done if some requirements or version ranges are not required for non-isolated builds.
41+
- `--outdir (`-o`): The output directory (defaults to `dist`)
42+
43+
Some common combinations of arguments:
44+
45+
- `--sdist --wheel` (`-sw`): Produce and SDist and a wheel, both from the source distribution. The default (if no flag is passed) is to build an SDist and then build a wheel _from_ the SDist.
46+
- `-nx`: Disable build isolation and dependency checking. Identical to pip and uv's `--no-build-isolation` flag.
47+
48+
### Integration with other tools
49+
50+
#### pipx
51+
52+
If you use [pipx][], such as in GitHub Actions, the following command will download
53+
and run build in one step:
54+
55+
```console
56+
$ pipx run build
57+
```
58+
59+
#### uv
60+
61+
If you want to use [uv][] to speed up the virtual environment creation, you can use
62+
`--installer=uv`. You can get a Python wheel for `uv` with the `[uv]` extra.
63+
Combining both suggestions yields the following:
64+
65+
```console
66+
$ pipx run build[uv] --installer=uv
67+
```
68+
69+
#### cibuildwheel
70+
71+
If you are using [cibuildwheel][], build is integrated and can be use with either (in your `pyproject.toml`):
72+
73+
```toml
74+
[tool.cibuildwheel]
75+
build-frontend = "build"
76+
```
77+
78+
or
79+
80+
```toml
81+
[tool.cibuildwheel]
82+
build-frontend = "build[uv]"
83+
```
84+
85+
(Be sure to pre-install uv before running cibuildwheel for this one!)
86+
3387
### Code of Conduct
3488

3589
Everyone interacting in the build's codebase, issue trackers, chat rooms, and mailing lists is expected to follow
3690
the [PSF Code of Conduct].
3791

3892
[psf code of conduct]: https://github.com/pypa/.github/blob/main/CODE_OF_CONDUCT.md
93+
[pipx]: https://pipx.pypa.io
94+
[uv]: https://docs.astral.sh/uv/
95+
[cibuildwheel]: https://cibuildwheel.pypa.io

0 commit comments

Comments
 (0)