Skip to content

Commit cf6e2a7

Browse files
committed
DOC: minor tweak to docs on invoking pip/build
Addresses a comment on issue 704, where a user got tripped up by `python -m build` building an sdist first (and that's typically not what you want). Also fix up stray tab characters in how-to-guides/config-settings.rst
1 parent 19ebec5 commit cf6e2a7

File tree

3 files changed

+29
-25
lines changed

3 files changed

+29
-25
lines changed

docs/how-to-guides/config-settings.rst

+22-21
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,25 @@ the ``-C`` short command line option:
1919

2020
.. tab-set::
2121

22-
.. tab-item:: pypa/build
23-
:sync: key_pypa_build
22+
.. tab-item:: pypa/build
23+
:sync: key_pypa_build
2424

25-
.. code-block:: console
25+
.. code-block:: console
2626
27-
$ python -m build \
28-
-Csetup-args="-Doption=true" \
29-
-Csetup-args="-Dvalue=1" \
30-
-Ccompile-args="-j6"
27+
$ python -m build --wheel \
28+
-Csetup-args="-Doption=true" \
29+
-Csetup-args="-Dvalue=1" \
30+
-Ccompile-args="-j6"
3131
32-
.. tab-item:: pip
33-
:sync: key_pip
32+
.. tab-item:: pip
33+
:sync: key_pip
3434

35-
.. code-block:: console
35+
.. code-block:: console
3636
37-
$ python -m pip wheel . \
38-
--config-settings=setup-args="-Doption=disable" \
39-
--config-settings=compile-args="-j6"
37+
$ # note: for Pip <23.1, use `--config-settings=` instead of `-C`
38+
$ python -m pip wheel . \
39+
-Csetup-args="-Doption=disable" \
40+
-Ccompile-args="-j6"
4041
4142
4243
Refer to the `build`_ and `pip`_ documentation for details. This
@@ -73,19 +74,19 @@ user-specified build directory which will not be deleted. For example:
7374

7475
.. tab-set::
7576

76-
.. tab-item:: pypa/build
77-
:sync: key_pypa_build
77+
.. tab-item:: pypa/build
78+
:sync: key_pypa_build
7879

79-
.. code-block:: console
80+
.. code-block:: console
8081
81-
$ python -m build -Cbuild-dir=build
82+
$ python -m build --wheel -Cbuild-dir=build
8283
83-
.. tab-item:: pip
84-
:sync: key_pip
84+
.. tab-item:: pip
85+
:sync: key_pip
8586

86-
.. code-block:: console
87+
.. code-block:: console
8788
88-
$ python -m pip install . -Cbuild-dir=build
89+
$ python -m pip install . -Cbuild-dir=build
8990
9091
After running this command, the ``build`` directory will contain all
9192
the build artifacts and support files created by ``meson``, ``ninja``

docs/how-to-guides/meson-args.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ To set this option temporarily at build-time:
8383

8484
.. code-block:: console
8585
86-
$ python -m build -Csetup-args="--default-library=static" .
86+
$ python -m build -Csetup-args="--default-library=static" --wheel .
8787
8888
.. tab-item:: pip
8989
:sync: key_pip
@@ -125,7 +125,7 @@ To set this option temporarily at build-time:
125125

126126
.. code-block:: console
127127
128-
$ python -m build -Cinstall-args="--tags=runtime,python-runtime" .
128+
$ python -m build -Cinstall-args="--tags=runtime,python-runtime" --wheel .
129129

130130
.. tab-item:: pip
131131
:sync: key_pip
@@ -158,7 +158,7 @@ To set this option temporarily at build-time:
158158

159159
.. code-block:: console
160160
161-
$ python -m build -Csetup-args="-Doptimization=3" .
161+
$ python -m build -Csetup-args="-Doptimization=3" --wheel .
162162

163163
.. tab-item:: pip
164164
:sync: key_pip
@@ -199,7 +199,7 @@ To set this option temporarily at build-time:
199199

200200
.. code-block:: console
201201
202-
$ python -m build -Csetup-args="--vsenv" .
202+
$ python -m build -Csetup-args="--vsenv" --wheel .
203203

204204
.. tab-item:: pip
205205
:sync: key_pip

docs/tutorials/introduction.rst

+3
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,9 @@ dependencies, and ask ``meson-python`` to build the artifacts.
242242
$ python -m build
243243
244244
If the build succeeded, you'll have the binary artifacts in the ``dist`` folder.
245+
Note that by default, ``python -m build`` builds an sdist first, and then a
246+
wheel from the sdist. If you only want one artifact, add ``--sdist`` or
247+
``--wheel`` to the invocation.
245248

246249
.. admonition:: Building wheels for multiple platforms
247250
:class: tip

0 commit comments

Comments
 (0)