Skip to content

build: enable free-threaded wheels in cibuildwheel#121

Merged
art049 merged 6 commits into
masterfrom
fix/freethreaded-wheels
May 13, 2026
Merged

build: enable free-threaded wheels in cibuildwheel#121
art049 merged 6 commits into
masterfrom
fix/freethreaded-wheels

Conversation

@art049
Copy link
Copy Markdown
Member

@art049 art049 commented May 13, 2026

Opt cibuildwheel into building free-threaded CPython wheels so the
dist_instrument_hooks native extension actually ships for 3.13t / 3.14t /
3.15t.

cibuildwheel does not build free-threaded wheels by default, even when the
build pattern matches cp*. Without the opt-in, users on free-threaded
interpreters fell back to a pure-Python install with no compiled extension and
saw at runtime:

Failed to initialize instrument hooks: Failed to load instrument hooks
library: cannot import name 'dist_instrument_hooks' from
'pytest_codspeed.instruments.hooks'

Pairs with #120 (which declares the extension free-thread safe so the GIL stays
disabled on import).

art049 and others added 4 commits May 12, 2026 20:10
cibuildwheel does not build free-threaded CPython wheels by default, even
when the build pattern matches cp*. As a result, users on 3.13t/3.14t/3.15t
installed pure-Python wheels with no native extension and saw:

    Failed to load instrument hooks library: cannot import name
    'dist_instrument_hooks' from 'pytest_codspeed.instruments.hooks'

Opt in via `enable = ["cpython-freethreading"]` so the cp31{3,4,5}t wheels
ship the compiled dist_instrument_hooks extension.

Co-Authored-By: Claude <noreply@anthropic.com>
v3.2.1 predates CPython 3.14/3.15 support in cibuildwheel. Bumping unlocks
free-threaded 3.14t/3.15t wheel builds (which no longer need the
cpython-freethreading enable flag — only 3.13t does).

Co-Authored-By: Claude <noreply@anthropic.com>
CPython 3.15 is still in beta, so cibuildwheel will not build cp315 /
cp315t wheels without the cpython-prerelease opt-in. Add it alongside
cpython-freethreading so prerelease wheels (regular + free-threaded)
ship for users testing on 3.15.

Co-Authored-By: Claude <noreply@anthropic.com>
Add the trove classifier for 3.15 now that cibuildwheel ships cp315 /
cp315t wheels.

Co-Authored-By: Claude <noreply@anthropic.com>
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented May 13, 2026

Merging this PR will not alter performance

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 30 improved benchmarks
❌ 13 regressed benchmarks
✅ 234 untouched benchmarks

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
WallTime test_open_close_fd[10] 99.2 µs 93.2 µs +6.45%
WallTime test_fs_write[100] 14.3 µs 13.8 µs +3.73%
WallTime test_sum_of_squares[sum_of_squares_sum_labmda_product] 295.6 µs 281.2 µs +5.12%
WallTime test_make_bandpass 5.7 µs 5.5 µs +2.21%
WallTime test_make_highshelf 8 µs 7.8 µs +2.6%
WallTime test_generate_all_permutations[sequence1] 162.6 µs 167.1 µs -2.65%
WallTime test_generate_all_subsequences[sequence1] 95.5 µs 98.7 µs -3.2%
WallTime test_minimax[scores0] 7.7 µs 8 µs -3.05%
WallTime test_mmap_operation[40960] 49.9 µs 48.6 µs +2.64%
WallTime test_multiprocessing_map[100] 56.9 ms 55.8 ms +2.07%
WallTime test_noop_pass 498.2 ns 538 ns -7.39%
WallTime test_array_alloc[100] 1.1 µs 1.2 µs -3.57%
WallTime test_generate_all_combinations[5-4] 11.1 µs 10.4 µs +7.02%
WallTime test_sudoku[initial_grid0] 8.3 µs 8.1 µs +3.52%
WallTime test_make_lowpass 5.8 µs 5.3 µs +9.17%
WallTime test_iir_filter_process 3.2 µs 3.1 µs +4.04%
WallTime test_make_peak 7.1 µs 6.4 µs +9.93%
WallTime test_open_close_fd[1000] 9.4 ms 9 ms +4.21%
WallTime test_fs_write[10000] 42.5 µs 44.2 µs -3.95%
WallTime test_hostname_resolution[localhost] 125.5 µs 122.2 µs +2.74%
... ... ... ... ... ...

ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing fix/freethreaded-wheels (8b581dd) with master (080d620)

Open in CodSpeed

art049 and others added 2 commits May 12, 2026 20:20
v3.4.1 does not yet include cp315 in its bundled build-platforms.toml, so
the cpython-prerelease enable flag has nothing to act on. Pin to commit
ec0977e (post-#2833 "add CPython 3.15 beta 1") to unblock cp315 / cp315t
wheel builds. Drop the pin back to a tagged release once cibuildwheel
ships 3.15 metadata.

Co-Authored-By: Claude <noreply@anthropic.com>
The cibuildwheel commit we pin (post-#2684) no longer recognizes
cpython-freethreading: 3.13t support was dropped and free-threading is the
default for 3.14+. Keeping the value triggers:

    cibuildwheel: Failed to parse enable group. Unknown enable group:
    cpython-freethreading.

Only cpython-prerelease is still needed (for cp315 / cp315t while 3.15 is
in beta).

Co-Authored-By: Claude <noreply@anthropic.com>
@art049 art049 merged commit ad709a5 into master May 13, 2026
21 checks passed
@art049 art049 deleted the fix/freethreaded-wheels branch May 13, 2026 03:23
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.

1 participant