From 64fbc8313b5983c78ff55de9fa35f64c8fc659a2 Mon Sep 17 00:00:00 2001 From: Tushar Singh Date: Thu, 10 Mar 2022 02:43:02 +0530 Subject: [PATCH] MOTOR-884 Mirror all PyMongo extras (#148) --- README.rst | 41 ++++++++++++++++++++++++++++++ doc/contributors.rst | 1 + doc/installation.rst | 60 ++++++++++++++++++++++++++++++++++++++++++++ setup.py | 10 +++++++- 4 files changed, 111 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 67d5765e..08b39758 100644 --- a/README.rst +++ b/README.rst @@ -101,6 +101,47 @@ asyncio. It requires: * PyMongo_ >=3.12,<4 * Python 3.5+ +Optional dependencies: + +Motor supports same optional dependencies as PyMongo. Required dependencies can be installed +along with Motor. + +GSSAPI authentication requires ``gssapi`` extra dependency. The correct +dependency can be installed automatically along with Motor:: + + $ pip install "motor[gssapi]" + +similarly, + +MONGODB-AWS authentication requires ``aws`` extra dependency:: + + $ pip install "motor[aws]" + +Support for mongodb+srv:// URIs requires ``srv`` extra dependency:: + + $ pip install "motor[srv]" + +OCSP requires ``ocsp`` extra dependency:: + + $ pip install "motor[ocsp]" + +Wire protocol compression with snappy requires ``snappy`` extra dependency:: + + $ pip install "motor[snappy]" + +Wire protocol compression with zstandard requires ``zstd`` extra dependency:: + + $ pip install "motor[zstd]" + +Client-Side Field Level Encryption requires ``encryption`` extra dependency:: + + $ pip install "motor[encryption]" + +You can install all dependencies automatically with the following +command:: + + $ pip install "motor[gssapi,aws,ocsp,snappy,srv,zstd,encryption]" + See `requirements `_ for details about compatibility. diff --git a/doc/contributors.rst b/doc/contributors.rst index b3450e71..e74be382 100644 --- a/doc/contributors.rst +++ b/doc/contributors.rst @@ -14,3 +14,4 @@ The following is a list of people who have contributed to - Shane Harvey - Bulat Khasanov - William Zhou +- Tushar Singh diff --git a/doc/installation.rst b/doc/installation.rst index 03f6d491..79757298 100644 --- a/doc/installation.rst +++ b/doc/installation.rst @@ -12,6 +12,66 @@ To install Motor from sources, you can clone its git repository and do:: $ python3 -m pip install . +Dependencies +------------ + +Motor works in all the environments officially supported by Tornado or by +asyncio. It requires: + +* Unix (including macOS) or Windows. +* PyMongo_ >=3.12,<4 +* Python 3.5+ + +Optional dependencies: + +Motor supports same optional dependencies as PyMongo. Required dependencies can be installed +along with Motor. + +GSSAPI authentication requires ``gssapi`` extra dependency. The correct +dependency can be installed automatically along with Motor:: + + $ pip install "motor[gssapi]" + +similarly, + +`MONGODB-AWS `_ +authentication requires ``aws`` extra dependency:: + + $ pip install "motor[aws]" + +Support for mongodb+srv:// URIs requires ``srv`` extra dependency:: + + $ pip install "motor[srv]" + +`OCSP `_ requires ``ocsp`` extra dependency:: + + $ pip install "motor[ocsp]" + +Wire protocol compression with snappy requires ``snappy`` extra dependency:: + + $ pip install "motor[snappy]" + +Wire protocol compression with zstandard requires ``zstd`` extra dependency:: + + $ pip install "motor[zstd]" + +`Client-Side Field Level Encryption +`_ +requires ``encryption`` extra dependency:: + + $ pip install "motor[encryption]" + +You can install all dependencies automatically with the following +command:: + + $ pip install "motor[gssapi,aws,ocsp,snappy,srv,zstd,encryption]" + +See `requirements `_ +for details about compatibility. + + .. _PyPI: http://pypi.python.org/pypi/motor .. _pip: http://pip-installer.org + +.. _PyMongo: http://pypi.python.org/pypi/pymongo/ diff --git a/setup.py b/setup.py index 5e1a604b..d6e6c3b0 100644 --- a/setup.py +++ b/setup.py @@ -36,7 +36,15 @@ pymongo_ver = ">=3.12,<5" install_requires = ["pymongo" + pymongo_ver] -extras_require = {"encryption": ["pymongo[encryption]" + pymongo_ver]} +extras_require = { + "encryption": ["pymongo[encryption]" + pymongo_ver], + "ocsp": ["pymongo[ocsp]" + pymongo_ver], + "snappy": ["pymongo[snappy]" + pymongo_ver], + "zstd": ["pymongo[zstd]" + pymongo_ver], + "aws": ["pymongo[aws]" + pymongo_ver], + "srv": ["pymongo[srv]" + pymongo_ver], + "gssapi": ["pymongo[gssapi]" + pymongo_ver], +} tests_require = ["mockupdb>=1.4.0"]