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

Use setuptools extras_require to install optional dependencies

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Trivial - P5
    • Resolution: Fixed
    • None
    • 3.3
    • None
    • None

    Description

      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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: