From e0785e3dacd32ae54501c1e77315cf84d359f2ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul=20=28ACSONE=29?= Date: Fri, 13 Dec 2019 22:33:11 +0100 Subject: [PATCH] Do not attempt setup.py clean for failed pep517 builds Fixes #6642 --- news/6642.bugfix | 2 ++ src/pip/_internal/wheel_builder.py | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 news/6642.bugfix 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 4e191061bb3..01a8ca7007b 100644 --- a/src/pip/_internal/wheel_builder.py +++ b/src/pip/_internal/wheel_builder.py @@ -349,10 +349,11 @@ def _build_one_inside_env( except Exception: pass # Ignore return, we can't do anything else useful. - self._clean_one(req) + if not req.use_pep517: + self._clean_one_legacy(req) return None - def _clean_one(self, req): + def _clean_one_legacy(self, req): # type: (InstallRequirement) -> bool clean_args = make_setuptools_clean_args( req.setup_py_path,