Add docs for InstallError.

This commit is contained in:
Todd Gamblin 2016-03-18 13:42:45 -07:00
parent 23f3f1adfe
commit e9126baaab

View file

@ -1844,6 +1844,20 @@ dedicated process.
.. _prefix-objects: .. _prefix-objects:
Failing the build
----------------------
Sometimes you don't want a package to successfully install unless some
condition is true. You can explicitly cause the build to fail from
``install()`` by raising an ``InstallError``, for example:
.. code-block:: python
if spec.architecture.startswith('darwin'):
raise InstallError('This package does not build on Mac OS X!')
Prefix objects Prefix objects
---------------------- ----------------------