summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/build_meta.rst23
1 files changed, 14 insertions, 9 deletions
diff --git a/docs/build_meta.rst b/docs/build_meta.rst
index 197e5917..3c4d43b2 100644
--- a/docs/build_meta.rst
+++ b/docs/build_meta.rst
@@ -136,24 +136,29 @@ the ``_custom_build/backend.py`` file, as shown in the following example:
.. code-block:: python
- from setuptools import build_meta as _orig
+ from setuptools.build_meta import *
- prepare_metadata_for_build_wheel = _orig.prepare_metadata_for_build_wheel
- build_wheel = _orig.build_wheel
- build_sdist = _orig.build_sdist
+ _original_get_requires_for_build_wheel = get_requires_for_build_wheel
+ _original_get_requires_for_build_sdist = get_requires_for_build_sdist
def get_requires_for_build_wheel(config_settings=None):
- return _orig.get_requires_for_build_wheel(config_settings) + [...]
+ return _original_get_requires_for_build_wheel(config_settings) + [...]
def get_requires_for_build_sdist(config_settings=None):
- return _orig.get_requires_for_build_sdist(config_settings) + [...]
+ return _original_get_requires_for_build_sdist(config_settings) + [...]
-Note that you can override any of the functions specified in :pep:`PEP 517
-<517#build-backend-interface>`, not only the ones responsible for gathering
-requirements.
+.. note::
+
+ You can override any of the functions specified in :pep:`PEP 517
+ <517#build-backend-interface>`, not only the ones responsible for gathering
+ requirements. It is important to ``import *`` so that the hooks that you
+ choose not to reimplement would be inherited from the setuptools' backend
+ automatically. This will also cover hooks that might be added in the future
+ like the ones that :pep:`660` declares.
+
.. important:: Make sure your backend script is included in the :doc:`source
distribution </userguide/distribution>`, otherwise the build will fail.