Uh oh!
There was an error while loading. Please reload this page.
Support Python 3.13 - #736
Conversation
bnmnetp
commented
Jun 4, 2025
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. |
eoyoa
commented
Jun 4, 2025
Just as a heads up for your review @bnmnetp, I'm not sure how the However, one suitable alternative for the
If the |
bnmnetp
commented
Jun 4, 2025
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! |
bnmnetp
commented
Jun 5, 2025
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. |
eoyoa
commented
Jun 6, 2025
Perhaps you could release under a pre-release version; i.e. something like |
eoyoa
commented
Jun 6, 2025
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:
|
bnmnetp
commented
Jun 6, 2025
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. |
eoyoa
commented
Jun 6, 2025
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. |
bnmnetp
left a comment
There was a problem hiding this comment.
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.
bnmnetp
commented
Jun 14, 2025
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. |
eoyoa
commented
Jun 14, 2025
I see. Should we instead try to target Python 3.12 and just say that Python 3.13 is unsupported as of now? |
bnmnetp
commented
Jun 14, 2025
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. |
bnmnetp
commented
Jun 15, 2025
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 |
# Conflicts: # poetry.lock # projects/rsmanage/pyproject.toml # pyproject.toml
Ok, hopefully that fixed things; the rebase was a bit of a headache. I will regenerate lock files and try this again. |
bnmnetp
commented
Jun 17, 2025
I merged this locally and pushed to main. Did not automatically close, so closing manually. |
bnmnetp
commented
Jun 17, 2025
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:
asyncpg@0.28.0does not work with Python 3.12 or above.asyncpg@^0.30.0is compatible: see Test and build on Python 3.13 MagicStack/asyncpg#1188pandas@^1.0.0is also not compatible with Python 3.13; we must update to at least^2.2.3.asyncore,imghdr, andcgiwere all deprecated in 3.12.python-deadlibas a temporary stand-in.This PR updates these dependencies to their compatible versions to make
rscompatible with Python 3.13, and also bumps versions of affected projects.Note that currently, you are unable to test build this PR since
rsmanagerequires 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.