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

Cryptography 40+ Requires PyPy3 7.3.10+

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • pymongocrypt-1.5.2
    • Affects Version/s: None
    • Component/s: None
    • None

      Our PyPy 3.7 builds that use encryption are failing:

      https://spruce.mongodb.com/task/motor_main__ssl~nossl_tox_env~tornado5_pypy37_os~ubuntu_18_test_4.2_replica_set_f9aed97221947bdb1bf7b6af46fb4fa8385bc6bb_23_04_06_20_27_06/tests?execution=0&sortBy=STATUS&sortDir=ASC

       [2023/04/06 20:41:32.893] Error in cpyext, CPython compatibility layer:
       [2023/04/06 20:41:32.893] PyThreadState_Swap() cannot be used to switch to another
       [2023/04/06 20:41:32.893] different PyThreadState right now
       [2023/04/06 20:41:32.893] RPython traceback:
       [2023/04/06 20:41:32.893]   File "pypy_module_cpyext_2.c", line 26465, in unwrapper__StdObjSpaceConst_PyThreadStatePtr_sta
       [2023/04/06 20:41:32.893]   File "pypy_module_cpyext_1.c", line 65525, in PyThreadState_Swap
       [2023/04/06 20:41:32.893] Fatal RPython error: AssertionError
      

      Cryptography specifies that they require PyPy3 7.3.10+, but it cannot be expressed using

      {python_requires}

      , so pip can't resolve it for us.

      The solution is to modify the pymongocrypt dependencies to include:

      ["cryptography>2", "cryptography<40;platform_python_implementation=='PyPy' and implementation_version<'7.3.10'"]
      

            Assignee:
            shane.harvey@mongodb.com Shane Harvey
            Reporter:
            steve.silvester@mongodb.com Steve Silvester
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: