Skip to content

Commit d335cf6

Browse files
committed
restore 3.9 support
1 parent 5f1b855 commit d335cf6

5 files changed

Lines changed: 18 additions & 15 deletions

File tree

.github/workflows/dist-python.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747

4848
- uses: actions/setup-python@v5
4949
with:
50-
python-version: "3.10"
50+
python-version: "3.9"
5151
cache: 'pip'
5252
cache-dependency-path: 'bindings/python/pyproject.toml'
5353
allow-prereleases: true

.github/workflows/test-python.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
fail-fast: false
4444
matrix:
4545
os: [ubuntu-latest, windows-latest, macos-latest]
46-
python-version: ["3.10", "3.13", "3.14"]
46+
python-version: ["3.9", "3.13", "3.14"]
4747

4848
steps:
4949
- uses: actions/checkout@v4

bindings/python/.evergreen/test.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ elif [ "Darwin" = "$(uname -s)" ]; then
3131
export PYMONGOCRYPT_LIB=${MONGOCRYPT_DIR}/nocrypto/lib/libmongocrypt.dylib
3232
PYMONGOCRYPT_LIB_CRYPTO=${MONGOCRYPT_DIR}/lib/libmongocrypt.dylib
3333
PYTHONS=(
34+
"/Library/Frameworks/Python.framework/Versions/3.9/bin/python3"
3435
"/Library/Frameworks/Python.framework/Versions/3.10/bin/python3"
3536
"/Library/Frameworks/Python.framework/Versions/3.11/bin/python3"
3637
"/Library/Frameworks/Python.framework/Versions/3.12/bin/python3"
@@ -58,6 +59,7 @@ else
5859
)
5960
else
6061
PYTHONS=(
62+
"/opt/python/3.9/bin/python3"
6163
"/opt/python/3.10/bin/python3"
6264
"/opt/python/3.11/bin/python3"
6365
"/opt/python/3.12/bin/python3"

bindings/python/.evergreen/utils.sh

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,37 +36,37 @@ createvirtualenv () {
3636
# PYTHON = find_python3
3737
find_python3() {
3838
PYTHON=""
39-
# Add a fallback system python3 if it is available and Python 3.10+.
40-
if is_python_310 "$(command -v python3)"; then
39+
# Add a fallback system python3 if it is available and Python 3.9+.
40+
if is_python_39 "$(command -v python3)"; then
4141
PYTHON="$(command -v python3)"
4242
fi
4343
# Find a suitable toolchain version, if available.
4444
if [ "$(uname -s)" = "Darwin" ]; then
45-
PYTHON="/Library/Frameworks/Python.Framework/Versions/3.10/bin/python3"
45+
PYTHON="/Library/Frameworks/Python.Framework/Versions/3.9/bin/python3"
4646
elif [ "Windows_NT" = "${OS:-}" ]; then # Magic variable in cygwin
4747
PYTHON="C:/python/Python310/python.exe"
4848
else
49-
# Prefer our own toolchain, fall back to mongodb toolchain if it has Python 3.10+.
50-
if [ -f "/opt/python/3.10/bin/python3" ]; then
51-
PYTHON="/opt/python/3.10/bin/python3"
52-
elif is_python_310 "$(command -v /opt/mongodbtoolchain/v4/bin/python3)"; then
49+
# Prefer our own toolchain, fall back to mongodb toolchain if it has Python 3.9+.
50+
if [ -f "/opt/python/3.9/bin/python3" ]; then
51+
PYTHON="/opt/python/3.9/bin/python3"
52+
elif is_python_39 "$(command -v /opt/mongodbtoolchain/v4/bin/python3)"; then
5353
PYTHON="/opt/mongodbtoolchain/v4/bin/python3"
54-
elif is_python_310 "$(command -v /opt/mongodbtoolchain/v3/bin/python3)"; then
54+
elif is_python_39 "$(command -v /opt/mongodbtoolchain/v3/bin/python3)"; then
5555
PYTHON="/opt/mongodbtoolchain/v3/bin/python3"
5656
fi
5757
fi
5858
if [ -z "$PYTHON" ]; then
59-
echo "Cannot run pre-commit without python3.10+ installed!"
59+
echo "Cannot run pre-commit without python3.9+ installed!"
6060
exit 1
6161
fi
6262
echo "$PYTHON"
6363
}
6464

65-
# Function that returns success if the provided Python binary is version 3.10 or later
65+
# Function that returns success if the provided Python binary is version 3.9 or later
6666
# Usage:
67-
# is_python_310 /path/to/python
67+
# is_python_39 /path/to/python
6868
# * param1: Python binary
69-
is_python_310() {
69+
is_python_39() {
7070
if [ -z "$1" ]; then
7171
return 1
7272
elif $1 -c "import sys; exit(sys.version_info[:2] < (3, 10))"; then

bindings/python/pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ dynamic = ["version", "dependencies", "optional-dependencies"]
88
description = "Python bindings for libmongocrypt"
99
readme = "README.rst"
1010
license = {file="LICENSE"}
11-
requires-python = ">=3.10"
11+
requires-python = ">=3.9"
1212
authors = [
1313
{ name = "Shane Harvey", email = "mongodb-user@googlegroups.com" },
1414
]
@@ -31,6 +31,7 @@ classifiers = [
3131
"Programming Language :: Python :: 3 :: Only",
3232
"Programming Language :: Python :: Implementation :: CPython",
3333
"Programming Language :: Python :: Implementation :: PyPy",
34+
"Programming Language :: Python :: 3.9",
3435
"Programming Language :: Python :: 3.10",
3536
"Programming Language :: Python :: 3.11",
3637
"Programming Language :: Python :: 3.12",

0 commit comments

Comments
 (0)