pip_wheel.rst 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. .. _`pip wheel`:
  2. pip wheel
  3. ---------
  4. .. contents::
  5. Usage
  6. *****
  7. .. pip-command-usage:: wheel
  8. Description
  9. ***********
  10. .. pip-command-description:: wheel
  11. Build System Interface
  12. ++++++++++++++++++++++
  13. In order for pip to build a wheel, ``setup.py`` must implement the
  14. ``bdist_wheel`` command with the following syntax::
  15. python setup.py bdist_wheel -d TARGET
  16. This command must create a wheel compatible with the invoking Python
  17. interpreter, and save that wheel in the directory TARGET.
  18. No other build system commands are invoked by the ``pip wheel`` command.
  19. Customising the build
  20. ~~~~~~~~~~~~~~~~~~~~~
  21. It is possible using ``--global-option`` to include additional build commands
  22. with their arguments in the ``setup.py`` command. This is currently the only
  23. way to influence the building of C extensions from the command line. For
  24. example::
  25. pip wheel --global-option bdist_ext --global-option -DFOO wheel
  26. will result in a build command of
  27. ::
  28. setup.py bdist_ext -DFOO bdist_wheel -d TARGET
  29. which passes a preprocessor symbol to the extension build.
  30. Such usage is considered highly build-system specific and more an accident of
  31. the current implementation than a supported interface.
  32. Options
  33. *******
  34. .. pip-command-options:: wheel
  35. .. pip-index-options::
  36. Examples
  37. ********
  38. #. Build wheels for a requirement (and all its dependencies), and then install
  39. ::
  40. $ pip wheel --wheel-dir=/tmp/wheelhouse SomePackage
  41. $ pip install --no-index --find-links=/tmp/wheelhouse SomePackage