From ade262092cbdddb8502f80ad4c6ccc6619384a13 Mon Sep 17 00:00:00 2001 From: Antoine Boellinger Date: Mon, 28 Feb 2022 16:55:04 +0100 Subject: [PATCH 1/3] Explicit fail when python executable is not found --- src/rez/pip.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/rez/pip.py b/src/rez/pip.py index be990f79b..58dd67fb4 100644 --- a/src/rez/pip.py +++ b/src/rez/pip.py @@ -202,6 +202,9 @@ def find_pip_from_context(python_version, pip_version=None): py_exe = find_python_in_context(context) + if not py_exe: + raise RezSystemError("Failed to locate Python executable from context {}".format(context)) + proc = context.execute_command( # -E and -s are used to isolate the environment as much as possible. # See python --help for more details. We absolutely don't want to get From f7e2f59b366472bd20e8c2cebf2af7e812586c0c Mon Sep 17 00:00:00 2001 From: Antoine Boellinger Date: Mon, 28 Feb 2022 17:29:21 +0100 Subject: [PATCH 2/3] Resolve PR discussion --- src/rez/pip.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/rez/pip.py b/src/rez/pip.py index 58dd67fb4..8a25e2576 100644 --- a/src/rez/pip.py +++ b/src/rez/pip.py @@ -203,8 +203,9 @@ def find_pip_from_context(python_version, pip_version=None): py_exe = find_python_in_context(context) if not py_exe: - raise RezSystemError("Failed to locate Python executable from context {}".format(context)) - + print_debug("Failed to locate python executable from context") + return None, None, context + proc = context.execute_command( # -E and -s are used to isolate the environment as much as possible. # See python --help for more details. We absolutely don't want to get From 2a64909caa1044fe871c2efbfe1b6443d61cfd61 Mon Sep 17 00:00:00 2001 From: Antoine Boellinger Date: Mon, 28 Feb 2022 18:59:47 +0100 Subject: [PATCH 3/3] Resolve PR discussions --- src/rez/pip.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/rez/pip.py b/src/rez/pip.py index 8a25e2576..b3993b290 100644 --- a/src/rez/pip.py +++ b/src/rez/pip.py @@ -203,7 +203,6 @@ def find_pip_from_context(python_version, pip_version=None): py_exe = find_python_in_context(context) if not py_exe: - print_debug("Failed to locate python executable from context") return None, None, context proc = context.execute_command(