Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PYTHON-5049 Drop support for PyPy 3.9 #2070

Merged
merged 2 commits into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 12 additions & 52 deletions .evergreen/generated_configs/variants.yml
Original file line number Diff line number Diff line change
Expand Up @@ -256,15 +256,15 @@ buildvariants:
expansions:
COMPRESSORS: zstd
PYTHON_BINARY: /opt/python/3.9/bin/python3
- name: compression-snappy-rhel8-pypy3.9
- name: compression-snappy-rhel8-pypy3.10
tasks:
- name: .standalone .noauth .nossl .sync_async
display_name: Compression snappy RHEL8 PyPy3.9
display_name: Compression snappy RHEL8 PyPy3.10
run_on:
- rhel87-small
expansions:
COMPRESSORS: snappy
PYTHON_BINARY: /opt/python/pypy3.9/bin/python3
PYTHON_BINARY: /opt/python/pypy3.10/bin/python3
- name: compression-zlib-rhel8-pypy3.10
tasks:
- name: .standalone .noauth .nossl .sync_async
Expand All @@ -274,15 +274,15 @@ buildvariants:
expansions:
COMPRESSORS: zlib
PYTHON_BINARY: /opt/python/pypy3.10/bin/python3
- name: compression-zstd-rhel8-pypy3.9
- name: compression-zstd-rhel8-pypy3.10
tasks:
- name: .standalone .noauth .nossl .sync_async !.4.0
display_name: Compression zstd RHEL8 PyPy3.9
display_name: Compression zstd RHEL8 PyPy3.10
run_on:
- rhel87-small
expansions:
COMPRESSORS: zstd
PYTHON_BINARY: /opt/python/pypy3.9/bin/python3
PYTHON_BINARY: /opt/python/pypy3.10/bin/python3

# Disable test commands tests
- name: disable-test-commands-rhel8-python3.9
Expand Down Expand Up @@ -460,15 +460,6 @@ buildvariants:
test_encryption: "true"
test_encryption_pyopenssl: "true"
PYTHON_BINARY: /opt/python/3.12/bin/python3
- name: encryption-rhel8-pypy3.9
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: there is still a pypy 3.10 variant above.

tasks:
- name: .sharded_cluster .auth .ssl .sync_async
display_name: Encryption RHEL8 PyPy3.9
run_on:
- rhel87-small
expansions:
test_encryption: "true"
PYTHON_BINARY: /opt/python/pypy3.9/bin/python3
- name: encryption-macos-python3.9
tasks:
- name: .latest .replica_set .sync_async
Expand Down Expand Up @@ -608,15 +599,6 @@ buildvariants:
expansions:
AUTH: auth
PYTHON_BINARY: C:/python/Python313/python.exe
- name: auth-enterprise-rhel8-pypy3.9-auth
tasks:
- name: test-enterprise-auth
display_name: Auth Enterprise RHEL8 PyPy3.9 Auth
run_on:
- rhel87-small
expansions:
AUTH: auth
PYTHON_BINARY: /opt/python/pypy3.9/bin/python3
- name: auth-enterprise-rhel8-pypy3.10-auth
tasks:
- name: test-enterprise-auth
Expand Down Expand Up @@ -900,10 +882,10 @@ buildvariants:
TOPOLOGY: server
VERSION: "8.0"
PYTHON_BINARY: /opt/python/3.13/bin/python3
- name: ocsp-rhel8-rapid-pypy3.9
- name: ocsp-rhel8-rapid-pypy3.10
tasks:
- name: .ocsp
display_name: OCSP RHEL8 rapid PyPy3.9
display_name: OCSP RHEL8 rapid PyPy3.10
run_on:
- rhel87-small
batchtime: 20160
Expand All @@ -912,11 +894,11 @@ buildvariants:
SSL: ssl
TOPOLOGY: server
VERSION: rapid
PYTHON_BINARY: /opt/python/pypy3.9/bin/python3
- name: ocsp-rhel8-latest-pypy3.10
PYTHON_BINARY: /opt/python/pypy3.10/bin/python3
- name: ocsp-rhel8-latest-python3.9
tasks:
- name: .ocsp
display_name: OCSP RHEL8 latest PyPy3.10
display_name: OCSP RHEL8 latest Python3.9
run_on:
- rhel87-small
batchtime: 20160
Expand All @@ -925,7 +907,7 @@ buildvariants:
SSL: ssl
TOPOLOGY: server
VERSION: latest
PYTHON_BINARY: /opt/python/pypy3.10/bin/python3
PYTHON_BINARY: /opt/python/3.9/bin/python3
- name: ocsp-win64-v4.4-python3.9
tasks:
- name: .ocsp-rsa !.ocsp-staple
Expand Down Expand Up @@ -1061,17 +1043,6 @@ buildvariants:
expansions:
test_pyopenssl: "true"
PYTHON_BINARY: C:/python/Python313/python.exe
- name: pyopenssl-rhel8-pypy3.9
tasks:
- name: .replica_set .auth .ssl .sync_async
- name: .7.0 .auth .ssl .sync_async
display_name: PyOpenSSL RHEL8 PyPy3.9
run_on:
- rhel87-small
batchtime: 10080
expansions:
test_pyopenssl: "true"
PYTHON_BINARY: /opt/python/pypy3.9/bin/python3
- name: pyopenssl-rhel8-pypy3.10
tasks:
- name: .replica_set .auth .ssl .sync_async
Expand Down Expand Up @@ -1164,17 +1135,6 @@ buildvariants:
expansions:
COVERAGE: coverage
PYTHON_BINARY: /opt/python/3.12/bin/python3
- name: test-rhel8-pypy3.9
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

tasks:
- name: .sharded_cluster .auth .ssl .sync_async
- name: .replica_set .noauth .ssl .sync_async
- name: .standalone .noauth .nossl .sync_async
display_name: "* Test RHEL8 PyPy3.9"
run_on:
- rhel87-small
expansions:
COVERAGE: coverage
PYTHON_BINARY: /opt/python/pypy3.9/bin/python3
- name: test-macos-python3.9
tasks:
- name: .sharded_cluster .auth .ssl !.sync_async
Expand Down
2 changes: 1 addition & 1 deletion .evergreen/scripts/generate_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

ALL_VERSIONS = ["4.0", "4.4", "5.0", "6.0", "7.0", "8.0", "rapid", "latest"]
CPYTHONS = ["3.9", "3.10", "3.11", "3.12", "3.13"]
PYPYS = ["pypy3.9", "pypy3.10"]
PYPYS = ["pypy3.10"]
ALL_PYTHONS = CPYTHONS + PYPYS
MIN_MAX_PYTHON = [CPYTHONS[0], CPYTHONS[-1]]
BATCHTIME_WEEK = 10080
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-20.04]
python-version: ["3.9", "pypy-3.9", "3.13", "3.13t"]
python-version: ["3.9", "pypy-3.10", "3.13", "3.13t"]
name: CPython ${{ matrix.python-version }}-${{ matrix.os }}
steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ package that is incompatible with PyMongo.

## Dependencies

PyMongo supports CPython 3.9+ and PyPy3.9+.
PyMongo supports CPython 3.9+ and PyPy3.10+.

Required dependencies:

Expand Down
4 changes: 2 additions & 2 deletions doc/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Changelog
Changes in Version 4.11.0 (YYYY/MM/DD)
--------------------------------------

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

PyMongo 4.11 brings a number of changes including:

- Dropped support for Python 3.8.
- Dropped support for Python 3.8 and PyPy 3.9.
- Dropped support for MongoDB 3.6.
- Dropped support for the MONGODB-CR authenticate mechanism, which is no longer supported by MongoDB 4.0+.
- pymongocrypt>=1.12 is now required for :ref:`In-Use Encryption` support.
Expand Down
2 changes: 1 addition & 1 deletion doc/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ they are returned to the pool.
Does PyMongo support Python 3?
------------------------------

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

Does PyMongo support asynchronous frameworks like Gevent, asyncio, Tornado, or Twisted?
---------------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion doc/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ To upgrade using pip::
Dependencies
------------

PyMongo supports CPython 3.9+ and PyPy3.9+.
PyMongo supports CPython 3.9+ and PyPy3.10+.

Required dependencies
.....................
Expand Down
2 changes: 1 addition & 1 deletion doc/python3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Python 3 FAQ
What Python 3 versions are supported?
-------------------------------------

PyMongo supports CPython 3.9+ and PyPy3.9+.
PyMongo supports CPython 3.9+ and PyPy3.10+.

Are there any PyMongo behavior changes with Python 3?
-----------------------------------------------------
Expand Down
5 changes: 1 addition & 4 deletions test/asynchronous/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,7 @@ def test_getattr(self):

def test_iteration(self):
client = self.client
if "PyPy" in sys.version and sys.version_info < (3, 8, 15):
msg = "'NoneType' object is not callable"
else:
msg = "'AsyncMongoClient' object is not iterable"
msg = "'AsyncMongoClient' object is not iterable"
# Iteration fails
with self.assertRaisesRegex(TypeError, msg):
for _ in client: # type: ignore[misc] # error: "None" not callable [misc]
Expand Down
9 changes: 3 additions & 6 deletions test/asynchronous/test_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,10 @@ def test_getattr(self):

def test_iteration(self):
coll = self.db.coll
if "PyPy" in sys.version and sys.version_info < (3, 8, 15):
msg = "'NoneType' object is not callable"
if _IS_SYNC:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can remove this if-else block now.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

msg = "'Collection' object is not iterable"
else:
if _IS_SYNC:
msg = "'Collection' object is not iterable"
else:
msg = "'AsyncCollection' object is not iterable"
msg = "'AsyncCollection' object is not iterable"
# Iteration fails
with self.assertRaisesRegex(TypeError, msg):
for _ in coll: # type: ignore[misc] # error: "None" not callable [misc]
Expand Down
5 changes: 1 addition & 4 deletions test/asynchronous/test_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,7 @@ def test_getattr(self):

def test_iteration(self):
db = self.client.pymongo_test
if "PyPy" in sys.version and sys.version_info < (3, 8, 15):
msg = "'NoneType' object is not callable"
else:
msg = "'AsyncDatabase' object is not iterable"
msg = "'AsyncDatabase' object is not iterable"
# Iteration fails
with self.assertRaisesRegex(TypeError, msg):
for _ in db: # type: ignore[misc] # error: "None" not callable [misc]
Expand Down
5 changes: 1 addition & 4 deletions test/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,7 @@ def test_getattr(self):

def test_iteration(self):
client = self.client
if "PyPy" in sys.version and sys.version_info < (3, 8, 15):
msg = "'NoneType' object is not callable"
else:
msg = "'MongoClient' object is not iterable"
msg = "'MongoClient' object is not iterable"
# Iteration fails
with self.assertRaisesRegex(TypeError, msg):
for _ in client: # type: ignore[misc] # error: "None" not callable [misc]
Expand Down
9 changes: 3 additions & 6 deletions test/test_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,10 @@ def test_getattr(self):

def test_iteration(self):
coll = self.db.coll
if "PyPy" in sys.version and sys.version_info < (3, 8, 15):
msg = "'NoneType' object is not callable"
if _IS_SYNC:
msg = "'Collection' object is not iterable"
else:
if _IS_SYNC:
msg = "'Collection' object is not iterable"
else:
msg = "'Collection' object is not iterable"
msg = "'Collection' object is not iterable"
# Iteration fails
with self.assertRaisesRegex(TypeError, msg):
for _ in coll: # type: ignore[misc] # error: "None" not callable [misc]
Expand Down
5 changes: 1 addition & 4 deletions test/test_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,7 @@ def test_getattr(self):

def test_iteration(self):
db = self.client.pymongo_test
if "PyPy" in sys.version and sys.version_info < (3, 8, 15):
msg = "'NoneType' object is not callable"
else:
msg = "'Database' object is not iterable"
msg = "'Database' object is not iterable"
# Iteration fails
with self.assertRaisesRegex(TypeError, msg):
for _ in db: # type: ignore[misc] # error: "None" not callable [misc]
Expand Down
12 changes: 3 additions & 9 deletions test/test_errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,9 @@ def test_operation_failure(self):
self.assertIn("full error", traceback.format_exc())

def _test_unicode_strs(self, exc):
if sys.implementation.name == "pypy" and sys.implementation.version < (7, 3, 7):
# PyPy used to display unicode in repr differently.
self.assertEqual(
"unicode \U0001f40d, full error: {'errmsg': 'unicode \\U0001f40d'}", str(exc)
)
else:
self.assertEqual(
"unicode \U0001f40d, full error: {'errmsg': 'unicode \U0001f40d'}", str(exc)
)
self.assertEqual(
"unicode \U0001f40d, full error: {'errmsg': 'unicode \U0001f40d'}", str(exc)
)
try:
raise exc
except Exception:
Expand Down
Loading