From fcbe84261a1069d90911cb05f49330bc907179ca Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Mon, 31 Oct 2022 13:01:16 -0500 Subject: [PATCH 1/3] PYTHON-3498 Error installing virtual environment on zseries hosts --- .evergreen/run-tests.sh | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/.evergreen/run-tests.sh b/.evergreen/run-tests.sh index 8c0c17cd8f..871103f80c 100755 --- a/.evergreen/run-tests.sh +++ b/.evergreen/run-tests.sh @@ -72,35 +72,28 @@ fi . .evergreen/utils.sh if [ -z "$PYTHON_BINARY" ]; then - VIRTUALENV=$(command -v virtualenv) || true - if [ -z "$VIRTUALENV" ]; then - PYTHON=$(command -v python || command -v python3) || true - if [ -z "$PYTHON" ]; then - echo "Cannot test without python or python3 installed!" - exit 1 - fi - else - $VIRTUALENV --never-download pymongotestvenv - . pymongotestvenv/bin/activate - PYTHON=python - trap "deactivate; rm -rf pymongotestvenv" EXIT HUP + PYTHON=$(command -v python || command -v python3) || true + if [ -z "$PYTHON" ]; then + echo "Cannot test without python or python3 installed!" + exit 1 fi + createvirtualenv $PYTHON pymongotestvenv + PYTHON=python + trap "deactivate; rm -rf pymongotestvenv" EXIT HUP + elif [ "$COMPRESSORS" = "snappy" ]; then - $PYTHON_BINARY -m virtualenv --system-site-packages --never-download snappytest - . snappytest/bin/activate + createvirtualenv $PYTHON_BINARY snappytest trap "deactivate; rm -rf snappytest" EXIT HUP # 0.5.2 has issues in pypy3(.5) pip install python-snappy==0.5.1 PYTHON=python elif [ "$COMPRESSORS" = "zstd" ]; then - $PYTHON_BINARY -m virtualenv --system-site-packages --never-download zstdtest - . zstdtest/bin/activate + createvirtualenv $PYTHON_BINARY zstdtest trap "deactivate; rm -rf zstdtest" EXIT HUP pip install zstandard PYTHON=python elif [ -n "$SETDEFAULTENCODING" ]; then - $PYTHON_BINARY -m virtualenv --system-site-packages --never-download encodingtest - . encodingtest/bin/activate + createvirtualenv $PYTHON_BINARY encodingtest trap "deactivate; rm -rf encodingtest" EXIT HUP mkdir test-sitecustomize cat < test-sitecustomize/sitecustomize.py From 8d980c34556fa0e22c3d9f4d7cd85fed4215fa73 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Mon, 31 Oct 2022 13:38:21 -0500 Subject: [PATCH 2/3] workaround --- .evergreen/utils.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.evergreen/utils.sh b/.evergreen/utils.sh index b0f698f056..dd135461bc 100755 --- a/.evergreen/utils.sh +++ b/.evergreen/utils.sh @@ -17,7 +17,8 @@ createvirtualenv () { echo "Cannot test without virtualenv" exit 1 fi - $VIRTUALENV $VENVPATH + # Workaround for bug in older versions of virtualenv. + $VIRTUALENV $VENVPATH || PYTHON -m venv $VENVPATH if [ "Windows_NT" = "$OS" ]; then . $VENVPATH/Scripts/activate else From 5ab32a0c0b3676c8d518463f72b1aeb33480c00d Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Mon, 31 Oct 2022 14:52:42 -0500 Subject: [PATCH 3/3] another attempt --- .evergreen/utils.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.evergreen/utils.sh b/.evergreen/utils.sh index dd135461bc..c6bb30932f 100755 --- a/.evergreen/utils.sh +++ b/.evergreen/utils.sh @@ -18,7 +18,7 @@ createvirtualenv () { exit 1 fi # Workaround for bug in older versions of virtualenv. - $VIRTUALENV $VENVPATH || PYTHON -m venv $VENVPATH + $VIRTUALENV $VENVPATH || $PYTHON -m venv $VENVPATH if [ "Windows_NT" = "$OS" ]; then . $VENVPATH/Scripts/activate else