Skip to content

Commit 779bbcd

Browse files
committed
PYTHON-5454 Add python 3.14 and drop python 3.9
1 parent ffb372a commit 779bbcd

File tree

12 files changed

+1572
-1825
lines changed

12 files changed

+1572
-1825
lines changed

.evergreen/generated_configs/tasks.yml

Lines changed: 604 additions & 604 deletions
Large diffs are not rendered by default.

.evergreen/generated_configs/variants.yml

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
buildvariants:
22
# Alternative hosts tests
3-
- name: openssl-1.0.2-rhel7-v5.0-python3.9
3+
- name: openssl-1.0.2-rhel7-v5.0-python3.10
44
tasks:
55
- name: .test-no-toolchain
6-
display_name: OpenSSL 1.0.2 RHEL7 v5.0 Python3.9
6+
display_name: OpenSSL 1.0.2 RHEL7 v5.0 Python3.10
77
run_on:
88
- rhel79-small
99
batchtime: 10080
1010
expansions:
1111
VERSION: "5.0"
12-
PYTHON_VERSION: "3.9"
13-
PYTHON_BINARY: /opt/python/3.9/bin/python3
12+
PYTHON_VERSION: "3.10"
13+
PYTHON_BINARY: /opt/python/3.10/bin/python3
1414
- name: other-hosts-rhel9-fips-latest
1515
tasks:
1616
- name: .test-no-toolchain
@@ -164,17 +164,17 @@ buildvariants:
164164
- rhel87-small
165165

166166
# Disable test commands tests
167-
- name: disable-test-commands-rhel8-python3.9
167+
- name: disable-test-commands-rhel8-python3.10
168168
tasks:
169169
- name: .test-standard .server-latest
170-
display_name: Disable test commands RHEL8 Python3.9
170+
display_name: Disable test commands RHEL8 Python3.10
171171
run_on:
172172
- rhel87-small
173173
expansions:
174174
AUTH: auth
175175
SSL: ssl
176176
DISABLE_TEST_COMMANDS: "1"
177-
PYTHON_BINARY: /opt/python/3.9/bin/python3
177+
PYTHON_BINARY: /opt/python/3.10/bin/python3
178178

179179
# Doctests tests
180180
- name: doctests-rhel8
@@ -292,32 +292,32 @@ buildvariants:
292292
AUTH: auth
293293

294294
# Free threaded tests
295-
- name: free-threaded-rhel8-python3.13t
295+
- name: free-threaded-rhel8-python3.14t
296296
tasks:
297297
- name: .free-threading
298-
display_name: Free-threaded RHEL8 Python3.13t
298+
display_name: Free-threaded RHEL8 Python3.14t
299299
run_on:
300300
- rhel87-small
301301
expansions:
302-
PYTHON_BINARY: /opt/python/3.13t/bin/python3
302+
PYTHON_BINARY: /opt/python/3.14t/bin/python3
303303
tags: [pr]
304-
- name: free-threaded-macos-python3.13t
304+
- name: free-threaded-macos-python3.14t
305305
tasks:
306306
- name: .free-threading
307-
display_name: Free-threaded macOS Python3.13t
307+
display_name: Free-threaded macOS Python3.14t
308308
run_on:
309309
- macos-14
310310
expansions:
311-
PYTHON_BINARY: /Library/Frameworks/PythonT.Framework/Versions/3.13/bin/python3t
311+
PYTHON_BINARY: /Library/Frameworks/PythonT.Framework/Versions/3.14/bin/python3t
312312
tags: []
313-
- name: free-threaded-macos-arm64-python3.13t
313+
- name: free-threaded-macos-arm64-python3.14t
314314
tasks:
315315
- name: .free-threading
316-
display_name: Free-threaded macOS Arm64 Python3.13t
316+
display_name: Free-threaded macOS Arm64 Python3.14t
317317
run_on:
318318
- macos-14-arm64
319319
expansions:
320-
PYTHON_BINARY: /Library/Frameworks/PythonT.Framework/Versions/3.13/bin/python3t
320+
PYTHON_BINARY: /Library/Frameworks/PythonT.Framework/Versions/3.14/bin/python3t
321321
tags: []
322322
- name: free-threaded-win64-python3.14t
323323
tasks:
@@ -332,7 +332,7 @@ buildvariants:
332332
# Green framework tests
333333
- name: green-eventlet-rhel8
334334
tasks:
335-
- name: .test-standard .standalone-noauth-nossl .python-3.9
335+
- name: .test-standard .standalone-noauth-nossl
336336
display_name: Green Eventlet RHEL8
337337
run_on:
338338
- rhel87-small
@@ -523,14 +523,14 @@ buildvariants:
523523
SUB_TEST_NAME: pyopenssl
524524

525525
# Search index tests
526-
- name: search-index-helpers-rhel8-python3.9
526+
- name: search-index-helpers-rhel8-python3.10
527527
tasks:
528528
- name: .search_index
529-
display_name: Search Index Helpers RHEL8 Python3.9
529+
display_name: Search Index Helpers RHEL8 Python3.10
530530
run_on:
531531
- rhel87-small
532532
expansions:
533-
PYTHON_BINARY: /opt/python/3.9/bin/python3
533+
PYTHON_BINARY: /opt/python/3.10/bin/python3
534534

535535
# Server version tests
536536
- name: mongodb-v4.2

.evergreen/run-mongodb-aws-ecs-test.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ fi
2020
set -o xtrace
2121

2222
# Install python with pip.
23-
PYTHON_VER="python3.9"
23+
PYTHON_VER="python3.10"
2424
apt-get -qq update < /dev/null > /dev/null
25+
add-apt-repository -y 'ppa:deadsnakes/ppa'
2526
apt-get -qq install $PYTHON_VER $PYTHON_VER-venv build-essential $PYTHON_VER-dev -y < /dev/null > /dev/null
2627

2728
export PYTHON_BINARY=$PYTHON_VER

.evergreen/scripts/generate_config.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,7 @@ def create_standard_nonlinux_variants() -> list[BuildVariant]:
107107
def create_free_threaded_variants() -> list[BuildVariant]:
108108
variants = []
109109
for host_name in ("rhel8", "macos", "macos-arm64", "win64"):
110-
if host_name == "win64":
111-
python = "3.14t"
112-
else:
113-
python = "3.13t"
110+
python = "3.14t"
114111
tasks = [".free-threading"]
115112
tags = []
116113
if host_name == "rhel8":
@@ -301,10 +298,6 @@ def create_green_framework_variants():
301298
host = DEFAULT_HOST
302299
for framework in ["eventlet", "gevent"]:
303300
tasks = [".test-standard .standalone-noauth-nossl"]
304-
if framework == "eventlet":
305-
# Eventlet has issues with dnspython > 2.0 and newer versions of CPython
306-
# https://jira.mongodb.org/browse/PYTHON-5284
307-
tasks = [".test-standard .standalone-noauth-nossl .python-3.9"]
308301
expansions = dict(GREEN_FRAMEWORK=framework, AUTH="auth", SSL="ssl")
309302
display_name = get_variant_name(f"Green {framework.capitalize()}", host)
310303
variant = create_variant(tasks, display_name, host=host, expansions=expansions)

.evergreen/scripts/generate_config_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
##############
2323

2424
ALL_VERSIONS = ["4.2", "4.4", "5.0", "6.0", "7.0", "8.0", "rapid", "latest"]
25-
CPYTHONS = ["3.9", "3.10", "3.11", "3.12", "3.13"]
25+
CPYTHONS = ["3.10", "3.11", "3.12", "3.13", "3.14"]
2626
PYPYS = ["pypy3.10"]
2727
ALL_PYTHONS = CPYTHONS + PYPYS
2828
MIN_MAX_PYTHON = [CPYTHONS[0], CPYTHONS[-1]]

.evergreen/scripts/setup_tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
GROUP_MAP = dict(mockupdb="mockupdb", perf="perf")
5454

5555
# The python version used for perf tests.
56-
PERF_PYTHON_VERSION = "3.9.13"
56+
PERF_PYTHON_VERSION = "3.10.14"
5757

5858

5959
def is_set(var: str) -> bool:

.evergreen/utils.sh

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,29 @@ find_python3() {
66
PYTHON=""
77
# Find a suitable toolchain version, if available.
88
if [ "$(uname -s)" = "Darwin" ]; then
9-
PYTHON="/Library/Frameworks/Python.Framework/Versions/3.9/bin/python3"
9+
PYTHON="/Library/Frameworks/Python.Framework/Versions/3.10/bin/python3"
1010
elif [ "Windows_NT" = "${OS:-}" ]; then # Magic variable in cygwin
11-
PYTHON="C:/python/Python39/python.exe"
11+
PYTHON="C:/python/Python310/python.exe"
1212
else
13-
# Prefer our own toolchain, fall back to mongodb toolchain if it has Python 3.9+.
14-
if [ -f "/opt/python/3.9/bin/python3" ]; then
13+
# Prefer our own toolchain, fall back to mongodb toolchain if it has Python 3.10+.
14+
if [ -f "/opt/python/3.10/bin/python3" ]; then
1515
PYTHON="/opt/python/Current/bin/python3"
16-
elif is_python_39 "$(command -v /opt/mongodbtoolchain/v5/bin/python3)"; then
16+
elif is_python_310 "$(command -v /opt/mongodbtoolchain/v5/bin/python3)"; then
1717
PYTHON="/opt/mongodbtoolchain/v5/bin/python3"
18-
elif is_python_39 "$(command -v /opt/mongodbtoolchain/v4/bin/python3)"; then
18+
elif is_python_310 "$(command -v /opt/mongodbtoolchain/v4/bin/python3)"; then
1919
PYTHON="/opt/mongodbtoolchain/v4/bin/python3"
20-
elif is_python_39 "$(command -v /opt/mongodbtoolchain/v3/bin/python3)"; then
20+
elif is_python_310 "$(command -v /opt/mongodbtoolchain/v3/bin/python3)"; then
2121
PYTHON="/opt/mongodbtoolchain/v3/bin/python3"
2222
fi
2323
fi
24-
# Add a fallback system python3 if it is available and Python 3.9+.
24+
# Add a fallback system python3 if it is available and Python 3.10+.
2525
if [ -z "$PYTHON" ]; then
26-
if is_python_39 "$(command -v python3)"; then
26+
if is_python_310 "$(command -v python3)"; then
2727
PYTHON="$(command -v python3)"
2828
fi
2929
fi
3030
if [ -z "$PYTHON" ]; then
31-
echo "Cannot test without python3.9+ installed!"
31+
echo "Cannot test without python3.10+ installed!"
3232
exit 1
3333
fi
3434
echo "$PYTHON"
@@ -99,11 +99,11 @@ testinstall () {
9999
fi
100100
}
101101

102-
# Function that returns success if the provided Python binary is version 3.9 or later
102+
# Function that returns success if the provided Python binary is version 3.10 or later
103103
# Usage:
104-
# is_python_39 /path/to/python
104+
# is_python_310 /path/to/python
105105
# * param1: Python binary
106-
is_python_39() {
106+
is_python_310() {
107107
if [ -z "$1" ]; then
108108
return 1
109109
elif $1 -c "import sys; exit(sys.version_info[:2] < (3, 9))"; then
@@ -131,7 +131,7 @@ get_python_binary() {
131131
else
132132
PYTHON="/opt/python/$version/bin/python3"
133133
fi
134-
if is_python_39 "$(command -v $PYTHON)"; then
134+
if is_python_310 "$(command -v $PYTHON)"; then
135135
echo "$PYTHON"
136136
else
137137
echo "Could not find suitable python binary for '$version'" >&2

.github/workflows/dist.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
- uses: actions/setup-python@v5
5555
with:
5656
cache: 'pip'
57-
python-version: 3.9
57+
python-version: "3.10"
5858
cache-dependency-path: 'pyproject.toml'
5959
allow-prereleases: true
6060

@@ -84,19 +84,19 @@ jobs:
8484
env:
8585
CIBW_MANYLINUX_X86_64_IMAGE: manylinux1
8686
CIBW_MANYLINUX_I686_IMAGE: manylinux1
87-
CIBW_BUILD: "cp39-${{ matrix.buildplat[1] }} cp39-${{ matrix.buildplat[1] }}"
87+
CIBW_BUILD: "cp310-${{ matrix.buildplat[1] }} cp310-${{ matrix.buildplat[1] }}"
8888
run: python -m cibuildwheel --output-dir wheelhouse
8989

9090
- name: Assert all versions in wheelhouse
9191
if: ${{ ! startsWith(matrix.buildplat[1], 'macos') }}
9292
run: |
93-
ls wheelhouse/*cp39*.whl
9493
ls wheelhouse/*cp310*.whl
9594
ls wheelhouse/*cp311*.whl
9695
ls wheelhouse/*cp312*.whl
9796
ls wheelhouse/*cp313*.whl
97+
ls wheelhouse/*cp314*.whl
9898
# Free-threading builds:
99-
ls wheelhouse/*cp313t*.whl
99+
ls wheelhouse/*cp3134*.whl
100100
101101
- uses: actions/upload-artifact@v4
102102
with:
@@ -117,7 +117,7 @@ jobs:
117117
- uses: actions/setup-python@v5
118118
with:
119119
# Build sdist on lowest supported Python
120-
python-version: '3.9'
120+
python-version: "3.10"
121121

122122
- name: Build SDist
123123
run: |

.github/workflows/test-python.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
uses: astral-sh/setup-uv@7edac99f961f18b581bbd960d59d049f04c0002f # v5
2929
with:
3030
enable-cache: true
31-
python-version: "3.9"
31+
python-version: "3.10"
3232
- name: Install Python dependencies
3333
run: |
3434
just install
@@ -56,7 +56,7 @@ jobs:
5656
fail-fast: false
5757
matrix:
5858
os: [ubuntu-latest]
59-
python-version: ["3.9", "pypy-3.10", "3.13", "3.13t"]
59+
python-version: ["3.10", "pypy-3.10", "3.13", "3.14t"]
6060
name: CPython ${{ matrix.python-version }}-${{ matrix.os }}
6161
steps:
6262
- uses: actions/checkout@v4
@@ -91,7 +91,7 @@ jobs:
9191
uses: astral-sh/setup-uv@7edac99f961f18b581bbd960d59d049f04c0002f # v5
9292
with:
9393
enable-cache: true
94-
python-version: "3.9"
94+
python-version: "3.10"
9595
- name: Start MongoDB
9696
uses: supercharge/mongodb-github-action@90004df786821b6308fb02299e5835d0dae05d0d # 1.12.0
9797
with:
@@ -114,7 +114,7 @@ jobs:
114114
uses: astral-sh/setup-uv@7edac99f961f18b581bbd960d59d049f04c0002f # v5
115115
with:
116116
enable-cache: true
117-
python-version: "3.9"
117+
python-version: "3.10"
118118
- name: Install just
119119
uses: extractions/setup-just@e33e0265a09d6d736e2ee1e0eb685ef1de4669ff # v3
120120
- name: Install dependencies
@@ -133,7 +133,7 @@ jobs:
133133
uses: astral-sh/setup-uv@7edac99f961f18b581bbd960d59d049f04c0002f # v5
134134
with:
135135
enable-cache: true
136-
python-version: "3.9"
136+
python-version: "3.10"
137137
- name: Install just
138138
uses: extractions/setup-just@e33e0265a09d6d736e2ee1e0eb685ef1de4669ff # v3
139139
- name: Install dependencies
@@ -146,7 +146,7 @@ jobs:
146146
runs-on: ubuntu-latest
147147
strategy:
148148
matrix:
149-
python: ["3.9", "3.11"]
149+
python: ["3.10", "3.14"]
150150
steps:
151151
- uses: actions/checkout@v4
152152
with:
@@ -177,7 +177,7 @@ jobs:
177177
cache: 'pip'
178178
cache-dependency-path: 'pyproject.toml'
179179
# Build sdist on lowest supported Python
180-
python-version: '3.9'
180+
python-version: '3.10'
181181
- name: Build SDist
182182
shell: bash
183183
run: |
@@ -209,7 +209,7 @@ jobs:
209209
cache: 'pip'
210210
cache-dependency-path: 'sdist/test/pyproject.toml'
211211
# Test sdist on lowest supported Python
212-
python-version: '3.9'
212+
python-version: '3.10'
213213
- name: Start MongoDB
214214
uses: supercharge/mongodb-github-action@90004df786821b6308fb02299e5835d0dae05d0d # 1.12.0
215215
- name: Run connect test from sdist
@@ -233,7 +233,7 @@ jobs:
233233
- name: Install uv
234234
uses: astral-sh/setup-uv@7edac99f961f18b581bbd960d59d049f04c0002f # v5
235235
with:
236-
python-version: '3.9'
236+
python-version: '3.10'
237237
- name: Start MongoDB
238238
uses: supercharge/mongodb-github-action@90004df786821b6308fb02299e5835d0dae05d0d # 1.12.0
239239
with:
@@ -259,7 +259,7 @@ jobs:
259259
- name: Install uv
260260
uses: astral-sh/setup-uv@7edac99f961f18b581bbd960d59d049f04c0002f # v5
261261
with:
262-
python-version: '3.9'
262+
python-version: '3.10'
263263
- name: Start MongoDB
264264
uses: supercharge/mongodb-github-action@90004df786821b6308fb02299e5835d0dae05d0d # 1.12.0
265265
with:

pyproject.toml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ dynamic = ["version", "dependencies", "optional-dependencies"]
88
description = "PyMongo - the Official MongoDB Python driver"
99
readme = "README.md"
1010
license = {file="LICENSE"}
11-
requires-python = ">=3.9"
11+
requires-python = ">=3.10"
1212
authors = [
1313
{ name = "The MongoDB Python Team" },
1414
]
@@ -30,11 +30,11 @@ classifiers = [
3030
"Programming Language :: Python :: Implementation :: PyPy",
3131
"Programming Language :: Python :: 3",
3232
"Programming Language :: Python :: 3 :: Only",
33-
"Programming Language :: Python :: 3.9",
3433
"Programming Language :: Python :: 3.10",
3534
"Programming Language :: Python :: 3.11",
3635
"Programming Language :: Python :: 3.12",
3736
"Programming Language :: Python :: 3.13",
37+
"Programming Language :: Python :: 3.14",
3838
"Topic :: Database",
3939
"Typing :: Typed",
4040
]
@@ -268,8 +268,6 @@ partial_branches = ["if (.*and +)*not _use_c( and.*)*:"]
268268
directory = "htmlcov"
269269

270270
[tool.cibuildwheel]
271-
# Enable free-threaded support
272-
free-threaded-support = true
273271
skip = "pp* *-musllinux*"
274272
build-frontend = "build"
275273
test-command = "python {project}/tools/fail_if_no_c.py"

0 commit comments

Comments
 (0)