From f5eec45250781a3cd3369dc233d97f0272e905a2 Mon Sep 17 00:00:00 2001 From: Julius Park Date: Thu, 17 Feb 2022 16:23:23 -0800 Subject: [PATCH] PYTHON-3111 Rename "Versioned API" to "Stable API" in documentation (#867) --- .evergreen/config.yml | 2 +- .evergreen/resync-specs.sh | 2 +- doc/api/pymongo/server_api.rst | 4 ++-- doc/changelog.rst | 2 +- pymongo/database.py | 2 +- pymongo/mongo_client.py | 6 +++--- pymongo/pool.py | 2 +- pymongo/server_api.py | 14 +++++++------- test/__init__.py | 2 +- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.evergreen/config.yml b/.evergreen/config.yml index 8edc43df2..9bfd57c80 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -2561,7 +2561,7 @@ buildvariants: tasks: - name: atlas-data-lake-tests -- matrix_name: "versioned-api-tests" +- matrix_name: "stable-api-tests" matrix_spec: platform: ubuntu-18.04 python-version: ["3.6", "3.10"] diff --git a/.evergreen/resync-specs.sh b/.evergreen/resync-specs.sh index bf20f2303..d1bc26a91 100755 --- a/.evergreen/resync-specs.sh +++ b/.evergreen/resync-specs.sh @@ -136,7 +136,7 @@ do uri|uri*options) cpjson uri-options/tests uri_options ;; - versioned-api) + stable-api) cpjson versioned-api/tests versioned-api ;; *) diff --git a/doc/api/pymongo/server_api.rst b/doc/api/pymongo/server_api.rst index d961d07f1..de74411aa 100644 --- a/doc/api/pymongo/server_api.rst +++ b/doc/api/pymongo/server_api.rst @@ -1,8 +1,8 @@ -:mod:`server_api` -- Support for MongoDB Versioned API +:mod:`server_api` -- Support for MongoDB Stable API ====================================================== .. automodule:: pymongo.server_api - :synopsis: Support for MongoDB Versioned API + :synopsis: Support for MongoDB Stable API .. autoclass:: pymongo.server_api.ServerApi :members: diff --git a/doc/changelog.rst b/doc/changelog.rst index de38f188e..7dd57d532 100644 --- a/doc/changelog.rst +++ b/doc/changelog.rst @@ -258,7 +258,7 @@ Notable improvements .................... - Added support for MongoDB 5.0. -- Support for MongoDB Versioned API, see :class:`~pymongo.server_api.ServerApi`. +- Support for MongoDB Stable API, see :class:`~pymongo.server_api.ServerApi`. - Support for snapshot reads on secondaries (see :ref:`snapshot-reads-ref`). - Support for Azure and GCP KMS providers for client side field level encryption. See the docstring for :class:`~pymongo.mongo_client.MongoClient`, diff --git a/pymongo/database.py b/pymongo/database.py index f92dbc8ae..f43f18d01 100644 --- a/pymongo/database.py +++ b/pymongo/database.py @@ -686,7 +686,7 @@ class Database(common.BaseObject, Generic[_DocumentType]): .. note:: :meth:`command` does **not** apply any custom TypeDecoders when decoding the command response. - .. note:: If this client has been configured to use MongoDB Versioned + .. note:: If this client has been configured to use MongoDB Stable API (see :ref:`versioned-api-ref`), then :meth:`command` will automactically add API versioning options to the given command. Explicitly adding API versioning options in the command and diff --git a/pymongo/mongo_client.py b/pymongo/mongo_client.py index 9414d7196..4965b5e43 100644 --- a/pymongo/mongo_client.py +++ b/pymongo/mongo_client.py @@ -515,12 +515,12 @@ class MongoClient(common.BaseObject, Generic[_DocumentType]): - ``bypass_auto_encrpytion=False`` is passed to :class:`~pymongo.encryption_options.AutoEncryptionOpts` - | **Versioned API options:** - | (If not set explicitly, Versioned API will not be enabled.) + | **Stable API options:** + | (If not set explicitly, Stable API will not be enabled.) - `server_api`: A :class:`~pymongo.server_api.ServerApi` which configures this - client to use Versioned API. See :ref:`versioned-api-ref` for + client to use Stable API. See :ref:`versioned-api-ref` for details. .. seealso:: The MongoDB documentation on `connections `_. diff --git a/pymongo/pool.py b/pymongo/pool.py index 09709ffbf..475016371 100644 --- a/pymongo/pool.py +++ b/pymongo/pool.py @@ -587,7 +587,7 @@ class SocketInfo(object): def hello_cmd(self): # Handshake spec requires us to use OP_MSG+hello command for the - # initial handshake in load balanced or versioned api mode. + # initial handshake in load balanced or stable API mode. if self.opts.server_api or self.hello_ok or self.opts.load_balanced: self.op_msg_enabled = True return SON([(HelloCompat.CMD, 1)]) diff --git a/pymongo/server_api.py b/pymongo/server_api.py index 110406366..e92d6e617 100644 --- a/pymongo/server_api.py +++ b/pymongo/server_api.py @@ -12,11 +12,11 @@ # implied. See the License for the specific language governing # permissions and limitations under the License. -"""Support for MongoDB Versioned API. +"""Support for MongoDB Stable API. .. _versioned-api-ref: -MongoDB Versioned API +MongoDB Stable API ===================== Starting in MongoDB 5.0, applications can specify the server API version @@ -27,9 +27,9 @@ version, regardless of the server's actual release version. Declaring an API Version ```````````````````````` -.. attention:: Versioned API requires MongoDB >=5.0. +.. attention:: Stable API requires MongoDB >=5.0. -To configure MongoDB Versioned API, pass the ``server_api`` keyword option to +To configure MongoDB Stable API, pass the ``server_api`` keyword option to :class:`~pymongo.mongo_client.MongoClient`:: >>> from pymongo.mongo_client import MongoClient @@ -44,7 +44,7 @@ including those sent through the generic :meth:`~pymongo.database.Database.command` helper. .. note:: Declaring an API version on the - :class:`~pymongo.mongo_client.MongoClient` **and** specifying versioned + :class:`~pymongo.mongo_client.MongoClient` **and** specifying stable API options in :meth:`~pymongo.database.Database.command` command document is not supported and will lead to undefined behaviour. @@ -96,10 +96,10 @@ class ServerApiVersion: class ServerApi(object): - """MongoDB Versioned API.""" + """MongoDB Stable API.""" def __init__(self, version, strict=None, deprecation_errors=None): - """Options to configure MongoDB Versioned API. + """Options to configure MongoDB Stable API. :Parameters: - `version`: The API version string. Must be one of the values in diff --git a/test/__init__.py b/test/__init__.py index be0825025..b2906481e 100644 --- a/test/__init__.py +++ b/test/__init__.py @@ -913,7 +913,7 @@ def sanitize_cmd(cmd): cp.pop("$readPreference", None) cp.pop("lsid", None) if MONGODB_API_VERSION: - # Versioned api parameters + # Stable API parameters cp.pop("apiVersion", None) # OP_MSG encoding may move the payload type one field to the # end of the command. Do the same here.