Skip to content

BLD: Support free-threaded CPython and ship 3.14t/3.15/3.15t wheels - #112

Merged
RUrlus merged 2 commits into
RUrlus:stablefrom
mbUSC:free-threading-315t
Oct 11, 2026
Merged

RUrlus merged 2 commits into
RUrlus:stablefrom
mbUSC:free-threading-315t

Conversation

@mbUSC

@mbUSC mbUSC commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor
  • Declare the extension safe to run without the GIL with py::mod_gil_not_used (requires pybind11>=2.13)
  • Replace psutil, which has no cp315t wheels, with os.process_cpu_count (3.13+) / os.cpu_count; n_threads=-1 now uses the logical cores available to the process
  • Build cp314t, cp315 and cp315t wheels; drop cp38 wheels as cibuildwheel 4 no longer supports it (the sdist still supports 3.8)
  • Bump cibuildwheel from 3.4.1 to 4.3.1 for stable CPython 3.15 support
  • Add 3.14, 3.14t, 3.15 and 3.15t to the Linux and macOS test matrices
  • Fix sdist include path (src/diptest_core -> src/diptest-core)

- Declare the extension safe to run without the GIL with
  py::mod_gil_not_used (requires pybind11>=2.13)
- Replace psutil, which has no cp315t wheels, with
  os.process_cpu_count (3.13+) / os.cpu_count; n_threads=-1 now uses
  the logical cores available to the process
- Build cp314t, cp315 and cp315t wheels; drop cp38 wheels as
  cibuildwheel 4 no longer supports it (the sdist still supports 3.8)
- Bump cibuildwheel from 3.4.1 to 4.3.1 for stable CPython 3.15 support
- Add 3.14, 3.14t, 3.15 and 3.15t to the Linux and macOS test matrices
- Fix sdist include path (src/diptest_core -> src/diptest-core)
@mbUSC

mbUSC commented Oct 11, 2026

Copy link
Copy Markdown
Contributor Author

Hi @RUrlus 👋
I made this PR to ship the missing wheels for new Python versions, including free-threaded wheels.
Free-threaded execution is trivially safe here since the extension is made of pure functions with no shared mutable state (every call allocates its own buffers and RNG), and the Python layer only holds constants set at import. The tests pass on free-threaded Python 3.15.0 with the GIL confirmed off, and a 16-thread stress test matches the single-threaded results.

Please lmk if anything needs to be changed or if it can be merged -- thanks!

@mbUSC mbUSC changed the title BLD: Support free-threaded CPython and ship 3.15/3.15t wheels BLD: Support free-threaded CPython and ship 3.14/3.15/3.15t wheels Oct 11, 2026
@mbUSC mbUSC changed the title BLD: Support free-threaded CPython and ship 3.14/3.15/3.15t wheels BLD: Support free-threaded CPython and ship 3.14t/3.15/3.15t wheels Oct 11, 2026
@RUrlus

RUrlus commented Oct 11, 2026

Copy link
Copy Markdown
Owner

Hi @mbUSC,

Appreciate the PR and looks good. The PyBind11 bump is exposing a Valgrind build issue, I think this commit should take care of it. If so, I'll merge the PR tomorrow

@RUrlus
RUrlus enabled auto-merge (squash) October 11, 2026 20:06
@RUrlus

RUrlus commented Oct 11, 2026

Copy link
Copy Markdown
Owner

It does, so I'll merge it in and create a release this week.
Thanks again

@RUrlus
RUrlus merged commit 21d60af into RUrlus:stable Oct 11, 2026
45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants