-
-
Notifications
You must be signed in to change notification settings - Fork 86
Support Python 3.13 #736
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
Support Python 3.13 #736
Conversation
Thanks for the PR @eoyoa Just a cursory glance so far, I'll look more carefully in the next couple days. This is nice as 3.13 has been on my list for a while, but never gets far enough up the stack. And... you very wisely left the web2py server alone. Good job. |
Just as a heads up for your review @bnmnetp, I'm not sure how the However, one suitable alternative for the
If the |
I'm on 3.11 so I'll see what happens. I notice that you didn't update the base docker image, so the images are still using 3.11 Also, I'm not very good at all about updating the versions of the wheels. I haven't changed the wheel version for rsmanage since 2023. |
@bnmnetp, I just committed a change that upgrades the affected projects' Dockerfiles. Again, I didn't change the ones that didn't need changing (like However, you still can't test build this PR due to the aforementioned issue (that
Would like your input! |
Thanks. I think if you do alternatively it would not be hard for me to do a new release of the interactives so we can move forward. |
Perhaps you could release under a pre-release version; i.e. something like |
Nevermind, I found a way to locally test this. I found some more dependencies to upgrade. For future reference, I essentially just did a hack to locally use the built Runestone wheels by:
|
Alright, this might be a bit messy for you but hopefully a rebase fix it. I was going to release 7.7.4 today anyway with a bunch of other bug fixes. So I went ahead and bumped asyncpg as well. Which of course cascaded to bumping asyncpg everywhere. |
Alright, @bnmnetp, seems to work! For a summary of updates:
If you'd like to test it on your end before merging, feel free; you'd have to do the previously mentioned workaround in order to get it to work locally though. |
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.
We have a problem with pandas and sqlalchemy.
AttributeError: 'Engine' object has no attribute 'cursor'
You can recreate this by creating an simple assignment, answering a couple of questions in the assignment and then hitting the
http://localhost/assignment/instructor/assignment_summary/87
endpoint. The 87 there is the assignment ID. You can just get there from the assignment page.
If I remember correctly this is related to pandas version and the version of sqlalchemy we use.
OK I've looked at this a bit more. We have been on sqlalchemy 1.4.x for a very long time. pandas >= 2.0 needs sqlalchemy >= 2.0. The move to sqlalchemy 2.0 looks like a lot of work and is outside the scope of this PR. |
I see. Should we instead try to target Python 3.12 and just say that Python 3.13 is unsupported as of now? |
My quick experiments are indicating that this might not be as bad as it was when I first looked into it. I think they have done a lot more work to make the transition easier. The book server needs more testing but my initial build indicates that things are working. I'm sure there are edge cases to find, but this might only be a days worth of work instead of weeks. |
OK, Things are fine with sqlalchemy and pandas now. Hopefully that will pave the way for you to rebase and we can be on 3.13 |
b3cdd1e
to
654f990
Compare
# Conflicts: # poetry.lock # projects/rsmanage/pyproject.toml # pyproject.toml
654f990
to
f728a4c
Compare
Ok, hopefully that fixed things; the rebase was a bit of a headache. I will regenerate lock files and try this again. |
I merged this locally and pushed to main. Did not automatically close, so closing manually. |
Thanks a lot for your work on this! |
When trying to setup a new dev environment in Python 3.13, you encounter a couple issues:
[email protected]
does not work with Python 3.12 or above.asyncpg@^0.30.0
is compatible: see Test and build on Python 3.13 MagicStack/asyncpg#1188pandas@^1.0.0
is also not compatible with Python 3.13; we must update to at least^2.2.3
.asyncore
,imghdr
, andcgi
were all deprecated in 3.12.python-deadlib
as a temporary stand-in.This PR updates these dependencies to their compatible versions to make
rs
compatible with Python 3.13, and also bumps versions of affected projects.Note that currently, you are unable to test build this PR since
rsmanage
requires the newly bumped 7.7.4 version ofrunestone
, which is not on PyPi until @bnmnetp approves this PR and updates the project. However, it should work in theory, once PyPi is updated.Alternatively, you can decide to just not support Python 3.12 and above for now; this can be done very simply by limiting the Python version in
pyproject.toml
.