diff --git a/news/6642.bugfix b/news/6642.bugfix new file mode 100644 index 00000000000..470572ad63a --- /dev/null +++ b/news/6642.bugfix @@ -0,0 +1,2 @@ +Do not attempt to run ``setup.py clean`` after a ``pep517`` build error, +since a ``setup.py`` may not exist in that case. diff --git a/src/pip/_internal/wheel_builder.py b/src/pip/_internal/wheel_builder.py index b992bd676ba..35e4f9eff0c 100644 --- a/src/pip/_internal/wheel_builder.py +++ b/src/pip/_internal/wheel_builder.py @@ -231,11 +231,12 @@ def _build_one_inside_env( req.name, e, ) # Ignore return, we can't do anything else useful. - _clean_one(req, global_options) + if not req.use_pep517: + _clean_one_legacy(req, global_options) return None -def _clean_one(req, global_options): +def _clean_one_legacy(req, global_options): # type: (InstallRequirement, List[str]) -> bool clean_args = make_setuptools_clean_args( req.setup_py_path,