From 44b79e2186b43ee1f3ecda9f8b0d00209a2104aa Mon Sep 17 00:00:00 2001 From: Laurent Goderre Date: Mon, 23 Oct 2023 10:16:19 -0400 Subject: [PATCH] Fix python tests in 2.7 by converting pip option to an env var --- test/tests/python-pip-requests-ssl/container.py | 2 +- test/tests/run-python-in-container.sh | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/test/tests/python-pip-requests-ssl/container.py b/test/tests/python-pip-requests-ssl/container.py index 1c49f46c6ee96..b79ec64a13197 100644 --- a/test/tests/python-pip-requests-ssl/container.py +++ b/test/tests/python-pip-requests-ssl/container.py @@ -1,5 +1,5 @@ import subprocess, sys -subprocess.check_call([sys.executable, '-m', 'pip', 'install', '--root-user-action', 'ignore', 'requests']) +subprocess.check_call([sys.executable, '-m', 'pip', 'install', 'ignore', 'requests']) import requests r = requests.get('https://google.com') diff --git a/test/tests/run-python-in-container.sh b/test/tests/run-python-in-container.sh index 3eeb17f3770fb..65226cd9e124c 100755 --- a/test/tests/run-python-in-container.sh +++ b/test/tests/run-python-in-container.sh @@ -25,6 +25,7 @@ case "$1" in source "$runDir/run-in-container.sh" \ --docker-arg --env=PIP_DISABLE_PIP_VERSION_CHECK=1 \ --docker-arg --env=PIP_NO_PYTHON_VERSION_WARNING=1 \ + --docker-arg --env=PIP_ROOT_USER_ACTION=ignore \ "$testDir" "$1" "$python" container.py ;; @@ -34,6 +35,7 @@ case "$1" in source "$runDir/run-in-container.sh" \ --docker-arg --env=PIP_DISABLE_PIP_VERSION_CHECK=1 \ --docker-arg --env=PIP_NO_PYTHON_VERSION_WARNING=1 \ + --docker-arg --env=PIP_ROOT_USER_ACTION=ignore \ "$testDir" "$1" sh -ec ' for c in pypy3 pypy python3 python; do if [ -x "/usr/local/bin/$c" ]; then