From 518272027fbcda31ef4135eb343946b9e2b70777 Mon Sep 17 00:00:00 2001 From: Noah Stapp Date: Tue, 21 Oct 2025 10:12:44 -0400 Subject: [PATCH 1/3] PYTHON-5561 - Add support for PyPy 3.11 --- .evergreen/generated_configs/tasks.yml | 168 ++++++++++---------- .evergreen/scripts/generate_config_utils.py | 2 +- 2 files changed, 85 insertions(+), 85 deletions(-) diff --git a/.evergreen/generated_configs/tasks.yml b/.evergreen/generated_configs/tasks.yml index 855cbefef8..9a7f16f543 100644 --- a/.evergreen/generated_configs/tasks.yml +++ b/.evergreen/generated_configs/tasks.yml @@ -319,13 +319,13 @@ tasks: vars: PYTHON_VERSION: "3.14" tags: [test-no-orchestration, python-3.14] - - name: test-no-orchestration-pypy3.10 + - name: test-no-orchestration-pypy3.11 commands: - func: assume ec2 role - func: run tests vars: - PYTHON_VERSION: pypy3.10 - tags: [test-no-orchestration, python-pypy3.10] + PYTHON_VERSION: pypy3.11 + tags: [test-no-orchestration, python-pypy3.11] # No toolchain tests - name: test-no-toolchain-sync-noauth-nossl-standalone @@ -2515,7 +2515,7 @@ tasks: - replica_set-noauth-nossl - sync - pr - - name: test-server-version-pypy3.10-async-noauth-ssl-replica-set + - name: test-server-version-pypy3.11-async-noauth-ssl-replica-set commands: - func: run server vars: @@ -2527,11 +2527,11 @@ tasks: AUTH: noauth SSL: ssl TOPOLOGY: replica_set - PYTHON_VERSION: pypy3.10 + PYTHON_VERSION: pypy3.11 TEST_NAME: default_async tags: - server-version - - python-pypy3.10 + - python-pypy3.11 - replica_set-noauth-ssl - async - name: test-server-version-python3.14-sync-noauth-ssl-replica-set-cov @@ -2722,7 +2722,7 @@ tasks: - sharded_cluster-auth-ssl - async - free-threaded - - name: test-server-version-pypy3.10-async-auth-ssl-sharded-cluster + - name: test-server-version-pypy3.11-async-auth-ssl-sharded-cluster commands: - func: run server vars: @@ -2734,11 +2734,11 @@ tasks: AUTH: auth SSL: ssl TOPOLOGY: sharded_cluster - PYTHON_VERSION: pypy3.10 + PYTHON_VERSION: pypy3.11 TEST_NAME: default_async tags: - server-version - - python-pypy3.10 + - python-pypy3.11 - sharded_cluster-auth-ssl - async - name: test-server-version-python3.10-sync-auth-ssl-sharded-cluster-cov @@ -2867,7 +2867,7 @@ tasks: - sharded_cluster-auth-ssl - sync - free-threaded - - name: test-server-version-pypy3.10-sync-auth-ssl-sharded-cluster + - name: test-server-version-pypy3.11-sync-auth-ssl-sharded-cluster commands: - func: run server vars: @@ -2879,11 +2879,11 @@ tasks: AUTH: auth SSL: ssl TOPOLOGY: sharded_cluster - PYTHON_VERSION: pypy3.10 + PYTHON_VERSION: pypy3.11 TEST_NAME: default_sync tags: - server-version - - python-pypy3.10 + - python-pypy3.11 - sharded_cluster-auth-ssl - sync - name: test-server-version-python3.12-async-noauth-nossl-sharded-cluster-cov @@ -2949,7 +2949,7 @@ tasks: - python-3.10 - sharded_cluster-noauth-ssl - async - - name: test-server-version-pypy3.10-sync-noauth-ssl-sharded-cluster + - name: test-server-version-pypy3.11-sync-noauth-ssl-sharded-cluster commands: - func: run server vars: @@ -2961,11 +2961,11 @@ tasks: AUTH: noauth SSL: ssl TOPOLOGY: sharded_cluster - PYTHON_VERSION: pypy3.10 + PYTHON_VERSION: pypy3.11 TEST_NAME: default_sync tags: - server-version - - python-pypy3.10 + - python-pypy3.11 - sharded_cluster-noauth-ssl - sync - name: test-server-version-python3.13-async-auth-nossl-standalone-cov @@ -3074,7 +3074,7 @@ tasks: - standalone-noauth-nossl - async - pr - - name: test-server-version-pypy3.10-sync-noauth-nossl-standalone + - name: test-server-version-pypy3.11-sync-noauth-nossl-standalone commands: - func: run server vars: @@ -3086,11 +3086,11 @@ tasks: AUTH: noauth SSL: nossl TOPOLOGY: standalone - PYTHON_VERSION: pypy3.10 + PYTHON_VERSION: pypy3.11 TEST_NAME: default_sync tags: - server-version - - python-pypy3.10 + - python-pypy3.11 - standalone-noauth-nossl - sync - pr @@ -3203,7 +3203,7 @@ tasks: - python-3.12 - sharded_cluster-auth-ssl - sync - - name: test-standard-v4.2-pypy3.10-sync-auth-ssl-sharded-cluster + - name: test-standard-v4.2-pypy3.11-sync-auth-ssl-sharded-cluster commands: - func: run server vars: @@ -3217,12 +3217,12 @@ tasks: SSL: ssl TOPOLOGY: sharded_cluster VERSION: "4.2" - PYTHON_VERSION: pypy3.10 + PYTHON_VERSION: pypy3.11 TEST_NAME: default_sync tags: - test-standard - server-4.2 - - python-pypy3.10 + - python-pypy3.11 - sharded_cluster-auth-ssl - sync - pypy @@ -3337,7 +3337,7 @@ tasks: - python-3.12 - sharded_cluster-auth-ssl - async - - name: test-standard-v4.4-pypy3.10-async-auth-ssl-sharded-cluster + - name: test-standard-v4.4-pypy3.11-async-auth-ssl-sharded-cluster commands: - func: run server vars: @@ -3351,12 +3351,12 @@ tasks: SSL: ssl TOPOLOGY: sharded_cluster VERSION: "4.4" - PYTHON_VERSION: pypy3.10 + PYTHON_VERSION: pypy3.11 TEST_NAME: default_async tags: - test-standard - server-4.4 - - python-pypy3.10 + - python-pypy3.11 - sharded_cluster-auth-ssl - async - pypy @@ -3716,7 +3716,7 @@ tasks: - python-3.12 - standalone-noauth-nossl - sync - - name: test-standard-v7.0-pypy3.10-sync-noauth-nossl-standalone + - name: test-standard-v7.0-pypy3.11-sync-noauth-nossl-standalone commands: - func: run server vars: @@ -3730,12 +3730,12 @@ tasks: SSL: nossl TOPOLOGY: standalone VERSION: "7.0" - PYTHON_VERSION: pypy3.10 + PYTHON_VERSION: pypy3.11 TEST_NAME: default_sync tags: - test-standard - server-7.0 - - python-pypy3.10 + - python-pypy3.11 - standalone-noauth-nossl - sync - pypy @@ -3828,7 +3828,7 @@ tasks: - python-3.12 - standalone-noauth-nossl - async - - name: test-standard-v8.0-pypy3.10-async-noauth-nossl-standalone + - name: test-standard-v8.0-pypy3.11-async-noauth-nossl-standalone commands: - func: run server vars: @@ -3842,12 +3842,12 @@ tasks: SSL: nossl TOPOLOGY: standalone VERSION: "8.0" - PYTHON_VERSION: pypy3.10 + PYTHON_VERSION: pypy3.11 TEST_NAME: default_async tags: - test-standard - server-8.0 - - python-pypy3.10 + - python-pypy3.11 - standalone-noauth-nossl - async - pypy @@ -3874,7 +3874,7 @@ tasks: - replica_set-noauth-ssl - async - pr - - name: test-standard-latest-pypy3.10-async-noauth-ssl-replica-set + - name: test-standard-latest-pypy3.11-async-noauth-ssl-replica-set commands: - func: run server vars: @@ -3888,12 +3888,12 @@ tasks: SSL: ssl TOPOLOGY: replica_set VERSION: latest - PYTHON_VERSION: pypy3.10 + PYTHON_VERSION: pypy3.11 TEST_NAME: default_async tags: - test-standard - server-latest - - python-pypy3.10 + - python-pypy3.11 - replica_set-noauth-ssl - async - pypy @@ -3988,7 +3988,7 @@ tasks: - python-3.12 - replica_set-noauth-ssl - sync - - name: test-standard-rapid-pypy3.10-sync-noauth-ssl-replica-set + - name: test-standard-rapid-pypy3.11-sync-noauth-ssl-replica-set commands: - func: run server vars: @@ -4002,12 +4002,12 @@ tasks: SSL: ssl TOPOLOGY: replica_set VERSION: rapid - PYTHON_VERSION: pypy3.10 + PYTHON_VERSION: pypy3.11 TEST_NAME: default_sync tags: - test-standard - server-rapid - - python-pypy3.10 + - python-pypy3.11 - replica_set-noauth-ssl - sync - pypy @@ -4142,7 +4142,7 @@ tasks: - python-3.10 - standalone-noauth-nossl - noauth - - name: test-non-standard-v4.2-pypy3.10-noauth-nossl-standalone + - name: test-non-standard-v4.2-pypy3.11-noauth-nossl-standalone commands: - func: run server vars: @@ -4156,11 +4156,11 @@ tasks: SSL: nossl TOPOLOGY: standalone VERSION: "4.2" - PYTHON_VERSION: pypy3.10 + PYTHON_VERSION: pypy3.11 tags: - test-non-standard - server-4.2 - - python-pypy3.10 + - python-pypy3.11 - standalone-noauth-nossl - noauth - pypy @@ -4186,7 +4186,7 @@ tasks: - replica_set-noauth-ssl - noauth - free-threaded - - name: test-non-standard-v4.4-pypy3.10-noauth-ssl-replica-set + - name: test-non-standard-v4.4-pypy3.11-noauth-ssl-replica-set commands: - func: run server vars: @@ -4200,11 +4200,11 @@ tasks: SSL: ssl TOPOLOGY: replica_set VERSION: "4.4" - PYTHON_VERSION: pypy3.10 + PYTHON_VERSION: pypy3.11 tags: - test-non-standard - server-4.4 - - python-pypy3.10 + - python-pypy3.11 - replica_set-noauth-ssl - noauth - pypy @@ -4292,7 +4292,7 @@ tasks: - python-3.12 - sharded_cluster-auth-ssl - auth - - name: test-non-standard-v5.0-pypy3.10-auth-ssl-sharded-cluster + - name: test-non-standard-v5.0-pypy3.11-auth-ssl-sharded-cluster commands: - func: run server vars: @@ -4306,11 +4306,11 @@ tasks: SSL: ssl TOPOLOGY: sharded_cluster VERSION: "5.0" - PYTHON_VERSION: pypy3.10 + PYTHON_VERSION: pypy3.11 tags: - test-non-standard - server-5.0 - - python-pypy3.10 + - python-pypy3.11 - sharded_cluster-auth-ssl - auth - pypy @@ -4399,7 +4399,7 @@ tasks: - python-3.13 - standalone-noauth-nossl - noauth - - name: test-non-standard-v6.0-pypy3.10-noauth-nossl-standalone + - name: test-non-standard-v6.0-pypy3.11-noauth-nossl-standalone commands: - func: run server vars: @@ -4413,11 +4413,11 @@ tasks: SSL: nossl TOPOLOGY: standalone VERSION: "6.0" - PYTHON_VERSION: pypy3.10 + PYTHON_VERSION: pypy3.11 tags: - test-non-standard - server-6.0 - - python-pypy3.10 + - python-pypy3.11 - standalone-noauth-nossl - noauth - pypy @@ -4442,7 +4442,7 @@ tasks: - python-3.11 - replica_set-noauth-ssl - noauth - - name: test-non-standard-v7.0-pypy3.10-noauth-ssl-replica-set + - name: test-non-standard-v7.0-pypy3.11-noauth-ssl-replica-set commands: - func: run server vars: @@ -4456,11 +4456,11 @@ tasks: SSL: ssl TOPOLOGY: replica_set VERSION: "7.0" - PYTHON_VERSION: pypy3.10 + PYTHON_VERSION: pypy3.11 tags: - test-non-standard - server-7.0 - - python-pypy3.10 + - python-pypy3.11 - replica_set-noauth-ssl - noauth - pypy @@ -4549,7 +4549,7 @@ tasks: - python-3.14 - sharded_cluster-auth-ssl - auth - - name: test-non-standard-v8.0-pypy3.10-auth-ssl-sharded-cluster + - name: test-non-standard-v8.0-pypy3.11-auth-ssl-sharded-cluster commands: - func: run server vars: @@ -4563,11 +4563,11 @@ tasks: SSL: ssl TOPOLOGY: sharded_cluster VERSION: "8.0" - PYTHON_VERSION: pypy3.10 + PYTHON_VERSION: pypy3.11 tags: - test-non-standard - server-8.0 - - python-pypy3.10 + - python-pypy3.11 - sharded_cluster-auth-ssl - auth - pypy @@ -4615,7 +4615,7 @@ tasks: - noauth - free-threaded - pr - - name: test-non-standard-latest-pypy3.10-noauth-ssl-replica-set + - name: test-non-standard-latest-pypy3.11-noauth-ssl-replica-set commands: - func: run server vars: @@ -4629,11 +4629,11 @@ tasks: SSL: ssl TOPOLOGY: replica_set VERSION: latest - PYTHON_VERSION: pypy3.10 + PYTHON_VERSION: pypy3.11 tags: - test-non-standard - server-latest - - python-pypy3.10 + - python-pypy3.11 - replica_set-noauth-ssl - noauth - pypy @@ -4744,7 +4744,7 @@ tasks: - python-3.10 - standalone-noauth-nossl - noauth - - name: test-non-standard-rapid-pypy3.10-noauth-nossl-standalone + - name: test-non-standard-rapid-pypy3.11-noauth-nossl-standalone commands: - func: run server vars: @@ -4758,11 +4758,11 @@ tasks: SSL: nossl TOPOLOGY: standalone VERSION: rapid - PYTHON_VERSION: pypy3.10 + PYTHON_VERSION: pypy3.11 tags: - test-non-standard - server-rapid - - python-pypy3.10 + - python-pypy3.11 - standalone-noauth-nossl - noauth - pypy @@ -4789,7 +4789,7 @@ tasks: - python-3.10 - sharded_cluster-auth-ssl - auth - - name: test-standard-auth-v4.2-pypy3.10-auth-ssl-sharded-cluster + - name: test-standard-auth-v4.2-pypy3.11-auth-ssl-sharded-cluster commands: - func: run server vars: @@ -4803,11 +4803,11 @@ tasks: SSL: ssl TOPOLOGY: sharded_cluster VERSION: "4.2" - PYTHON_VERSION: pypy3.10 + PYTHON_VERSION: pypy3.11 tags: - test-standard-auth - server-4.2 - - python-pypy3.10 + - python-pypy3.11 - sharded_cluster-auth-ssl - auth - pypy @@ -4832,7 +4832,7 @@ tasks: - python-3.11 - sharded_cluster-auth-ssl - auth - - name: test-standard-auth-v4.4-pypy3.10-auth-ssl-sharded-cluster + - name: test-standard-auth-v4.4-pypy3.11-auth-ssl-sharded-cluster commands: - func: run server vars: @@ -4846,11 +4846,11 @@ tasks: SSL: ssl TOPOLOGY: sharded_cluster VERSION: "4.4" - PYTHON_VERSION: pypy3.10 + PYTHON_VERSION: pypy3.11 tags: - test-standard-auth - server-4.4 - - python-pypy3.10 + - python-pypy3.11 - sharded_cluster-auth-ssl - auth - pypy @@ -4875,7 +4875,7 @@ tasks: - python-3.12 - sharded_cluster-auth-ssl - auth - - name: test-standard-auth-v5.0-pypy3.10-auth-ssl-sharded-cluster + - name: test-standard-auth-v5.0-pypy3.11-auth-ssl-sharded-cluster commands: - func: run server vars: @@ -4889,11 +4889,11 @@ tasks: SSL: ssl TOPOLOGY: sharded_cluster VERSION: "5.0" - PYTHON_VERSION: pypy3.10 + PYTHON_VERSION: pypy3.11 tags: - test-standard-auth - server-5.0 - - python-pypy3.10 + - python-pypy3.11 - sharded_cluster-auth-ssl - auth - pypy @@ -4918,7 +4918,7 @@ tasks: - python-3.13 - sharded_cluster-auth-ssl - auth - - name: test-standard-auth-v6.0-pypy3.10-auth-ssl-sharded-cluster + - name: test-standard-auth-v6.0-pypy3.11-auth-ssl-sharded-cluster commands: - func: run server vars: @@ -4932,11 +4932,11 @@ tasks: SSL: ssl TOPOLOGY: sharded_cluster VERSION: "6.0" - PYTHON_VERSION: pypy3.10 + PYTHON_VERSION: pypy3.11 tags: - test-standard-auth - server-6.0 - - python-pypy3.10 + - python-pypy3.11 - sharded_cluster-auth-ssl - auth - pypy @@ -4962,7 +4962,7 @@ tasks: - sharded_cluster-auth-ssl - auth - free-threaded - - name: test-standard-auth-v7.0-pypy3.10-auth-ssl-sharded-cluster + - name: test-standard-auth-v7.0-pypy3.11-auth-ssl-sharded-cluster commands: - func: run server vars: @@ -4976,11 +4976,11 @@ tasks: SSL: ssl TOPOLOGY: sharded_cluster VERSION: "7.0" - PYTHON_VERSION: pypy3.10 + PYTHON_VERSION: pypy3.11 tags: - test-standard-auth - server-7.0 - - python-pypy3.10 + - python-pypy3.11 - sharded_cluster-auth-ssl - auth - pypy @@ -5005,7 +5005,7 @@ tasks: - python-3.14 - sharded_cluster-auth-ssl - auth - - name: test-standard-auth-v8.0-pypy3.10-auth-ssl-sharded-cluster + - name: test-standard-auth-v8.0-pypy3.11-auth-ssl-sharded-cluster commands: - func: run server vars: @@ -5019,11 +5019,11 @@ tasks: SSL: ssl TOPOLOGY: sharded_cluster VERSION: "8.0" - PYTHON_VERSION: pypy3.10 + PYTHON_VERSION: pypy3.11 tags: - test-standard-auth - server-8.0 - - python-pypy3.10 + - python-pypy3.11 - sharded_cluster-auth-ssl - auth - pypy @@ -5049,7 +5049,7 @@ tasks: - sharded_cluster-auth-ssl - auth - pr - - name: test-standard-auth-latest-pypy3.10-auth-ssl-sharded-cluster + - name: test-standard-auth-latest-pypy3.11-auth-ssl-sharded-cluster commands: - func: run server vars: @@ -5063,11 +5063,11 @@ tasks: SSL: ssl TOPOLOGY: sharded_cluster VERSION: latest - PYTHON_VERSION: pypy3.10 + PYTHON_VERSION: pypy3.11 tags: - test-standard-auth - server-latest - - python-pypy3.10 + - python-pypy3.11 - sharded_cluster-auth-ssl - auth - pypy @@ -5092,7 +5092,7 @@ tasks: - python-3.10 - sharded_cluster-auth-ssl - auth - - name: test-standard-auth-rapid-pypy3.10-auth-ssl-sharded-cluster + - name: test-standard-auth-rapid-pypy3.11-auth-ssl-sharded-cluster commands: - func: run server vars: @@ -5106,11 +5106,11 @@ tasks: SSL: ssl TOPOLOGY: sharded_cluster VERSION: rapid - PYTHON_VERSION: pypy3.10 + PYTHON_VERSION: pypy3.11 tags: - test-standard-auth - server-rapid - - python-pypy3.10 + - python-pypy3.11 - sharded_cluster-auth-ssl - auth - pypy diff --git a/.evergreen/scripts/generate_config_utils.py b/.evergreen/scripts/generate_config_utils.py index 4eb6bcb0dc..28ee45f9b7 100644 --- a/.evergreen/scripts/generate_config_utils.py +++ b/.evergreen/scripts/generate_config_utils.py @@ -23,7 +23,7 @@ ALL_VERSIONS = ["4.2", "4.4", "5.0", "6.0", "7.0", "8.0", "rapid", "latest"] CPYTHONS = ["3.10", "3.11", "3.12", "3.13", "3.14t", "3.14"] -PYPYS = ["pypy3.10"] +PYPYS = ["pypy3.11"] ALL_PYTHONS = CPYTHONS + PYPYS MIN_MAX_PYTHON = [CPYTHONS[0], CPYTHONS[-1]] BATCHTIME_WEEK = 10080 From ce7074afa43bf2b0237175b3a0a6751263f90bda Mon Sep 17 00:00:00 2001 From: Noah Stapp Date: Tue, 21 Oct 2025 10:28:07 -0400 Subject: [PATCH 2/3] Update github tests --- .github/workflows/test-python.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-python.yml b/.github/workflows/test-python.yml index a057570f3f..4685ba2d92 100644 --- a/.github/workflows/test-python.yml +++ b/.github/workflows/test-python.yml @@ -59,7 +59,7 @@ jobs: matrix: # Tests currently only pass on ubuntu on GitHub Actions. os: [ubuntu-latest] - python-version: ["3.10", "pypy-3.10", "3.13t"] + python-version: ["3.10", "pypy-3.11", "3.13t"] mongodb-version: ["8.0"] name: CPython ${{ matrix.python-version }}-${{ matrix.os }} From e55ac4167bbeeaf53b053fca775c86b7e8d42531 Mon Sep 17 00:00:00 2001 From: Noah Stapp Date: Tue, 21 Oct 2025 12:03:28 -0400 Subject: [PATCH 3/3] Update changelog --- doc/changelog.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/changelog.rst b/doc/changelog.rst index f3eb4f6f23..47d3fafd66 100644 --- a/doc/changelog.rst +++ b/doc/changelog.rst @@ -6,9 +6,9 @@ Changes in Version 4.16.0 (XXXX/XX/XX) PyMongo 4.16 brings a number of changes including: -.. warning:: PyMongo 4.16 drops support for Python 3.9: Python 3.10+ is now required. +.. warning:: PyMongo 4.16 drops support for Python 3.9 and PyPy 3.10: Python 3.10+ or PyPy 3.11+ is now required. -- Dropped support for Python 3.9. +- Dropped support for Python 3.9 and PyPy 3.10. - Removed invalid documents from :class:`bson.errors.InvalidDocument` error messages as doing so may leak sensitive user data. Instead, invalid documents are stored in :attr:`bson.errors.InvalidDocument.document`.