From 57e6438d99519c0b2b6bdaae1868cdf1d2c64250 Mon Sep 17 00:00:00 2001 From: Kevin Albertson Date: Wed, 14 Oct 2026 16:34:18 -0400 Subject: [PATCH] test-python-integ: provision Python 3.13 via uv when toolchain Python is too old PyMongo master requires Python >=3.11 (PYTHON-6138), but the newest interpreter on some Evergreen distros is the MongoDB toolchain Python 3.10 (e.g. rhel-82-arm64), so 'pip install -e ".[test,encryption]"' fails at install time. Provision a uv-managed Python 3.13 for the pymongocrypt venv when the selected interpreter is older than 3.11. Complements #1242 (PYTHON-6139), which drops 3.9/3.10 from the pymongocrypt support matrix but does not add an interpreter source for distros whose toolchain tops out at 3.10. --- bindings/python/.evergreen/integ-test.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/bindings/python/.evergreen/integ-test.sh b/bindings/python/.evergreen/integ-test.sh index 2da2ed7bb..5455687ad 100755 --- a/bindings/python/.evergreen/integ-test.sh +++ b/bindings/python/.evergreen/integ-test.sh @@ -25,7 +25,18 @@ else fi export PYMONGOCRYPT_LIB -createvirtualenv $PYTHON .venv +# PyMongo master requires Python 3.11+ (PYTHON-6138), but the newest +# interpreter on some distros is the MongoDB toolchain Python 3.10 (e.g. +# rhel-82-arm64). Provision a modern interpreter with uv in that case. +if "$PYTHON" -c 'import sys; sys.exit(0 if sys.version_info >= (3, 11) else 1)'; then + createvirtualenv $PYTHON .venv +else + . "${DRIVERS_TOOLS}/.evergreen/ensure-uv.sh" + ensure_uv + uv python install 3.13 + uv venv --seed --python 3.13 .venv + . .venv/bin/activate +fi pip install -e . pip install uv pushd $PYMONGO_DIR