diff --git a/.evergreen/config.yml b/.evergreen/config.yml index 7fb48c8054..a345e4f5b7 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -1014,33 +1014,6 @@ tasks: TOPOLOGY: "server" - func: "run doctests" - - name: "test-3.6-standalone" - tags: ["3.6", "standalone"] - commands: - - func: "bootstrap mongo-orchestration" - vars: - VERSION: "3.6" - TOPOLOGY: "server" - - func: "run tests" - - - name: "test-3.6-replica_set" - tags: ["3.6", "replica_set"] - commands: - - func: "bootstrap mongo-orchestration" - vars: - VERSION: "3.6" - TOPOLOGY: "replica_set" - - func: "run tests" - - - name: "test-3.6-sharded_cluster" - tags: ["3.6", "sharded_cluster"] - commands: - - func: "bootstrap mongo-orchestration" - vars: - VERSION: "3.6" - TOPOLOGY: "sharded_cluster" - - func: "run tests" - - name: "test-4.0-standalone" tags: ["4.0", "standalone"] commands: @@ -2186,10 +2159,6 @@ axes: - id: mongodb-version display_name: "MongoDB" values: - - id: "3.6" - display_name: "MongoDB 3.6" - variables: - VERSION: "3.6" - id: "4.0" display_name: "MongoDB 4.0" variables: @@ -2490,7 +2459,6 @@ buildvariants: - ".4.4" - ".4.2" - ".4.0" - - ".3.6" - matrix_name: "test-macos-arm64" matrix_spec: @@ -2562,7 +2530,6 @@ buildvariants: - ".4.4" - ".4.2" - ".4.0" - - ".3.6" - matrix_name: "tests-pyopenssl" matrix_spec: @@ -2657,19 +2624,22 @@ buildvariants: display_name: "${compression} ${c-extensions} ${python-version} ${platform}" tasks: - "test-latest-standalone" + - "test-8.0-standalone" + - "test-7.0-standalone" + - "test-6.0-standalone" - "test-5.0-standalone" - "test-4.4-standalone" - "test-4.2-standalone" + - "test-4.0-standalone" rules: - # Server versions 3.6 and 4.0 support snappy and zlib. + # Server version 4.0 supports snappy and zlib but not zstd. - if: python-version: "*" c-extensions: "*" - compression: ["snappy", "zlib"] + compression: ["zstd"] then: - add_tasks: + remove_tasks: - "test-4.0-standalone" - - "test-3.6-standalone" - matrix_name: "tests-python-version-green-framework-rhel8" matrix_spec: @@ -2734,7 +2704,7 @@ buildvariants: matrix_spec: platform: rhel8 storage-engine: "*" - python-version: 3.9 + python-version: "3.9" display_name: "Storage ${storage-engine} ${python-version} ${platform}" rules: - if: @@ -2751,7 +2721,6 @@ buildvariants: - "test-4.4-standalone" - "test-4.2-standalone" - "test-4.0-standalone" - - "test-3.6-standalone" - if: # MongoDB 4.2 drops support for MMAPv1 platform: rhel8 @@ -2761,8 +2730,6 @@ buildvariants: add_tasks: - "test-4.0-standalone" - "test-4.0-replica_set" - - "test-3.6-standalone" - - "test-3.6-replica_set" # enableTestCommands=0 tests on RHEL 8.4 (x86_64) with Python 3.9. - matrix_name: "test-disableTestCommands" @@ -2881,6 +2848,9 @@ buildvariants: tasks: # Versioned API was introduced in MongoDB 4.7 - "test-latest-standalone" + - "test-8.0-standalone" + - "test-7.0-standalone" + - "test-6.0-standalone" - "test-5.0-standalone" - matrix_name: "ocsp-test" diff --git a/README.md b/README.md index 9b5aa33f78..f5e2cdf46d 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ a native Python driver for MongoDB. The `gridfs` package is a [gridfs](https://github.com/mongodb/specifications/blob/master/source/gridfs/gridfs-spec.rst/) implementation on top of `pymongo`. -PyMongo supports MongoDB 3.6, 4.0, 4.2, 4.4, 5.0, 6.0, 7.0, and 8.0. +PyMongo supports MongoDB 4.0, 4.2, 4.4, 5.0, 6.0, 7.0, and 8.0. ## Support / Feedback diff --git a/doc/changelog.rst b/doc/changelog.rst index a73a89a0ef..6a118f56ca 100644 --- a/doc/changelog.rst +++ b/doc/changelog.rst @@ -5,6 +5,21 @@ Changes in Version 4.11.0 ------------------------- .. 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 MongoDB 3.6. PyMongo now supports MongoDB 4.0+. + Driver support for MongoDB 3.6 reached end of life in April 2024. + +PyMongo 4.11 brings a number of changes including: + +- Dropped support for Python 3.8. +- Dropped support for MongoDB 3.6. + +Issues Resolved +............... + +See the `PyMongo 4.11 release notes in JIRA`_ for the list of resolved issues +in this release. + +.. _PyMongo 4.11 release notes in JIRA: https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&version=40784 Changes in Version 4.10.1 ------------------------- diff --git a/doc/common-issues.rst b/doc/common-issues.rst index 3d2d06a5a7..b300bac784 100644 --- a/doc/common-issues.rst +++ b/doc/common-issues.rst @@ -6,14 +6,14 @@ Also see the :ref:`TLSErrors` section. Server reports wire version X, PyMongo requires Y ------------------------------------------------- -When one attempts to connect to a <=3.4 version server, PyMongo will throw the following error:: +When one attempts to connect to a <=3.6 version server, PyMongo will throw the following error:: >>> client.admin.command('ping') ... - pymongo.errors.ConfigurationError: Server at localhost:27017 reports wire version 5, but this version of PyMongo requires at least 6 (MongoDB 3.6). + pymongo.errors.ConfigurationError: Server at localhost:27017 reports wire version 6, but this version of PyMongo requires at least 7 (MongoDB 4.0). This is caused by the driver being too new for the server it is being run against. -To resolve this issue either upgrade your database to version >= 3.6 or downgrade to PyMongo 3.x which supports MongoDB >= 2.6. +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. 'Cursor' object has no attribute '_Cursor__killed' diff --git a/doc/examples/authentication.rst b/doc/examples/authentication.rst index 24b3cff8df..6c89910f3c 100644 --- a/doc/examples/authentication.rst +++ b/doc/examples/authentication.rst @@ -97,9 +97,8 @@ the "MongoDB Challenge-Response" protocol:: Default Authentication Mechanism -------------------------------- -If no mechanism is specified, PyMongo automatically SCRAM-SHA-1 when connected -to MongoDB 3.6 and negotiates the mechanism to use (SCRAM-SHA-1 -or SCRAM-SHA-256) when connected to MongoDB 4.0+. +If no mechanism is specified, PyMongo automatically negotiates the mechanism to use (SCRAM-SHA-1 +or SCRAM-SHA-256) with the MongoDB server. Default Database and "authSource" --------------------------------- diff --git a/pymongo/asynchronous/collection.py b/pymongo/asynchronous/collection.py index 5abc41a7e0..4ddcbab4d2 100644 --- a/pymongo/asynchronous/collection.py +++ b/pymongo/asynchronous/collection.py @@ -1960,20 +1960,15 @@ async def _count_cmd( collation: Optional[Collation], ) -> int: """Internal count command helper.""" - # XXX: "ns missing" checks can be removed when we drop support for - # MongoDB 3.0, see SERVER-17051. res = await self._command( conn, cmd, read_preference=read_preference, - allowable_errors=["ns missing"], codec_options=self._write_response_codec_options, read_concern=self.read_concern, collation=collation, session=session, ) - if res.get("errmsg", "") == "ns missing": - return 0 return int(res["n"]) async def _aggregate_one_result( diff --git a/pymongo/asynchronous/mongo_client.py b/pymongo/asynchronous/mongo_client.py index 814c604562..bfae302dac 100644 --- a/pymongo/asynchronous/mongo_client.py +++ b/pymongo/asynchronous/mongo_client.py @@ -498,9 +498,8 @@ def __init__( - `authSource`: The database to authenticate on. Defaults to the database specified in the URI, if provided, or to "admin". - `authMechanism`: See :data:`~pymongo.auth.MECHANISMS` for options. - If no mechanism is specified, PyMongo automatically SCRAM-SHA-1 - when connected to MongoDB 3.6 and negotiates the mechanism to use - (SCRAM-SHA-1 or SCRAM-SHA-256) when connected to MongoDB 4.0+. + If no mechanism is specified, PyMongo automatically negotiates the + mechanism to use (SCRAM-SHA-1 or SCRAM-SHA-256) with the MongoDB server. - `authMechanismProperties`: Used to specify authentication mechanism specific options. To specify the service name for GSSAPI authentication pass authMechanismProperties='SERVICE_NAME: int: """Internal count command helper.""" - # XXX: "ns missing" checks can be removed when we drop support for - # MongoDB 3.0, see SERVER-17051. res = self._command( conn, cmd, read_preference=read_preference, - allowable_errors=["ns missing"], codec_options=self._write_response_codec_options, read_concern=self.read_concern, collation=collation, session=session, ) - if res.get("errmsg", "") == "ns missing": - return 0 return int(res["n"]) def _aggregate_one_result( diff --git a/pymongo/synchronous/mongo_client.py b/pymongo/synchronous/mongo_client.py index b2dff5b4ab..1351cb200f 100644 --- a/pymongo/synchronous/mongo_client.py +++ b/pymongo/synchronous/mongo_client.py @@ -496,9 +496,8 @@ def __init__( - `authSource`: The database to authenticate on. Defaults to the database specified in the URI, if provided, or to "admin". - `authMechanism`: See :data:`~pymongo.auth.MECHANISMS` for options. - If no mechanism is specified, PyMongo automatically SCRAM-SHA-1 - when connected to MongoDB 3.6 and negotiates the mechanism to use - (SCRAM-SHA-1 or SCRAM-SHA-256) when connected to MongoDB 4.0+. + If no mechanism is specified, PyMongo automatically negotiates the + mechanism to use (SCRAM-SHA-1 or SCRAM-SHA-256) with the MongoDB server. - `authMechanismProperties`: Used to specify authentication mechanism specific options. To specify the service name for GSSAPI authentication pass authMechanismProperties='SERVICE_NAME: