GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add support for free-threaded (nogil) 3.13 Python · Issue #642 · MagicStack/uvloop

Add support for free-threaded (nogil) 3.13 Python #642

New issue
Copy link
New issue
Copy link
Closed
Closed
Add support for free-threaded (nogil) 3.13 Python#642
Copy link

Description

@gi0baro
gi0baro
opened on Nov 7, 2024
Issue body actions

SSIA

This also definitely depends on future Cython 3.1.0 release

Reacted by Salih Günay, synodriver, Weihao Cui, Kavin and Dan Diephouse

Activity

  1. ngoldbaum commented on May 19, 2025

    @ngoldbaum
    ngoldbaum
    on May 19, 2025
    More actions

    Cython 3.1.0 is out so someone should try to build it and run the tests.

    See https://py-free-threading.github.io for more info. I'm also happy to help out.

  2. WebShark025 commented on Jun 11, 2025

    @WebShark025
    WebShark025
    on Jun 11, 2025
    More actions

    Builds fail:

      uvloop/loop.c:4537:80: error: unknown type name ‘__pyx_vectorcallfunc’; did you mean ‘vectorcallfunc’?
       4537 | static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw);
            |                                                                                ^~~~~~~~~~~~~~~~~~~~
            |                                                                                vectorcallfunc
    

    Full error is here as well:
    https://ft-checker.com/?search=uvloop

    It would be amazing to have free threaded python supported by uvloop, its one of the few remaining packages that is yet to support free threading :)

  3. ngoldbaum commented on Jul 17, 2025

    @ngoldbaum
    ngoldbaum
    on Jul 17, 2025
    More actions

    Not sure why ft-checker was seeing an error back in June, but it looks like with the latest version of Cython, uvloop builds successfully:

    goldbaum at Nathans-MBP in ~/Documents/uvloop on master
    ± python -m pip install -e .
    Obtaining file:///Users/goldbaum/Documents/uvloop
      Installing build dependencies ... done
      Checking if build backend supports build_editable ... done
      Getting requirements to build editable ... done
      Preparing editable metadata (pyproject.toml) ... done
    Building wheels for collected packages: uvloop
      Building editable for uvloop (pyproject.toml) ... done
      Created wheel for uvloop: filename=uvloop-0.21.0-0.editable-cp313-cp313t-macosx_15_0_arm64.whl size=9603 sha256=5ce81ea00fdfa677b1aea648fa00265cdea23a0bb7aaaea89679a3fbc4964a4f
      Stored in directory: /private/var/folders/nk/yds4mlh97kg9qdq745g715rw0000gn/T/pip-ephem-wheel-cache-3cc8t1nw/wheels/82/ff/6a/4d53e60cdf47a728d2d4c0e034ecb7018204cbcedf4763990e
    Successfully built uvloop
    Installing collected packages: uvloop
    Successfully installed uvloop-0.21.0
    
    goldbaum at Nathans-MBP in ~/Documents/uvloop on master
    ± python -VV
    Python 3.13.5 experimental free-threading build (main, Jul 13 2025, 10:48:09) [Clang 17.0.0 (clang-1700.0.13.5)]
    

    uvloop has a test dependency on PyOpenSSL, which in turn depends on cryptography, which in turn depends on CFFI, which doesn't yet ship a version supporting the free-threaded build. With a hacked-together environment based on my CFFI PR adding free-threaded support, all but one of the tests pass, and the failure looks unrelated to free-threading:

    ========================================= short test summary info ==========================================
    FAILED tests/test_aiohttp.py::Test_UV_AioHTTP::test_aiohttp_graceful_shutdown - TypeError: TCPSite.__init__() got an unexpected keyword argument 'shutdown_timeout'
    ===================== 1 failed, 473 passed, 34 skipped, 1 warning in 77.59s (0:01:17) ======================
    

    If I force each test to run many times in a thread pool using pytest-run-parallel, I see no additional failures. That's a great sign that the wrappers and libuv itself don't implicitly rely on global state, at least to the extent the test coverage is good. pytest-run-parallel is only good for checking for global state in the implementation, it can't detect thread safety issues due to mutable objects, I don't know offhand if uvloop needs to worry about that. I do see there are explicitly multithreaded tests, which is also good.

    We can probably come back to this once cryptography and PyOpenSSL support the free-threaded build.

  4. dandiep commented on Aug 13, 2025

    @dandiep
    dandiep
    on Aug 13, 2025
    More actions

    I still get the same build error as highlighted in ft-checker with:

    Python 3.13.5 experimental free-threading build | packaged by conda-forge | (main, Jun 16 2025, 08:23:46) [Clang 18.1.8 ]

  5. ngoldbaum commented on Aug 13, 2025

    @ngoldbaum
    ngoldbaum
    on Aug 13, 2025
    More actions

    You'll need to build uvloop from a checkout of the repository. The uvloop 0.21.0 source release on PyPI bundles cython code that was generated with a release of Cython that does not support the free-threaded build.

  6. dandiep commented on Aug 13, 2025

    @dandiep
    dandiep
    on Aug 13, 2025
    More actions

    Can confirm, that works. Thanks!

  7. fantix
    added a commit that references this issue on Oct 15, 2025

    uvloop 0.22.0

    c660c77
  8. fantix commented on Oct 15, 2025

    @fantix
    fantix
    on Oct 15, 2025
    Member
    More actions

    Fixed in #693

  9. fantix
    closed this as completedon Oct 15, 2025
  10. fantix
    added 3 commits that reference this issue on Oct 15, 2025

    uvloop 0.22.0

    4106f7f

    uvloop 0.22.0

    5229115

    uvloop 0.22.0

    3cf6b44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.