Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Python 3.13 free-threaded build #4438

Open
ngoldbaum opened this issue Aug 20, 2024 · 3 comments
Open

Support Python 3.13 free-threaded build #4438

ngoldbaum opened this issue Aug 20, 2024 · 3 comments
Labels
T: enhancement New feature or request

Comments

@ngoldbaum
Copy link
Contributor

Is your feature request related to a problem? Please describe.

It looks like everything is mostly working on the free-threaded build, except for three failing tests:

=========================== short test summary info ============================
FAILED tests/test_blackd.py::BlackDTestCase::test_normalizes_line_endings - AssertionError: '[Errno 24] Too many open files' != 'c\r\nc\r\n'
FAILED tests/test_blackd.py::BlackDTestCase::test_preserves_line_endings - OSError: [Errno 24] Too many open files
FAILED tests/test_blackd.py::BlackDTestCase::test_single_character - OSError: [Errno 24] Too many open files
================== 3 failed, 372 passed, 3 skipped in 32.93s ===================

This is with a version of black I built using the free-threaded build of Python3.13.0rc1. I ran the tests with PYTHON_GIL=0 to force the GIL to be disabled. I also built aiohttp with an updated version of cython (see aio-libs/aiohttp#8796).

You should be able to follow https://py-free-threading.github.io/porting/ to declare that C extensions support running without the GIL, assuming there are no known or suspected thread safety issues.

Describe the solution you'd like

Supporting free-threaded Python without any special hacking.

@JelleZijlstra
Copy link
Collaborator

Our C extension is built with mypyc, so I'd prefer a solution inside mypyc rather than something special we do ourselves.

Until mypyc supports free-threading, users using free-threading should be able to use our pure-Python wheel; I don't think mypyc even supports 3.13 with the GIL yet.

@JelleZijlstra
Copy link
Collaborator

Also, the tests you flag depend on aiohttp; I wonder if the failures are because aiohttp doesn't support free-threading yet.

@ngoldbaum
Copy link
Contributor Author

I see 3.13 support is being tracked over at mypyc/mypyc#1056.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants