Skip to content

Commit ac198af

Browse files
authored
PYTHON-4729 Drop support for MongoDB 3.6 (mongodb#1905)
1 parent 5fa4380 commit ac198af

35 files changed

+191
-132
lines changed

.evergreen/config.yml

Lines changed: 11 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,33 +1014,6 @@ tasks:
10141014
TOPOLOGY: "server"
10151015
- func: "run doctests"
10161016

1017-
- name: "test-3.6-standalone"
1018-
tags: ["3.6", "standalone"]
1019-
commands:
1020-
- func: "bootstrap mongo-orchestration"
1021-
vars:
1022-
VERSION: "3.6"
1023-
TOPOLOGY: "server"
1024-
- func: "run tests"
1025-
1026-
- name: "test-3.6-replica_set"
1027-
tags: ["3.6", "replica_set"]
1028-
commands:
1029-
- func: "bootstrap mongo-orchestration"
1030-
vars:
1031-
VERSION: "3.6"
1032-
TOPOLOGY: "replica_set"
1033-
- func: "run tests"
1034-
1035-
- name: "test-3.6-sharded_cluster"
1036-
tags: ["3.6", "sharded_cluster"]
1037-
commands:
1038-
- func: "bootstrap mongo-orchestration"
1039-
vars:
1040-
VERSION: "3.6"
1041-
TOPOLOGY: "sharded_cluster"
1042-
- func: "run tests"
1043-
10441017
- name: "test-4.0-standalone"
10451018
tags: ["4.0", "standalone"]
10461019
commands:
@@ -2186,10 +2159,6 @@ axes:
21862159
- id: mongodb-version
21872160
display_name: "MongoDB"
21882161
values:
2189-
- id: "3.6"
2190-
display_name: "MongoDB 3.6"
2191-
variables:
2192-
VERSION: "3.6"
21932162
- id: "4.0"
21942163
display_name: "MongoDB 4.0"
21952164
variables:
@@ -2490,7 +2459,6 @@ buildvariants:
24902459
- ".4.4"
24912460
- ".4.2"
24922461
- ".4.0"
2493-
- ".3.6"
24942462

24952463
- matrix_name: "test-macos-arm64"
24962464
matrix_spec:
@@ -2562,7 +2530,6 @@ buildvariants:
25622530
- ".4.4"
25632531
- ".4.2"
25642532
- ".4.0"
2565-
- ".3.6"
25662533

25672534
- matrix_name: "tests-pyopenssl"
25682535
matrix_spec:
@@ -2657,19 +2624,22 @@ buildvariants:
26572624
display_name: "${compression} ${c-extensions} ${python-version} ${platform}"
26582625
tasks:
26592626
- "test-latest-standalone"
2627+
- "test-8.0-standalone"
2628+
- "test-7.0-standalone"
2629+
- "test-6.0-standalone"
26602630
- "test-5.0-standalone"
26612631
- "test-4.4-standalone"
26622632
- "test-4.2-standalone"
2633+
- "test-4.0-standalone"
26632634
rules:
2664-
# Server versions 3.6 and 4.0 support snappy and zlib.
2635+
# Server version 4.0 supports snappy and zlib but not zstd.
26652636
- if:
26662637
python-version: "*"
26672638
c-extensions: "*"
2668-
compression: ["snappy", "zlib"]
2639+
compression: ["zstd"]
26692640
then:
2670-
add_tasks:
2641+
remove_tasks:
26712642
- "test-4.0-standalone"
2672-
- "test-3.6-standalone"
26732643

26742644
- matrix_name: "tests-python-version-green-framework-rhel8"
26752645
matrix_spec:
@@ -2734,7 +2704,7 @@ buildvariants:
27342704
matrix_spec:
27352705
platform: rhel8
27362706
storage-engine: "*"
2737-
python-version: 3.9
2707+
python-version: "3.9"
27382708
display_name: "Storage ${storage-engine} ${python-version} ${platform}"
27392709
rules:
27402710
- if:
@@ -2751,7 +2721,6 @@ buildvariants:
27512721
- "test-4.4-standalone"
27522722
- "test-4.2-standalone"
27532723
- "test-4.0-standalone"
2754-
- "test-3.6-standalone"
27552724
- if:
27562725
# MongoDB 4.2 drops support for MMAPv1
27572726
platform: rhel8
@@ -2761,8 +2730,6 @@ buildvariants:
27612730
add_tasks:
27622731
- "test-4.0-standalone"
27632732
- "test-4.0-replica_set"
2764-
- "test-3.6-standalone"
2765-
- "test-3.6-replica_set"
27662733

27672734
# enableTestCommands=0 tests on RHEL 8.4 (x86_64) with Python 3.9.
27682735
- matrix_name: "test-disableTestCommands"
@@ -2881,6 +2848,9 @@ buildvariants:
28812848
tasks:
28822849
# Versioned API was introduced in MongoDB 4.7
28832850
- "test-latest-standalone"
2851+
- "test-8.0-standalone"
2852+
- "test-7.0-standalone"
2853+
- "test-6.0-standalone"
28842854
- "test-5.0-standalone"
28852855

28862856
- matrix_name: "ocsp-test"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ a native Python driver for MongoDB. The `gridfs` package is a
1414
[gridfs](https://github.com/mongodb/specifications/blob/master/source/gridfs/gridfs-spec.rst/)
1515
implementation on top of `pymongo`.
1616

17-
PyMongo supports MongoDB 3.6, 4.0, 4.2, 4.4, 5.0, 6.0, 7.0, and 8.0.
17+
PyMongo supports MongoDB 4.0, 4.2, 4.4, 5.0, 6.0, 7.0, and 8.0.
1818

1919
## Support / Feedback
2020

doc/changelog.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,21 @@ Changes in Version 4.11.0
55
-------------------------
66

77
.. warning:: PyMongo 4.11 drops support for Python 3.8: Python 3.9+ or PyPy 3.9+ is now required.
8+
.. warning:: PyMongo 4.11 drops support for MongoDB 3.6. PyMongo now supports MongoDB 4.0+.
9+
Driver support for MongoDB 3.6 reached end of life in April 2024.
10+
11+
PyMongo 4.11 brings a number of changes including:
12+
13+
- Dropped support for Python 3.8.
14+
- Dropped support for MongoDB 3.6.
15+
16+
Issues Resolved
17+
...............
18+
19+
See the `PyMongo 4.11 release notes in JIRA`_ for the list of resolved issues
20+
in this release.
21+
22+
.. _PyMongo 4.11 release notes in JIRA: https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&version=40784
823

924
Changes in Version 4.10.1
1025
-------------------------

doc/common-issues.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ Also see the :ref:`TLSErrors` section.
66
Server reports wire version X, PyMongo requires Y
77
-------------------------------------------------
88

9-
When one attempts to connect to a <=3.4 version server, PyMongo will throw the following error::
9+
When one attempts to connect to a <=3.6 version server, PyMongo will throw the following error::
1010

1111
>>> client.admin.command('ping')
1212
...
13-
pymongo.errors.ConfigurationError: Server at localhost:27017 reports wire version 5, but this version of PyMongo requires at least 6 (MongoDB 3.6).
13+
pymongo.errors.ConfigurationError: Server at localhost:27017 reports wire version 6, but this version of PyMongo requires at least 7 (MongoDB 4.0).
1414

1515
This is caused by the driver being too new for the server it is being run against.
16-
To resolve this issue either upgrade your database to version >= 3.6 or downgrade to PyMongo 3.x which supports MongoDB >= 2.6.
16+
To resolve this issue either upgrade your database to version >= 4.0 or downgrade to an early version of PyMongo which supports MongoDB < 4.0.
1717

1818

1919
'Cursor' object has no attribute '_Cursor__killed'

doc/examples/authentication.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,8 @@ the "MongoDB Challenge-Response" protocol::
9797
Default Authentication Mechanism
9898
--------------------------------
9999

100-
If no mechanism is specified, PyMongo automatically SCRAM-SHA-1 when connected
101-
to MongoDB 3.6 and negotiates the mechanism to use (SCRAM-SHA-1
102-
or SCRAM-SHA-256) when connected to MongoDB 4.0+.
100+
If no mechanism is specified, PyMongo automatically negotiates the mechanism to use (SCRAM-SHA-1
101+
or SCRAM-SHA-256) with the MongoDB server.
103102

104103
Default Database and "authSource"
105104
---------------------------------

pymongo/asynchronous/collection.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1960,20 +1960,15 @@ async def _count_cmd(
19601960
collation: Optional[Collation],
19611961
) -> int:
19621962
"""Internal count command helper."""
1963-
# XXX: "ns missing" checks can be removed when we drop support for
1964-
# MongoDB 3.0, see SERVER-17051.
19651963
res = await self._command(
19661964
conn,
19671965
cmd,
19681966
read_preference=read_preference,
1969-
allowable_errors=["ns missing"],
19701967
codec_options=self._write_response_codec_options,
19711968
read_concern=self.read_concern,
19721969
collation=collation,
19731970
session=session,
19741971
)
1975-
if res.get("errmsg", "") == "ns missing":
1976-
return 0
19771972
return int(res["n"])
19781973

19791974
async def _aggregate_one_result(

pymongo/asynchronous/mongo_client.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -498,9 +498,8 @@ def __init__(
498498
- `authSource`: The database to authenticate on. Defaults to the
499499
database specified in the URI, if provided, or to "admin".
500500
- `authMechanism`: See :data:`~pymongo.auth.MECHANISMS` for options.
501-
If no mechanism is specified, PyMongo automatically SCRAM-SHA-1
502-
when connected to MongoDB 3.6 and negotiates the mechanism to use
503-
(SCRAM-SHA-1 or SCRAM-SHA-256) when connected to MongoDB 4.0+.
501+
If no mechanism is specified, PyMongo automatically negotiates the
502+
mechanism to use (SCRAM-SHA-1 or SCRAM-SHA-256) with the MongoDB server.
504503
- `authMechanismProperties`: Used to specify authentication mechanism
505504
specific options. To specify the service name for GSSAPI
506505
authentication pass authMechanismProperties='SERVICE_NAME:<service

pymongo/common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@
6666
MAX_WRITE_BATCH_SIZE = 1000
6767

6868
# What this version of PyMongo supports.
69-
MIN_SUPPORTED_SERVER_VERSION = "3.6"
70-
MIN_SUPPORTED_WIRE_VERSION = 6
69+
MIN_SUPPORTED_SERVER_VERSION = "4.0"
70+
MIN_SUPPORTED_WIRE_VERSION = 7
7171
# MongoDB 8.0
7272
MAX_SUPPORTED_WIRE_VERSION = 25
7373

pymongo/synchronous/collection.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1959,20 +1959,15 @@ def _count_cmd(
19591959
collation: Optional[Collation],
19601960
) -> int:
19611961
"""Internal count command helper."""
1962-
# XXX: "ns missing" checks can be removed when we drop support for
1963-
# MongoDB 3.0, see SERVER-17051.
19641962
res = self._command(
19651963
conn,
19661964
cmd,
19671965
read_preference=read_preference,
1968-
allowable_errors=["ns missing"],
19691966
codec_options=self._write_response_codec_options,
19701967
read_concern=self.read_concern,
19711968
collation=collation,
19721969
session=session,
19731970
)
1974-
if res.get("errmsg", "") == "ns missing":
1975-
return 0
19761971
return int(res["n"])
19771972

19781973
def _aggregate_one_result(

pymongo/synchronous/mongo_client.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -496,9 +496,8 @@ def __init__(
496496
- `authSource`: The database to authenticate on. Defaults to the
497497
database specified in the URI, if provided, or to "admin".
498498
- `authMechanism`: See :data:`~pymongo.auth.MECHANISMS` for options.
499-
If no mechanism is specified, PyMongo automatically SCRAM-SHA-1
500-
when connected to MongoDB 3.6 and negotiates the mechanism to use
501-
(SCRAM-SHA-1 or SCRAM-SHA-256) when connected to MongoDB 4.0+.
499+
If no mechanism is specified, PyMongo automatically negotiates the
500+
mechanism to use (SCRAM-SHA-1 or SCRAM-SHA-256) with the MongoDB server.
502501
- `authMechanismProperties`: Used to specify authentication mechanism
503502
specific options. To specify the service name for GSSAPI
504503
authentication pass authMechanismProperties='SERVICE_NAME:<service

0 commit comments

Comments
 (0)