Skip to content

Commit 0e1ee55

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).
1 parent 19ebec5 commit 0e1ee55

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ the ``-C`` short command line option:
2424

2525
.. code-block:: console
2626
27-
$ python -m build \
27+
$ python -m build --wheel \
2828
-Csetup-args="-Doption=true" \
2929
-Csetup-args="-Dvalue=1" \
3030
-Ccompile-args="-j6"
@@ -34,6 +34,7 @@ the ``-C`` short command line option:
3434

3535
.. code-block:: console
3636
37+
$ # note: pip >=23.1 also accepts -C instead of --config-settings
3738
$ python -m pip wheel . \
3839
--config-settings=setup-args="-Doption=disable" \
3940
--config-settings=compile-args="-j6"
@@ -78,7 +79,7 @@ user-specified build directory which will not be deleted. For example:
7879

7980
.. code-block:: console
8081
81-
$ python -m build -Cbuild-dir=build
82+
$ python -m build --wheel -Cbuild-dir=build
8283
8384
.. tab-item:: pip
8485
:sync: key_pip

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

Lines changed: 4 additions & 4 deletions
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

Lines changed: 3 additions & 0 deletions
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)