-
Type: Improvement
-
Resolution: Done
-
Priority: Trivial - P5
-
Affects Version/s: None
-
Component/s: None
-
None
PyMongo has a few optional dependencies for certain situations:
- GSSAPI auth requires pykerberos on *nix or (soon) winkerberos on Windows.
- TLS is far simpler to use with old python versions (<= 2.7.9) if certifi or wincertstore is installed.
Use extras_require to optionally depend on the right packages on the right platforms.
https://pythonhosted.org/setuptools/setuptools.html#declaring-extras-optional-features-with-their-own-dependencies
https://pip.pypa.io/en/latest/reference/pip_install/#examples
After these changes you should be able to do the following:
python -m pip install pymongo[gssapi]
python -m pip install pymongo[tls]
python -m pip install pymongo[gssapi, tls]
If the python version is new enough to not need certifi or wincertstore pymongo[tls] shouldn't install either of them.