From 8d1d20de8ce719350a6028e93a41e6ccc829634e 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 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,