Skip to content

Commit 2ff2fde

Browse files
authored
PYTHON-5049 Drop support for PyPy 3.9 (#2070)
1 parent 85877a0 commit 2ff2fde

15 files changed

+29
-99
lines changed

.evergreen/generated_configs/variants.yml

+12-52
Original file line numberDiff line numberDiff line change
@@ -256,15 +256,15 @@ buildvariants:
256256
expansions:
257257
COMPRESSORS: zstd
258258
PYTHON_BINARY: /opt/python/3.9/bin/python3
259-
- name: compression-snappy-rhel8-pypy3.9
259+
- name: compression-snappy-rhel8-pypy3.10
260260
tasks:
261261
- name: .standalone .noauth .nossl .sync_async
262-
display_name: Compression snappy RHEL8 PyPy3.9
262+
display_name: Compression snappy RHEL8 PyPy3.10
263263
run_on:
264264
- rhel87-small
265265
expansions:
266266
COMPRESSORS: snappy
267-
PYTHON_BINARY: /opt/python/pypy3.9/bin/python3
267+
PYTHON_BINARY: /opt/python/pypy3.10/bin/python3
268268
- name: compression-zlib-rhel8-pypy3.10
269269
tasks:
270270
- name: .standalone .noauth .nossl .sync_async
@@ -274,15 +274,15 @@ buildvariants:
274274
expansions:
275275
COMPRESSORS: zlib
276276
PYTHON_BINARY: /opt/python/pypy3.10/bin/python3
277-
- name: compression-zstd-rhel8-pypy3.9
277+
- name: compression-zstd-rhel8-pypy3.10
278278
tasks:
279279
- name: .standalone .noauth .nossl .sync_async !.4.0
280-
display_name: Compression zstd RHEL8 PyPy3.9
280+
display_name: Compression zstd RHEL8 PyPy3.10
281281
run_on:
282282
- rhel87-small
283283
expansions:
284284
COMPRESSORS: zstd
285-
PYTHON_BINARY: /opt/python/pypy3.9/bin/python3
285+
PYTHON_BINARY: /opt/python/pypy3.10/bin/python3
286286

287287
# Disable test commands tests
288288
- name: disable-test-commands-rhel8-python3.9
@@ -460,15 +460,6 @@ buildvariants:
460460
test_encryption: "true"
461461
test_encryption_pyopenssl: "true"
462462
PYTHON_BINARY: /opt/python/3.12/bin/python3
463-
- name: encryption-rhel8-pypy3.9
464-
tasks:
465-
- name: .sharded_cluster .auth .ssl .sync_async
466-
display_name: Encryption RHEL8 PyPy3.9
467-
run_on:
468-
- rhel87-small
469-
expansions:
470-
test_encryption: "true"
471-
PYTHON_BINARY: /opt/python/pypy3.9/bin/python3
472463
- name: encryption-macos-python3.9
473464
tasks:
474465
- name: .latest .replica_set .sync_async
@@ -608,15 +599,6 @@ buildvariants:
608599
expansions:
609600
AUTH: auth
610601
PYTHON_BINARY: C:/python/Python313/python.exe
611-
- name: auth-enterprise-rhel8-pypy3.9-auth
612-
tasks:
613-
- name: test-enterprise-auth
614-
display_name: Auth Enterprise RHEL8 PyPy3.9 Auth
615-
run_on:
616-
- rhel87-small
617-
expansions:
618-
AUTH: auth
619-
PYTHON_BINARY: /opt/python/pypy3.9/bin/python3
620602
- name: auth-enterprise-rhel8-pypy3.10-auth
621603
tasks:
622604
- name: test-enterprise-auth
@@ -900,10 +882,10 @@ buildvariants:
900882
TOPOLOGY: server
901883
VERSION: "8.0"
902884
PYTHON_BINARY: /opt/python/3.13/bin/python3
903-
- name: ocsp-rhel8-rapid-pypy3.9
885+
- name: ocsp-rhel8-rapid-pypy3.10
904886
tasks:
905887
- name: .ocsp
906-
display_name: OCSP RHEL8 rapid PyPy3.9
888+
display_name: OCSP RHEL8 rapid PyPy3.10
907889
run_on:
908890
- rhel87-small
909891
batchtime: 20160
@@ -912,11 +894,11 @@ buildvariants:
912894
SSL: ssl
913895
TOPOLOGY: server
914896
VERSION: rapid
915-
PYTHON_BINARY: /opt/python/pypy3.9/bin/python3
916-
- name: ocsp-rhel8-latest-pypy3.10
897+
PYTHON_BINARY: /opt/python/pypy3.10/bin/python3
898+
- name: ocsp-rhel8-latest-python3.9
917899
tasks:
918900
- name: .ocsp
919-
display_name: OCSP RHEL8 latest PyPy3.10
901+
display_name: OCSP RHEL8 latest Python3.9
920902
run_on:
921903
- rhel87-small
922904
batchtime: 20160
@@ -925,7 +907,7 @@ buildvariants:
925907
SSL: ssl
926908
TOPOLOGY: server
927909
VERSION: latest
928-
PYTHON_BINARY: /opt/python/pypy3.10/bin/python3
910+
PYTHON_BINARY: /opt/python/3.9/bin/python3
929911
- name: ocsp-win64-v4.4-python3.9
930912
tasks:
931913
- name: .ocsp-rsa !.ocsp-staple
@@ -1061,17 +1043,6 @@ buildvariants:
10611043
expansions:
10621044
test_pyopenssl: "true"
10631045
PYTHON_BINARY: C:/python/Python313/python.exe
1064-
- name: pyopenssl-rhel8-pypy3.9
1065-
tasks:
1066-
- name: .replica_set .auth .ssl .sync_async
1067-
- name: .7.0 .auth .ssl .sync_async
1068-
display_name: PyOpenSSL RHEL8 PyPy3.9
1069-
run_on:
1070-
- rhel87-small
1071-
batchtime: 10080
1072-
expansions:
1073-
test_pyopenssl: "true"
1074-
PYTHON_BINARY: /opt/python/pypy3.9/bin/python3
10751046
- name: pyopenssl-rhel8-pypy3.10
10761047
tasks:
10771048
- name: .replica_set .auth .ssl .sync_async
@@ -1164,17 +1135,6 @@ buildvariants:
11641135
expansions:
11651136
COVERAGE: coverage
11661137
PYTHON_BINARY: /opt/python/3.12/bin/python3
1167-
- name: test-rhel8-pypy3.9
1168-
tasks:
1169-
- name: .sharded_cluster .auth .ssl .sync_async
1170-
- name: .replica_set .noauth .ssl .sync_async
1171-
- name: .standalone .noauth .nossl .sync_async
1172-
display_name: "* Test RHEL8 PyPy3.9"
1173-
run_on:
1174-
- rhel87-small
1175-
expansions:
1176-
COVERAGE: coverage
1177-
PYTHON_BINARY: /opt/python/pypy3.9/bin/python3
11781138
- name: test-macos-python3.9
11791139
tasks:
11801140
- name: .sharded_cluster .auth .ssl !.sync_async

.evergreen/scripts/generate_config.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
ALL_VERSIONS = ["4.0", "4.4", "5.0", "6.0", "7.0", "8.0", "rapid", "latest"]
3030
CPYTHONS = ["3.9", "3.10", "3.11", "3.12", "3.13"]
31-
PYPYS = ["pypy3.9", "pypy3.10"]
31+
PYPYS = ["pypy3.10"]
3232
ALL_PYTHONS = CPYTHONS + PYPYS
3333
MIN_MAX_PYTHON = [CPYTHONS[0], CPYTHONS[-1]]
3434
BATCHTIME_WEEK = 10080

.github/workflows/test-python.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
strategy:
5656
matrix:
5757
os: [ubuntu-20.04]
58-
python-version: ["3.9", "pypy-3.9", "3.13", "3.13t"]
58+
python-version: ["3.9", "pypy-3.10", "3.13", "3.13t"]
5959
name: CPython ${{ matrix.python-version }}-${{ matrix.os }}
6060
steps:
6161
- uses: actions/checkout@v4

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ package that is incompatible with PyMongo.
9090

9191
## Dependencies
9292

93-
PyMongo supports CPython 3.9+ and PyPy3.9+.
93+
PyMongo supports CPython 3.9+ and PyPy3.10+.
9494

9595
Required dependencies:
9696

doc/changelog.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Changelog
44
Changes in Version 4.11.0 (YYYY/MM/DD)
55
--------------------------------------
66

7-
.. warning:: PyMongo 4.11 drops support for Python 3.8: Python 3.9+ or PyPy 3.9+ is now required.
7+
.. warning:: PyMongo 4.11 drops support for Python 3.8 and PyPy 3.9: Python 3.9+ or PyPy 3.10+ is now required.
88
.. warning:: PyMongo 4.11 drops support for MongoDB 3.6. PyMongo now supports MongoDB 4.0+.
99
Driver support for MongoDB 3.6 reached end of life in April 2024.
1010
.. warning:: Driver support for MongoDB 4.0 reaches end of life in April 2025.
@@ -14,7 +14,7 @@ Changes in Version 4.11.0 (YYYY/MM/DD)
1414

1515
PyMongo 4.11 brings a number of changes including:
1616

17-
- Dropped support for Python 3.8.
17+
- Dropped support for Python 3.8 and PyPy 3.9.
1818
- Dropped support for MongoDB 3.6.
1919
- Dropped support for the MONGODB-CR authenticate mechanism, which is no longer supported by MongoDB 4.0+.
2020
- pymongocrypt>=1.12 is now required for :ref:`In-Use Encryption` support.

doc/faq.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ they are returned to the pool.
166166
Does PyMongo support Python 3?
167167
------------------------------
168168

169-
PyMongo supports CPython 3.9+ and PyPy3.9+. See the :doc:`python3` for details.
169+
PyMongo supports CPython 3.9+ and PyPy3.10+. See the :doc:`python3` for details.
170170

171171
Does PyMongo support asynchronous frameworks like Gevent, asyncio, Tornado, or Twisted?
172172
---------------------------------------------------------------------------------------

doc/installation.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ To upgrade using pip::
2828
Dependencies
2929
------------
3030

31-
PyMongo supports CPython 3.9+ and PyPy3.9+.
31+
PyMongo supports CPython 3.9+ and PyPy3.10+.
3232

3333
Required dependencies
3434
.....................

doc/python3.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Python 3 FAQ
44
What Python 3 versions are supported?
55
-------------------------------------
66

7-
PyMongo supports CPython 3.9+ and PyPy3.9+.
7+
PyMongo supports CPython 3.9+ and PyPy3.10+.
88

99
Are there any PyMongo behavior changes with Python 3?
1010
-----------------------------------------------------

test/asynchronous/test_client.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -237,10 +237,7 @@ def test_getattr(self):
237237

238238
def test_iteration(self):
239239
client = self.client
240-
if "PyPy" in sys.version and sys.version_info < (3, 8, 15):
241-
msg = "'NoneType' object is not callable"
242-
else:
243-
msg = "'AsyncMongoClient' object is not iterable"
240+
msg = "'AsyncMongoClient' object is not iterable"
244241
# Iteration fails
245242
with self.assertRaisesRegex(TypeError, msg):
246243
for _ in client: # type: ignore[misc] # error: "None" not callable [misc]

test/asynchronous/test_collection.py

+1-7
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,7 @@ def test_getattr(self):
133133

134134
def test_iteration(self):
135135
coll = self.db.coll
136-
if "PyPy" in sys.version and sys.version_info < (3, 8, 15):
137-
msg = "'NoneType' object is not callable"
138-
else:
139-
if _IS_SYNC:
140-
msg = "'Collection' object is not iterable"
141-
else:
142-
msg = "'AsyncCollection' object is not iterable"
136+
msg = "'AsyncCollection' object is not iterable"
143137
# Iteration fails
144138
with self.assertRaisesRegex(TypeError, msg):
145139
for _ in coll: # type: ignore[misc] # error: "None" not callable [misc]

test/asynchronous/test_database.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,7 @@ def test_getattr(self):
103103

104104
def test_iteration(self):
105105
db = self.client.pymongo_test
106-
if "PyPy" in sys.version and sys.version_info < (3, 8, 15):
107-
msg = "'NoneType' object is not callable"
108-
else:
109-
msg = "'AsyncDatabase' object is not iterable"
106+
msg = "'AsyncDatabase' object is not iterable"
110107
# Iteration fails
111108
with self.assertRaisesRegex(TypeError, msg):
112109
for _ in db: # type: ignore[misc] # error: "None" not callable [misc]

test/test_client.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -234,10 +234,7 @@ def test_getattr(self):
234234

235235
def test_iteration(self):
236236
client = self.client
237-
if "PyPy" in sys.version and sys.version_info < (3, 8, 15):
238-
msg = "'NoneType' object is not callable"
239-
else:
240-
msg = "'MongoClient' object is not iterable"
237+
msg = "'MongoClient' object is not iterable"
241238
# Iteration fails
242239
with self.assertRaisesRegex(TypeError, msg):
243240
for _ in client: # type: ignore[misc] # error: "None" not callable [misc]

test/test_collection.py

+1-7
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,7 @@ def test_getattr(self):
133133

134134
def test_iteration(self):
135135
coll = self.db.coll
136-
if "PyPy" in sys.version and sys.version_info < (3, 8, 15):
137-
msg = "'NoneType' object is not callable"
138-
else:
139-
if _IS_SYNC:
140-
msg = "'Collection' object is not iterable"
141-
else:
142-
msg = "'Collection' object is not iterable"
136+
msg = "'Collection' object is not iterable"
143137
# Iteration fails
144138
with self.assertRaisesRegex(TypeError, msg):
145139
for _ in coll: # type: ignore[misc] # error: "None" not callable [misc]

test/test_database.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,7 @@ def test_getattr(self):
102102

103103
def test_iteration(self):
104104
db = self.client.pymongo_test
105-
if "PyPy" in sys.version and sys.version_info < (3, 8, 15):
106-
msg = "'NoneType' object is not callable"
107-
else:
108-
msg = "'Database' object is not iterable"
105+
msg = "'Database' object is not iterable"
109106
# Iteration fails
110107
with self.assertRaisesRegex(TypeError, msg):
111108
for _ in db: # type: ignore[misc] # error: "None" not callable [misc]

test/test_errors.py

+3-9
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,9 @@ def test_operation_failure(self):
4747
self.assertIn("full error", traceback.format_exc())
4848

4949
def _test_unicode_strs(self, exc):
50-
if sys.implementation.name == "pypy" and sys.implementation.version < (7, 3, 7):
51-
# PyPy used to display unicode in repr differently.
52-
self.assertEqual(
53-
"unicode \U0001f40d, full error: {'errmsg': 'unicode \\U0001f40d'}", str(exc)
54-
)
55-
else:
56-
self.assertEqual(
57-
"unicode \U0001f40d, full error: {'errmsg': 'unicode \U0001f40d'}", str(exc)
58-
)
50+
self.assertEqual(
51+
"unicode \U0001f40d, full error: {'errmsg': 'unicode \U0001f40d'}", str(exc)
52+
)
5953
try:
6054
raise exc
6155
except Exception:

0 commit comments

Comments
 (0)