|
72 | 72 | . .evergreen/utils.sh |
73 | 73 |
|
74 | 74 | if [ -z "$PYTHON_BINARY" ]; then |
75 | | - VIRTUALENV=$(command -v virtualenv) || true |
76 | | - if [ -z "$VIRTUALENV" ]; then |
77 | | - PYTHON=$(command -v python || command -v python3) || true |
78 | | - if [ -z "$PYTHON" ]; then |
79 | | - echo "Cannot test without python or python3 installed!" |
80 | | - exit 1 |
81 | | - fi |
82 | | - else |
83 | | - $VIRTUALENV --never-download pymongotestvenv |
84 | | - . pymongotestvenv/bin/activate |
85 | | - PYTHON=python |
86 | | - trap "deactivate; rm -rf pymongotestvenv" EXIT HUP |
| 75 | + PYTHON=$(command -v python || command -v python3) || true |
| 76 | + if [ -z "$PYTHON" ]; then |
| 77 | + echo "Cannot test without python or python3 installed!" |
| 78 | + exit 1 |
87 | 79 | fi |
| 80 | + createvirtualenv $PYTHON pymongotestvenv |
| 81 | + PYTHON=python |
| 82 | + trap "deactivate; rm -rf pymongotestvenv" EXIT HUP |
| 83 | + |
88 | 84 | elif [ "$COMPRESSORS" = "snappy" ]; then |
89 | | - $PYTHON_BINARY -m virtualenv --system-site-packages --never-download snappytest |
90 | | - . snappytest/bin/activate |
| 85 | + createvirtualenv $PYTHON_BINARY snappytest |
91 | 86 | trap "deactivate; rm -rf snappytest" EXIT HUP |
92 | 87 | # 0.5.2 has issues in pypy3(.5) |
93 | 88 | pip install python-snappy==0.5.1 |
94 | 89 | PYTHON=python |
95 | 90 | elif [ "$COMPRESSORS" = "zstd" ]; then |
96 | | - $PYTHON_BINARY -m virtualenv --system-site-packages --never-download zstdtest |
97 | | - . zstdtest/bin/activate |
| 91 | + createvirtualenv $PYTHON_BINARY zstdtest |
98 | 92 | trap "deactivate; rm -rf zstdtest" EXIT HUP |
99 | 93 | pip install zstandard |
100 | 94 | PYTHON=python |
101 | 95 | elif [ -n "$SETDEFAULTENCODING" ]; then |
102 | | - $PYTHON_BINARY -m virtualenv --system-site-packages --never-download encodingtest |
103 | | - . encodingtest/bin/activate |
| 96 | + createvirtualenv $PYTHON_BINARY encodingtest |
104 | 97 | trap "deactivate; rm -rf encodingtest" EXIT HUP |
105 | 98 | mkdir test-sitecustomize |
106 | 99 | cat <<EOT > test-sitecustomize/sitecustomize.py |
|
0 commit comments