Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-1093

Use setuptools extras_require to install optional dependencies

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Trivial - P5 Trivial - P5
    • 3.3
    • 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.

            Assignee:
            bernie@mongodb.com Bernie Hackett
            Reporter:
            bernie@mongodb.com Bernie Hackett
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: