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

Document minimum version of pip required to install from source dist

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 4.8
    • Affects Version/s: None
    • Component/s: None
    • None
    • Python Drivers
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

      Context

      After the changes in PYTHON-4451 and PYTHON-4489, it is no longer possible to install pymongo from source (or sdist) with old versions of pip, for example:

       [2024/06/14 13:42:33.753] + python -m pip install -e .
       [2024/06/14 13:42:38.601]     ERROR: Command errored out with exit status 1:
       [2024/06/14 13:42:38.601]      command: /data/mci/81cd2316d38fbbd146938bff32a636d1/src/.venv/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/data/mci/81cd2316d38fbbd146938bff32a636d1/src/setup.py'"'"'; __file__='"'"'/data/mci/81cd2316d38fbbd146938bff32a636d1/src/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps
       [2024/06/14 13:42:38.601]          cwd: /data/mci/81cd2316d38fbbd146938bff32a636d1/src/
       [2024/06/14 13:42:38.601]     Complete output (5 lines):
       [2024/06/14 13:42:38.601]     Traceback (most recent call last):
       [2024/06/14 13:42:38.601]       File "<string>", line 1, in <module>
       [2024/06/14 13:42:38.601]       File "/data/mci/81cd2316d38fbbd146938bff32a636d1/src/setup.py", line 5, in <module>
       [2024/06/14 13:42:38.601]         raise RuntimeError(msg)
       [2024/06/14 13:42:38.601]     RuntimeError: PyMongo>=4.8 no longer supports building via setup.py, use python -m pip install <path/to/pymongo> instead
       [2024/06/14 13:42:38.601]     ----------------------------------------
       [2024/06/14 13:42:38.601] ERROR: Command errored out with exit status 1: /data/mci/81cd2316d38fbbd146938bff32a636d1/src/.venv/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/data/mci/81cd2316d38fbbd146938bff32a636d1/src/setup.py'"'"'; __file__='"'"'/data/mci/81cd2316d38fbbd146938bff32a636d1/src/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps Check the logs for full command output.
       [2024/06/14 13:42:38.607] WARNING: You are using pip version 21.1.1; however, version 24.0 is available.
      

      Definition of done

      We need to document the minimum version of pip required to install from sdist and update the error message above to mention updating pip to >= that version.

            Assignee:
            shane.harvey@mongodb.com Shane Harvey
            Reporter:
            shane.harvey@mongodb.com Shane Harvey
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: