Skip to content

Disable global interpreter lock for freethreading#737

Merged
bwoodsend merged 1 commit into
ultrajson:mainfrom
bwoodsend:no-gil
May 27, 2026
Merged

Disable global interpreter lock for freethreading#737
bwoodsend merged 1 commit into
ultrajson:mainfrom
bwoodsend:no-gil

Conversation

@bwoodsend

Copy link
Copy Markdown
Collaborator

Per #708 (comment). Closes #684.

The test is probably pointless but it makes me feel better... 🙂

@bwoodsend bwoodsend added the changelog: Added For new features label May 24, 2026
@bwoodsend

Copy link
Copy Markdown
Collaborator Author

CC @ngoldbaum (GitHub won't let me add you as a reviewer)

@codecov

codecov Bot commented May 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 71.42857% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.52%. Comparing base (454c0f6) to head (a6a3b9f).

Files with missing lines Patch % Lines
tests/test_ujson.py 71.42% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #737      +/-   ##
==========================================
- Coverage   92.58%   92.52%   -0.07%     
==========================================
  Files           7        7              
  Lines        2199     2206       +7     
==========================================
+ Hits         2036     2041       +5     
- Misses        163      165       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ngoldbaum

Copy link
Copy Markdown

The test is probably pointless but it makes me feel better... 🙂

I think it's worth adding. Here's the check I added in NumPy for the same thing, to also catch any test dependencies enabling the GIL:

https://github.com/numpy/numpy/blob/0e18dd26e138a6caf59393fc4b7c08aa560efba4/numpy/conftest.py#L103-L115

@ngoldbaum ngoldbaum left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much! Tested locally and I no longer see the GIL getting enabled.

@bwoodsend

Copy link
Copy Markdown
Collaborator Author

Great, thanks for the confirmation.

@bwoodsend bwoodsend merged commit 29c23cf into ultrajson:main May 27, 2026
27 of 30 checks passed
@bwoodsend bwoodsend deleted the no-gil branch May 27, 2026 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog: Added For new features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support the free-threaded build of Python

2 participants