Skip to content

Conversation

@ngoldbaum
Copy link
Contributor

@ngoldbaum ngoldbaum commented Nov 26, 2025

  • Avoids setting py_limited_api on the free-threaded build. This tells CFFI to build version-specific wheels instead of abi3 wheels.
  • Updates the test jobs to add 3.14t tests.
  • Updates the test jobs to only run tests for one python version by explicitly specifying a tox environment. Currently they run tests for several versions using interpreters that happen to be installed on the image.
  • Adds a lock to the Compressor and Decompressor class and ensures that all operations that non-atomically read or mutate state on either class happen while the lock is held. Rather than introduce possible scaling bottlenecks, I've set up the threading.Lock to always call acquire(blocking=False), and if the lock is already held by another thread, immediately raise an error. This enforces that it's not safe to share Compressor or Decompressor instances while compression or decompression operations are happening. This follows the approach in Add py free-threaded support + concurrent access test google/brotli#1386.
  • Adds tests based on Add py free-threaded support + concurrent access test google/brotli#1386. The timing is slightly different than what's in that PR - ping @eustas - you may want to look at this.
  • Updates wheel-building infrastructure to build cp314t wheels.

Open questions:

  • Should I add a thread safety section to the documentation? Where?
  • Should I add a pytest-run-parallel testing job to ensure there's no global state in the implementation of the pure functions in the API?

@ngoldbaum
Copy link
Contributor Author

Argh: the test timing is flaky. There's probably a better way to synchronize things but I'm running out of steam. Suggestions to improve the tests are very welcome :)

@ngoldbaum
Copy link
Contributor Author

It also occurred to me while working on this that the ubuntu wheel builds probably benefit from the new aarch64 CI runners on github actions. That would allow skipping the slow QEMU-emulated builds on ubuntu-latest.

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