Skip to content

Commit 30d93b5

Browse files
authored
fix test-python-integ on distros with too-old Python (#1246)
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.
1 parent dd39b37 commit 30d93b5

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

‎bindings/python/.evergreen/integ-test.sh‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,18 @@ else
3636
fi
3737
export PYMONGOCRYPT_LIB
3838

39-
createvirtualenv $PYTHON .venv
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
4051
pip install -e .
4152
pip install uv
4253
pushd $PYMONGO_DIR

0 commit comments

Comments
 (0)