Python 3.14 free-threaded (cp314t) support; release 0.3.0#69
Conversation
Coverage Report for CI Build 27418729863Warning No base build found for commit Coverage: 94.387%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsRequires a base build to compare against. How to fix this → Coverage Stats
💛 - Coveralls |
8837e9e to
de0abe0
Compare
Regenerate the four Cython extensions (varint, largeint, bufferedreader, bufferedwriter) with Cython 3.2.4 and declare freethreading_compatible in each .pyx, so the GIL stays disabled when the driver is imported on the free-threaded 3.14t interpreter. Build with CYTHON_COMPRESS_STRINGS=0 to keep the extensions importable when stdlib compression modules (zlib/bz2) are unavailable. setup.py refuses to regenerate with Cython < 3.1, which silently ignores the directive and would ship GIL-re-enabling extensions. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
New coverage: a block-import smoke script that asserts every extension imports without stdlib compression modules and that the GIL stays disabled on 3.14t, a threaded stress test hammering the compiled extensions from 8 concurrent threads, and a parallel-clients integration test (concurrent queries and inserts). Suite fixes for drift accumulated since the tests were written: tolerate prerelease server versions (3.3.1-rc.13), drop the shared test stream defensively in tearDown, version-gate tests for behaviors that changed in server 3.x (native JSON type, use_client_time_zone) via a new skip_on_server_version_from helper, pin pandas<3 for the numpy lanes, and skip mock-internals connect tests on pypy where cpyext cannot see MagicMock attributes from Cython 3.2 code. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
f0ec819 to
3fc56a9
Compare
Review-response notes: Cython version guardAn external review flagged that rebuilding the extensions from The hazard is real. Cython 3.0.12 compiles our directive-bearing Exposure is narrow. Standard Fix: Verified both directions: rejects 3.0.12, builds normally with 3.2.4, and the no-Cython wheel path is untouched. Two related accuracy fixes from the same review pass: the README caveat now correctly scopes the 🤖 Generated with Claude Code |
28661db to
11a655c
Compare
The test workflow had not truly run since the ubuntu-20.04 runner retirement. Move to ubuntu-22.04, replace setup.py develop with pip-managed installs (easy_install ignored Requires-Python), unpin coveralls, add a 3.14t smoke job (build + block-import + GIL-off threaded stress), and add 3.13/3.14 to the matrix. Server bring-up fixes: pin the FT-enabled timeplusd image, drop the root-owned bind mount the non-root container cannot write to, probe readiness through the right host with diagnostics on timeout, and cap nativelog segment preallocation via a config.d drop-in (the default preallocates 2GB per stream and filled the runner disk). The release workflow gains cp314/cp314t wheel builds via cibuildwheel and publishes an sdist again — no release since 0.2.10 shipped one, so interpreters without a prebuilt wheel (e.g. EOL PyPy) had no installable artifact. The GitHub release is created with the built-in token (the GH_ACCESS_TOKEN PAT no longer exists), and wheels are stored as artifacts before that step so a release failure cannot strand the PyPI publish. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Bump version to 0.3.0 with a changelog entry. README documents the free-threading story: the driver itself keeps the GIL disabled on 3.14t; the optional compression extras do not yet (lz4 4.4.5+ is FT-ready, clickhouse-cityhash lacks cp314t wheels and is replaced by the timeplus-io fork in a follow-up, zstd lacks the FT declaration upstream). cibuildwheel config: keep building the PyPy wheels modern toolchains support (pp311; pp38-pp310 are EOL and fall back to the sdist) and smoke-test every built wheel with the block-import script. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
11a655c to
0423cae
Compare
Summary
freethreading_compatible = True; the GIL stays disabled on 3.14t (C sources regenerated with Cython 3.2.4)sys._is_gil_enabled()is False on free-threaded builds (runs on every built wheel via the cibuildwheel test-command)proton-driverpackage name; cp314t wheels ship alongside cp314 (community convention — pip picks the right wheel per interpreter). Verified cibuildwheel 3.4.1 emits all cp314/cp314t manylinux+musllinux identifiers for x86_64 and aarch64.3.3.1-rc.13); parallel-inserts count uses plain SELECT sincetable()is not applicable to Memory-engine streams on newer serversFree-threading audit
No module-level mutable state (largeint's MAX_UINT64/MAX_INT64 are immutable ints assigned once at init), no static C buffers (varint uses per-call stack arrays; reader/writer buffers are per-instance PyMem allocations), no cross-call borrowed-reference caching. Per-object thread-safety follows the standard "callers don't share one object across threads unsynchronized" contract.
Test plan
sys._is_gil_enabled()stays False--print-build-identifiersincludes cp314t-*🤖 Generated with Claude Code