-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
SQLAlchemy 1.4: Fix building the C extension on Python 3.13 #11500
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
It looks like this requires a backport of (at least part of) 7548046. |
oh, well yah it looks like i wasnt targeting 1.4 for 3.13 at all, so yes based on what i said above we have to backport all of that to 1.4 as well |
I’m not prepared to backport all the tox fixes, but in case it helps, I backported just the code fixes in musicinmybrain@5e7446a, and I can confirm that this sufficed to get all the tests passing on Python 3.13 in the Fedora package. |
OK for the backport of that other stuff, me or @CaselIT should make separate gerrits for that on our end, move the changelog, and do it like that |
this is ongoing at https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/5342 , also adding greenlet test for py313 in https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/5343 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, this is sqla-tester setting up my work on behalf of zzzeek to try to get revision 8a5888b of this pull request into gerrit so we can run tests and reviews and stuff
New Gerrit review created for change 8a5888b: https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/5339 |
Michael Bayer (zzzeek) wrote: recheck limited py313 builds to sqlite only View this in Gerrit at https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/5339 |
Gerrit review https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/5339 has been merged. Congratulations! :) |
this can be closed, since it was merged |
Description
The C extension for SQLAlchemy 1.4 uses
_PyArg_NoKeywords()
, an undocumented private API that was moved to thepycore_modsupport.h
internal C API in Python 3.13.As a result, the C extension fails to build on Python 3.13:
This was reported as #11499.
This PR proposes to fix that by adding a
static
function wrapper that calls_PyArg_NoKeywords
on Python 3.12 and older, and imitates its implementation on Python 3.13 and later.Checklist
This pull request is:
must include a complete example of the issue. one line code fixes without an
issue and demonstration will not be accepted.
Fixes: #<issue number>
in the commit messageinclude a complete example of how the feature would look.
Fixes: #<issue number>
in the commit messageHave a nice day!
Compilation can be easily tested in a virtualenv:
Actually running the test suite is a bit harder, since the version of
greenlet
on PyPI still doesn’t build on Python 3.13.I tested this as a patch for the
python-sqlalchemy1.4
compat package in Fedora Rawhide and found that the C extension compiled and almost all of the tests passed. There were a few failures I haven’t investigated closely yet,with tracebacks like
but these also failed when the C extension was not built, so they must represent a separate issue unrelated to this PR.