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

Add support for free-threaded Python (no GIL)

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 4.11
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • Python Drivers
    • Needed
    • Hide

      1. What would you like to communicate to the user about this feature? PyMongo 4.11+ now supports free-threaded CPython, eg running with python3.13t.

      Show
      1. What would you like to communicate to the user about this feature? PyMongo 4.11+ now supports free-threaded CPython, eg running with python3.13t.

      Context

      Python 3.13 includes provisional support for free-threading.
      Once there is a version that supports free-threading in datetime, we should add it to our toolchain and update our C extensions for compatibility.

      We can look to https://github.com/Quansight-Labs/free-threaded-compatibility for guidance.

      https://github.com/python/cpython/issues/117398 tracks datetime support, and
      https://github.com/Quansight-Labs/free-threaded-compatibility/issues/7 tracks most of our ecosystem dependencies.

      This was inspired by Anthony Shaw's PyCon talk.

      Definition of done

      Add testing and Python 3.13 wheels with free-threading support.

      Pitfalls

      This is an emerging capability and there will be some rough edges and exploration.

            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: