Skip to content

PYTHON-3498 Error installing virtual environment on zseries hosts #1101

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 11 additions & 18 deletions .evergreen/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 <<EOT > test-sitecustomize/sitecustomize.py
Expand Down
3 changes: 2 additions & 1 deletion .evergreen/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down