diff --git a/bootstrap.egg-info/entry_points.txt b/bootstrap.egg-info/entry_points.txt index a21ca22709..c84c0e8ab9 100644 --- a/bootstrap.egg-info/entry_points.txt +++ b/bootstrap.egg-info/entry_points.txt @@ -1,5 +1,6 @@ [distutils.commands] egg_info = setuptools.command.egg_info:egg_info +dist_info = setuptools.command.dist_info:dist_info build_py = setuptools.command.build_py:build_py sdist = setuptools.command.sdist:sdist editable_wheel = setuptools.command.editable_wheel:editable_wheel diff --git a/newsfragments/4973.feature.rst b/newsfragments/4973.feature.rst new file mode 100644 index 0000000000..e88c7db29f --- /dev/null +++ b/newsfragments/4973.feature.rst @@ -0,0 +1,2 @@ +PEP 517 ``get_requires_for_build_sdist`` and ``get_requires_for_build_wheel`` hooks +now terminate as soon as it is determined there are no extra build dependencies. diff --git a/setuptools/__init__.py b/setuptools/__init__.py index f1b9bfe9b8..f75a78f5bb 100644 --- a/setuptools/__init__.py +++ b/setuptools/__init__.py @@ -83,8 +83,11 @@ def finalize_options(self): # Honor setup.cfg's options. dist.parse_config_files(ignore_option_errors=True) - if dist.setup_requires: - _fetch_build_eggs(dist) + # NOTE: fetch_build_eggs is called so even if there are no build + # requirements, get_requires_for_build_(sdist/wheel) will still + # short-circuit once build dependencies are known (avoiding the + # costly full execution of setup.py). + _fetch_build_eggs(dist) def _fetch_build_eggs(dist: Distribution):