Skip to content

Commit ad68bf0

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 2a4e398 commit ad68bf0

File tree

3 files changed

+18
-15
lines changed

3 files changed

+18
-15
lines changed

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

Lines changed: 8 additions & 9 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,12 +34,11 @@ the ``-C`` short command line option:
3434

3535
.. code-block:: console
3636
37-
$ python -m pip wheel . \
37+
$ python -m pip wheel . \
3838
-Csetup-args="-Doption=true" \
3939
-Csetup-args="-Dvalue=1" \
4040
-Ccompile-args="-j6"
4141
42-
4342
Refer to the `build`_ and `pip`_ documentation for details. This
4443
example uses the ``python -m pip wheel`` command to build a Python wheel
4544
that can be later installed or distributed. To build a package and
@@ -76,18 +75,18 @@ For example:
7675
.. tab-set::
7776

7877
.. tab-item:: pypa/build
79-
:sync: key_pypa_build
78+
:sync: key_pypa_build
8079

81-
.. code-block:: console
80+
.. code-block:: console
8281
83-
$ python -m build -Cbuild-dir=build
82+
$ python -m build --wheel -Cbuild-dir=build
8483
8584
.. tab-item:: pip
86-
:sync: key_pip
85+
:sync: key_pip
8786

88-
.. code-block:: console
87+
.. code-block:: console
8988
90-
$ python -m pip install . -Cbuild-dir=build
89+
$ python -m pip install . -Cbuild-dir=build
9190
9291
After running this command, the ``build`` directory will contain all
9392
the build artifacts and support files created by ``meson``, ``ninja``

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

Lines changed: 5 additions & 5 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 --wheel -Csetup-args="--default-library=static" .
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 --wheel -Cinstall-args="--tags=runtime,python-runtime" .
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 --wheel -Csetup-args="-Doptimization=3" .
162162
163163
.. tab-item:: pip
164164
:sync: key_pip
@@ -199,11 +199,11 @@ 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 --wheel -Csetup-args="--vsenv" .
203203
204204
.. tab-item:: pip
205205
:sync: key_pip
206206

207207
.. code-block:: console
208208
209-
$ python -m pip wheel -Csetup-args="--vsenv" .
209+
$ python -m pip wheel -Csetup-args="--vsenv" .

docs/tutorials/introduction.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,8 @@ Building the project
228228

229229
Before continuing, ensure you have committed the three files we created so far
230230
to your Git repository - ``meson-python`` will only take into account the files
231-
that Git knows about.
231+
that Git knows about, and an sdist is created from the most recent commit -
232+
uncommitted changes are ignored.
232233

233234
To generate the distribution artifacts we will use the `pypa/build`_ tool. It
234235
will create a temporary virtual environment, install all the required build
@@ -240,6 +241,9 @@ dependencies, and ask ``meson-python`` to build the artifacts.
240241
$ python -m build
241242
242243
If the build succeeded, you'll have the binary artifacts in the ``dist`` folder.
244+
Note that by default, ``python -m build`` builds an sdist first, and then a
245+
wheel from the sdist. If you only want one artifact, add ``--sdist`` or
246+
``--wheel`` to the invocation.
243247

244248
.. admonition:: Building wheels for multiple platforms
245249
:class: tip

0 commit comments

Comments
 (0)