Use stdlib to ascertain runtime implementation in setup.py

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Won't Fix
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Internal, Packaging
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • 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
            Reporter:
            Prashant Mital (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: