@@ -11,19 +11,15 @@ MONGOCRYPT_DIR="$MONGOCRYPT_DIR"
1111CRYPT_SHARED_DIR=" $DRIVERS_TOOLS "
1212MONGODB_BINARIES=" $DRIVERS_TOOLS /mongodb/bin"
1313
14- # Use the latest toolchain Python.
14+ # Use the latest toolchain Python, if any qualifies .
1515PYTHON=$( find_pythons | tail -1)
16- if [ -z " $PYTHON " ]; then
17- echo " No Python interpreter found!"
18- exit 1
19- fi
2016
21- # pymongo (unreleased master) requires Python 3.11+. Some distros (e.g.
22- # rhel82) only provide older interpreters, so provision one with uv.
23- if ! " $PYTHON " -c ' import sys; sys.exit(sys.version_info < (3, 11)) ' ; then
24- if ! command -v uv > /dev/null 2>&1 ; then
25- " $PYTHON " -m pip install --user uv
26- fi
17+ # pymongo (unreleased master) requires Python 3.11+ (PYTHON-6138). Some
18+ # distros (e.g. rhel82) only provide older interpreters, or none at all
19+ # now that find_pythons requires 3.11+, so provision one with uv.
20+ if [ -z " $PYTHON " ] || ! " $PYTHON " -c ' import sys; sys.exit(sys.version_info < (3, 11)) ' ; then
21+ . " ${DRIVERS_TOOLS} /.evergreen/ensure-uv.sh "
22+ ensure_uv
2723 uv python install 3.11
2824 PYTHON=$( uv python find 3.11)
2925 echo " Using uv-provisioned Python: $PYTHON "
3632fi
3733export PYMONGOCRYPT_LIB
3834
39- # PyMongo master requires Python 3.11+ (PYTHON-6138), but the newest
40- # interpreter on some distros is the MongoDB toolchain Python 3.10 (e.g.
41- # rhel-82-arm64). Provision a modern interpreter with uv in that case.
42- if " $PYTHON " -c ' import sys; sys.exit(0 if sys.version_info >= (3, 11) else 1)' ; then
43- createvirtualenv $PYTHON .venv
44- else
45- . " ${DRIVERS_TOOLS} /.evergreen/ensure-uv.sh"
46- ensure_uv
47- uv python install 3.13
48- uv venv --seed --python 3.13 .venv
49- . .venv/bin/activate
50- fi
35+ # $PYTHON is guaranteed to be Python 3.11+ at this point.
36+ createvirtualenv $PYTHON .venv
5137pip install -e .
5238pip install uv
5339pushd $PYMONGO_DIR
0 commit comments