chore(deps): raise the sqlalchemy floor on 3.14; drop the GIL workaround - #189
Merged
Merged
Conversation
SQLAlchemy 2.0.54 declares `Py_MOD_GIL_NOT_USED` on its cyextensions, so importing it no longer re-enables the GIL process-wide on a free-threaded interpreter. `DISABLE_SQLALCHEMY_CEXT_RUNTIME=1` was buying a slower pure-Python fallback for nothing. The floor moves to 2.0.54 on 3.14+ so the docs can state the guarantee without a conditional. There is no marker for a free-threaded build, so ordinary 3.14 carries a floor it does not need; 3.13 and below are split off and unaffected. Closes #160
Benchmark gate✅ gate passed
Gated (fails the build): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #160.
Why now
#160 waits on SQLAlchemy's cyextensions declaring
Py_MOD_GIL_NOT_USED. They doas of 2.0.54. Measured on CPython 3.14.7t with the compiled extensions
genuinely loaded (
has_compiled_ext() == True,collections.cpython-314t-*.so),no env var set:
So
DISABLE_SQLALCHEMY_CEXT_RUNTIME=1now buys a slower pure-Python fallback andnothing else.
What
sqlalchemy[asyncio]>=2.0.54; python_version >= '3.14'. The existingmarked floor is split so
==3.13keeps 2.0.31 and below 3.13 keeps 2.0.env:block goes from thefreethreadedjob. The job alreadyasserts
sys._is_gil_enabled()is false, so the floor is now self-gating:a regression turns that step red instead of being masked by the workaround.
introduction/installation.mdkept its second half,which is still true (a foreign-broker client like
aiokafkastill re-enablesthe GIL), and lost the SQLAlchemy instruction.
standing, since
docs/agents/domain.mdtells agents to read ADRs as currenttruth about the area they are working in. The decision itself is unchanged;
only its bounding constraint moved.
The cost, stated plainly
There is no environment marker for a free-threaded build, so
python_version >= '3.14'is the narrowest expressible constraint and ordinary 3.14 users inherit a2.0.54 floor for a reason that only affects 3.14t. That is the trade for the docs
being able to state the guarantee without a conditional the reader has to
evaluate. Option 2 in the alternative was to keep the floor and rewrite the note
as "only needed below 2.0.54"; this is option 1.
Verified
freethreadedjob's exact assertion on 3.14t with no env var: passes,GIL disabled with sqlalchemy 2.0.54 | compiled ext: True.517 passed, 107 skipped.lowestleg added in ci: resolve the declared dependency floors on every PR #188 resolves the new floor and passes:3.13 to sqlalchemy 2.0.31, 3.14 to 2.0.54, both
517 passed, 107 skipped.(The 107 are the Postgres tests, which skip locally and run in CI.)
just lint-ciandjust docs-buildclean.