@@ -47,6 +47,9 @@ if [ "$SSL" != "nossl" ]; then
47
47
export CA_PEM=" $DRIVERS_TOOLS /.evergreen/x509gen/ca.pem"
48
48
fi
49
49
50
+ # For createvirtualenv.
51
+ . .evergreen/utils.sh
52
+
50
53
if [ -z " $PYTHON_BINARY " ]; then
51
54
VIRTUALENV=$( command -v virtualenv) || true
52
55
if [ -z " $VIRTUALENV " ]; then
@@ -109,6 +112,7 @@ if [ -n "$TEST_PYOPENSSL" ]; then
109
112
. pyopenssltest/bin/activate
110
113
fi
111
114
trap " deactivate; rm -rf pyopenssltest" EXIT HUP
115
+ PYTHON=python
112
116
113
117
IS_PYTHON_2=$( python -c " import sys; sys.stdout.write('1' if sys.version_info < (3,) else '0')" )
114
118
if [ $IS_PYTHON_2 = " 1" ]; then
@@ -125,6 +129,10 @@ if [ -n "$TEST_PYOPENSSL" ]; then
125
129
fi
126
130
127
131
if [ -n " $TEST_ENCRYPTION " ]; then
132
+ createvirtualenv $PYTHON venv-encryption
133
+ trap " deactivate; rm -rf venv-encryption" EXIT HUP
134
+ PYTHON=python
135
+
128
136
if [ -z " $LIBMONGOCRYPT_URL " ]; then
129
137
echo " Cannot test client side encryption without LIBMONGOCRYPT_URL!"
130
138
exit 1
@@ -152,13 +160,13 @@ if [ -n "$TEST_ENCRYPTION" ]; then
152
160
exit 1
153
161
fi
154
162
155
- git clone --branch PYTHON-2409/add-test-local-kms-python-2 [email protected] :prashantmital/libmongocrypt.git libmongocrypt_git
156
- $PYTHON -m pip install --upgrade ./libmongocrypt_git/bindings/python
157
- # TODO: use a virtualenv
158
- trap " $PYTHON -m pip uninstall -y pymongocrypt" EXIT HUP
159
- $PYTHON -c " import pymongocrypt; print('pymongocrypt version: '+pymongocrypt.__version__ )"
160
- $PYTHON -c " import pymongocrypt; print('libmongocrypt version: '+pymongocrypt.libmongocrypt_version()) "
161
- # PATH is set by PREPARE_SHELL.
163
+ # TODO: Test with 'pip install pymongocrypt'
164
+ git clone --branch master https://github.com/mongodb/libmongocrypt.git libmongocrypt_git
165
+ python -m pip install --upgrade ./libmongocrypt_git/bindings/python
166
+ python -c " import pymongocrypt; print(' pymongocrypt version: '+pymongocrypt.__version__) "
167
+ python -c " import pymongocrypt; print('libmongocrypt version: '+pymongocrypt.libmongocrypt_version() )"
168
+ # PATH is updated by PREPARE_SHELL for access to mongocryptd.
169
+
162
170
fi
163
171
164
172
PYTHON_IMPL=$( $PYTHON -c " import platform, sys; sys.stdout.write(platform.python_implementation())" )
0 commit comments