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

Use stdlib to ascertain runtime implementation in setup.py

    • Type: Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Internal, Packaging
    • None

      We currently use the a mix of several techniques to determine the Python implementation we are running on in the project's setup.py. Here is the relevant code:

      if "--no_ext" in sys.argv:
          sys.argv.remove("--no_ext")
      elif (sys.platform.startswith("java") or
            sys.platform == "cli" or
            "PyPy" in sys.version):
          sys.stdout.write("""
      *****************************************************\n
      The optional C extensions are currently not supported\n
      by this python implementation.\n
      *****************************************************\n
      """)
      else:
          extra_opts['ext_modules'] = ext_modules
      

      Instead, we can simply use platform.python_implementation() for a much cleaner solution. The method is in the standard library since v2.6 so we can use it for all future pymongo releases.

            Assignee:
            Unassigned Unassigned
            Reporter:
            prashant.mital Prashant Mital (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: