Skip to content

Support free-threaded Python builds #215

Closed

Description

@beer-psi

Free-threading is no longer experimental as of Python 3.14, so I was wondering if it's possible for the library to support free-threaded builds.

Activity

  1. rushter commented on Mar 18, 2026

    @rushter
    Owner
  2. beer-psi commented on Mar 18, 2026

    @beer-psi
    Author

    They're free-threaded wheels, but they still enable GIL when imported. You need to also mark the module as freethreading-compatible.

    $ uv run --with=selectolax -p 3.14t python
    Installed 1 package in 7ms
    Python 3.14.2 free-threading build (main, Dec  9 2025, 19:03:17) [Clang 21.1.4 ] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import selectolax
    <frozen importlib._bootstrap>:491: RuntimeWarning: The global interpreter lock (GIL) has been enabled to load
    module 'selectolax.lexbor', which has not declared that it can run safely without the GIL. To override this
    behavior and keep the GIL disabled (at your own risk), run with PYTHON_GIL=0 or -Xgil=0.
    
  3. rushter commented on Mar 18, 2026

    @rushter
    Owner

    I've enabled it for the dev build, but I'm not sure if it will work correctly.

  4. rushter commented on Sep 29, 2026

    @rushter
    Owner

    There is now a dedicated test 5de648b

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions