2014-02-12 06:55:43 +01:00
|
|
|
|
|
|
|
.. _`pip wheel`:
|
|
|
|
|
2020-02-11 12:37:58 +01:00
|
|
|
=========
|
2014-02-12 06:55:43 +01:00
|
|
|
pip wheel
|
2020-02-11 12:37:58 +01:00
|
|
|
=========
|
2014-02-12 06:55:43 +01:00
|
|
|
|
2017-11-12 17:04:37 +01:00
|
|
|
.. contents::
|
|
|
|
|
2020-02-11 14:05:28 +01:00
|
|
|
|
2014-02-12 06:55:43 +01:00
|
|
|
Usage
|
2020-02-11 14:00:03 +01:00
|
|
|
=====
|
2014-02-12 06:55:43 +01:00
|
|
|
|
2020-08-06 22:06:10 +02:00
|
|
|
.. tabs::
|
|
|
|
|
|
|
|
.. group-tab:: Unix/macOS
|
|
|
|
|
|
|
|
.. pip-command-usage:: wheel "python -m pip"
|
|
|
|
|
|
|
|
.. group-tab:: Windows
|
|
|
|
|
|
|
|
.. pip-command-usage:: wheel "py -m pip"
|
2014-02-12 06:55:43 +01:00
|
|
|
|
|
|
|
|
|
|
|
Description
|
2020-02-11 14:00:03 +01:00
|
|
|
===========
|
2014-02-12 06:55:43 +01:00
|
|
|
|
|
|
|
.. pip-command-description:: wheel
|
|
|
|
|
|
|
|
|
2014-03-25 22:56:46 +01:00
|
|
|
Build System Interface
|
2020-02-11 14:00:03 +01:00
|
|
|
----------------------
|
2014-03-25 22:56:46 +01:00
|
|
|
|
|
|
|
In order for pip to build a wheel, ``setup.py`` must implement the
|
2020-08-06 22:06:10 +02:00
|
|
|
``bdist_wheel`` command with the following syntax:
|
|
|
|
|
|
|
|
.. tabs::
|
|
|
|
|
|
|
|
.. group-tab:: Unix/macOS
|
|
|
|
|
|
|
|
.. code-block:: shell
|
|
|
|
|
2020-08-16 20:07:09 +02:00
|
|
|
python setup.py bdist_wheel -d TARGET
|
2020-08-06 22:06:10 +02:00
|
|
|
|
|
|
|
.. group-tab:: Windows
|
|
|
|
|
|
|
|
.. code-block:: shell
|
|
|
|
|
2020-08-16 20:07:09 +02:00
|
|
|
py setup.py bdist_wheel -d TARGET
|
2014-03-25 22:56:46 +01:00
|
|
|
|
|
|
|
|
|
|
|
This command must create a wheel compatible with the invoking Python
|
|
|
|
interpreter, and save that wheel in the directory TARGET.
|
|
|
|
|
|
|
|
No other build system commands are invoked by the ``pip wheel`` command.
|
|
|
|
|
|
|
|
Customising the build
|
2020-02-11 14:00:03 +01:00
|
|
|
^^^^^^^^^^^^^^^^^^^^^
|
2014-03-25 22:56:46 +01:00
|
|
|
|
|
|
|
It is possible using ``--global-option`` to include additional build commands
|
|
|
|
with their arguments in the ``setup.py`` command. This is currently the only
|
|
|
|
way to influence the building of C extensions from the command line. For
|
2020-08-06 22:06:10 +02:00
|
|
|
example:
|
|
|
|
|
|
|
|
.. tabs::
|
|
|
|
|
|
|
|
.. group-tab:: Unix/macOS
|
|
|
|
|
|
|
|
.. code-block:: shell
|
|
|
|
|
2020-08-16 20:07:09 +02:00
|
|
|
python -m pip wheel --global-option bdist_ext --global-option -DFOO wheel
|
2020-08-06 22:06:10 +02:00
|
|
|
|
|
|
|
.. group-tab:: Windows
|
|
|
|
|
|
|
|
.. code-block:: shell
|
|
|
|
|
2020-08-16 20:07:09 +02:00
|
|
|
py -m pip wheel --global-option bdist_ext --global-option -DFOO wheel
|
2014-03-25 22:56:46 +01:00
|
|
|
|
|
|
|
|
|
|
|
will result in a build command of
|
|
|
|
|
|
|
|
::
|
|
|
|
|
|
|
|
setup.py bdist_ext -DFOO bdist_wheel -d TARGET
|
|
|
|
|
|
|
|
which passes a preprocessor symbol to the extension build.
|
|
|
|
|
|
|
|
Such usage is considered highly build-system specific and more an accident of
|
|
|
|
the current implementation than a supported interface.
|
2014-04-26 07:20:53 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Options
|
2020-02-11 14:00:03 +01:00
|
|
|
=======
|
2014-04-26 07:20:53 +02:00
|
|
|
|
|
|
|
.. pip-command-options:: wheel
|
|
|
|
|
2019-11-12 23:54:43 +01:00
|
|
|
.. pip-index-options:: wheel
|
2014-04-26 07:20:53 +02:00
|
|
|
|
|
|
|
|
|
|
|
Examples
|
2020-02-11 14:00:03 +01:00
|
|
|
========
|
2014-04-26 07:20:53 +02:00
|
|
|
|
2016-05-16 21:33:51 +02:00
|
|
|
#. Build wheels for a requirement (and all its dependencies), and then install
|
2014-04-26 07:20:53 +02:00
|
|
|
|
2020-08-06 22:06:10 +02:00
|
|
|
.. tabs::
|
|
|
|
|
|
|
|
.. group-tab:: Unix/macOS
|
|
|
|
|
|
|
|
.. code-block:: shell
|
|
|
|
|
2020-08-16 20:07:09 +02:00
|
|
|
python -m pip wheel --wheel-dir=/tmp/wheelhouse SomePackage
|
|
|
|
python -m pip install --no-index --find-links=/tmp/wheelhouse SomePackage
|
2014-04-26 07:20:53 +02:00
|
|
|
|
2020-08-06 22:06:10 +02:00
|
|
|
.. group-tab:: Windows
|
|
|
|
|
|
|
|
.. code-block:: shell
|
|
|
|
|
2020-08-16 20:07:09 +02:00
|
|
|
py -m pip wheel --wheel-dir=/tmp/wheelhouse SomePackage
|
|
|
|
py -m pip install --no-index --find-links=/tmp/wheelhouse SomePackage
|
2019-10-01 04:17:31 +02:00
|
|
|
|
|
|
|
#. Build a wheel for a package from source
|
|
|
|
|
2020-08-06 22:06:10 +02:00
|
|
|
.. tabs::
|
|
|
|
|
|
|
|
.. group-tab:: Unix/macOS
|
|
|
|
|
|
|
|
.. code-block:: shell
|
|
|
|
|
2020-08-16 20:07:09 +02:00
|
|
|
python -m pip wheel --no-binary SomePackage SomePackage
|
2020-08-06 22:06:10 +02:00
|
|
|
|
|
|
|
.. group-tab:: Windows
|
|
|
|
|
|
|
|
.. code-block:: shell
|
2019-10-01 04:17:31 +02:00
|
|
|
|
2020-08-16 20:07:09 +02:00
|
|
|
py -m pip wheel --no-binary SomePackage SomePackage
|