From 493758d1d6054e442e19dcc7dbd2bb86a897901e Mon Sep 17 00:00:00 2001 From: Shane Harvey Date: Tue, 19 Jul 2022 17:59:59 -0700 Subject: [PATCH 1/3] BUMP 4.2 --- doc/changelog.rst | 25 ++++++++++++++++++++++++- pymongo/__init__.py | 2 +- setup.py | 2 +- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/doc/changelog.rst b/doc/changelog.rst index b6b099fd31..390f61d27f 100644 --- a/doc/changelog.rst +++ b/doc/changelog.rst @@ -13,6 +13,7 @@ PyMongo 4.2 brings a number of improvements including: changes may be made before the final release. See :ref:`automatic-queryable-client-side-encryption` for example usage. - Provisional (beta) support for :func:`pymongo.timeout` to apply a single timeout to an entire block of pymongo operations. +- Added the ``timeoutMS`` URI and :class:`~pymongo.mongo_client.MongoClient` keyword argument. - Added the :attr:`pymongo.errors.PyMongoError.timeout` property which is ``True`` when the error was caused by a timeout. - Added ``check_exists`` option to :meth:`~pymongo.database.Database.create_collection` @@ -25,7 +26,17 @@ Bug fixes - Fixed a bug where :meth:`~pymongo.collection.Collection.estimated_document_count` would fail with a "CommandNotSupportedOnView" error on views (`PYTHON-2885`_). - Fixed a bug where invalid UTF-8 strings could be passed as patterns for :class:`~bson.regex.Regex` - objects (`PYTHON-3048`_). :func:`bson.encode` now correctly raises :class:`bson.errors.InvalidStringData`. + objects. :func:`bson.encode` now correctly raises :class:`bson.errors.InvalidStringData` (`PYTHON-3048`_). +- Fixed a bug that caused "connection pool paused" errors in the child process after fork (`PYTHON-3257`_). +- Fixed a bug where :meth:`~pymongo.collection.Collection.count_documents` and + :meth:`~pymongo.collection.Collection.distinct` would fail in a transaction with + ``directConnection=True`` (`PYTHON-3333`_). +- GridFS no longer uploads an incomplete files collection document after encountering an + error in the middle of an upload fork. This results in fewer + :class:`~gridfs.errors.CorruptGridFile` errors (`PYTHON-1552`_). +- Renamed PyMongo's internal C extension methods to avoid crashing due to name conflicts + with mpi4py and other shared libraries (`PYTHON-2110`_). +- Fixed tight CPU loop for network I/O when using PyOpenSSL (`PYTHON-3187`_). Unavoidable breaking changes ............................ @@ -38,6 +49,11 @@ Unavoidable breaking changes Users of the Stable API with estimated_document_count are recommended to upgrade their server version to 5.0.9+ or set :attr:`pymongo.server_api.ServerApi.strict` to ``False`` to avoid encountering errors (`PYTHON-3167`_). +- Removed generic typing from :class:`~pymongo.client_session.ClientSession` to improve + support for pyright (`PYTHON-3283`_). +- Added ``__all__`` to the bson, pymongo, and gridfs packages. This could be a breaking + change for apps that relied on ``from bson import *`` to import APIs not present in + ``__all__`` (`PYTHON-3311`_). .. _count: https://mongodb.com/docs/manual/reference/command/count/ @@ -50,6 +66,13 @@ in this release. .. _PYTHON-3048: https://jira.mongodb.org/browse/PYTHON-3048 .. _PYTHON-2885: https://jira.mongodb.org/browse/PYTHON-2885 .. _PYTHON-3167: https://jira.mongodb.org/browse/PYTHON-3167 +.. _PYTHON-3257: https://jira.mongodb.org/browse/PYTHON-3257 +.. _PYTHON-3333: https://jira.mongodb.org/browse/PYTHON-3333 +.. _PYTHON-1552: https://jira.mongodb.org/browse/PYTHON-1552 +.. _PYTHON-2110: https://jira.mongodb.org/browse/PYTHON-2110 +.. _PYTHON-3283: https://jira.mongodb.org/browse/PYTHON-3283 +.. _PYTHON-3311: https://jira.mongodb.org/browse/PYTHON-3311 +.. _PYTHON-3187: https://jira.mongodb.org/browse/PYTHON-3187 .. _PyMongo 4.2 release notes in JIRA: https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&version=33196 .. _Queryable Encryption: automatic-queryable-client-side-encryption diff --git a/pymongo/__init__.py b/pymongo/__init__.py index 7eaa793648..ee246d25a9 100644 --- a/pymongo/__init__.py +++ b/pymongo/__init__.py @@ -84,7 +84,7 @@ .. _text index: http://mongodb.com/docs/manual/core/index-text/ """ -version_tuple: Tuple[Union[int, str], ...] = (4, 2, 0, ".dev2") +version_tuple: Tuple[Union[int, str], ...] = (4, 2, 0) def get_version_string() -> str: diff --git a/setup.py b/setup.py index ce6cce712e..94889d7261 100755 --- a/setup.py +++ b/setup.py @@ -34,7 +34,7 @@ except ImportError: _HAVE_SPHINX = False -version = "4.2.0.dev2" +version = "4.2.0" f = open("README.rst") try: From 3238c6d59b311758dddd69b9117ce65000637895 Mon Sep 17 00:00:00 2001 From: Shane Harvey Date: Tue, 19 Jul 2022 19:25:27 -0700 Subject: [PATCH 2/3] Mention CSFLE key management and crypt_shared features --- doc/changelog.rst | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/doc/changelog.rst b/doc/changelog.rst index 390f61d27f..69cbb0110e 100644 --- a/doc/changelog.rst +++ b/doc/changelog.rst @@ -16,9 +16,23 @@ PyMongo 4.2 brings a number of improvements including: - Added the ``timeoutMS`` URI and :class:`~pymongo.mongo_client.MongoClient` keyword argument. - Added the :attr:`pymongo.errors.PyMongoError.timeout` property which is ``True`` when the error was caused by a timeout. -- Added ``check_exists`` option to :meth:`~pymongo.database.Database.create_collection` +- Added the ``check_exists`` argument to :meth:`~pymongo.database.Database.create_collection` that when True (the default) runs an additional ``listCollections`` command to verify that the collection does not exist already. +- Added the following key management APIs to :class:`~pymongo.encryption.ClientEncryption`: + + - :meth:`~pymongo.encryption.ClientEncryption.get_key` + - :meth:`~pymongo.encryption.ClientEncryption.get_keys` + - :meth:`~pymongo.encryption.ClientEncryption.delete_key` + - :meth:`~pymongo.encryption.ClientEncryption.add_key_alt_name` + - :meth:`~pymongo.encryption.ClientEncryption.get_key_by_alt_name` + - :meth:`~pymongo.encryption.ClientEncryption.remove_key_alt_name` + - :meth:`~pymongo.encryption.ClientEncryption.rewrap_many_data_key` + - :class:`~pymongo.encryption.RewrapManyDataKeyResult` + +- Support for the ``crypt_shared`` library to replace ``mongocryptd`` using the new + ``crypt_shared_lib_path`` and ``crypt_shared_lib_required`` arguments to + :class:`~pymongo.encryption_options.AutoEncryptionOpts`. Bug fixes ......... From f80868b3c9fec46784e7b66d1d62e48508fe7504 Mon Sep 17 00:00:00 2001 From: Shane Harvey Date: Tue, 19 Jul 2022 19:58:22 -0700 Subject: [PATCH 3/3] Better changelog --- doc/changelog.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/changelog.rst b/doc/changelog.rst index 69cbb0110e..7afaca22a1 100644 --- a/doc/changelog.rst +++ b/doc/changelog.rst @@ -13,7 +13,7 @@ PyMongo 4.2 brings a number of improvements including: changes may be made before the final release. See :ref:`automatic-queryable-client-side-encryption` for example usage. - Provisional (beta) support for :func:`pymongo.timeout` to apply a single timeout to an entire block of pymongo operations. -- Added the ``timeoutMS`` URI and :class:`~pymongo.mongo_client.MongoClient` keyword argument. +- Added the ``timeoutMS`` URI and keyword argument to :class:`~pymongo.mongo_client.MongoClient`. - Added the :attr:`pymongo.errors.PyMongoError.timeout` property which is ``True`` when the error was caused by a timeout. - Added the ``check_exists`` argument to :meth:`~pymongo.database.Database.create_collection` @@ -41,7 +41,8 @@ Bug fixes would fail with a "CommandNotSupportedOnView" error on views (`PYTHON-2885`_). - Fixed a bug where invalid UTF-8 strings could be passed as patterns for :class:`~bson.regex.Regex` objects. :func:`bson.encode` now correctly raises :class:`bson.errors.InvalidStringData` (`PYTHON-3048`_). -- Fixed a bug that caused "connection pool paused" errors in the child process after fork (`PYTHON-3257`_). +- Fixed a bug that caused ``AutoReconnect("connection pool paused")`` errors in the child + process after fork (`PYTHON-3257`_). - Fixed a bug where :meth:`~pymongo.collection.Collection.count_documents` and :meth:`~pymongo.collection.Collection.distinct` would fail in a transaction with ``directConnection=True`` (`PYTHON-3333`_). @@ -64,7 +65,7 @@ Unavoidable breaking changes their server version to 5.0.9+ or set :attr:`pymongo.server_api.ServerApi.strict` to ``False`` to avoid encountering errors (`PYTHON-3167`_). - Removed generic typing from :class:`~pymongo.client_session.ClientSession` to improve - support for pyright (`PYTHON-3283`_). + support for Pyright (`PYTHON-3283`_). - Added ``__all__`` to the bson, pymongo, and gridfs packages. This could be a breaking change for apps that relied on ``from bson import *`` to import APIs not present in ``__all__`` (`PYTHON-3311`_).