Relax sqlalchemy version pin and add pre-release test workflow#1884
Relax sqlalchemy version pin and add pre-release test workflow#1884mscheltienne wants to merge 2 commits into
Conversation
|
Should I run |
📝 Docs previewLast commit 175f9db at: https://6588ea3c.sqlmodel.pages.dev |
|
I think until SQLAlchemy 2.1 released, they can still break things. So, it's not correct to relax the pin now. |
| ] | ||
|
|
||
| dependencies = [ | ||
| "SQLAlchemy >=2.0.14,<2.1.0", |
There was a problem hiding this comment.
We could keep this PR open with "SQLAlchemy>=2.1.0", removing the upper pin and keeping the pre-release job. But that would have to get merged after 2.1.0 is out.
There was a problem hiding this comment.
But will we need this after 2.1.0 is out? We will just test if it works and bump the pin
There was a problem hiding this comment.
I was proposing to remove the upper pin so that 2.2 would not be unsupported when it releases; and to keep the job testing actively against the main branch to catch any API change / failure early instead of after the release of a new version of that core dependency.
There was a problem hiding this comment.
Now I got it)
I still think it brings more risks than benefits..
If you urgently need to use latest SQLAlchemy in your project, what if you override the dependency pin for SQLAlchemy in your project?
With uv you can add the following to your pyproject.toml:
[tool.uv]
override-dependencies = [
"sqlalchemy==2.1.0b3",
]Then, uv pip list returns:
sqlalchemy 2.1.0b3
sqlmodel 0.0.39
There was a problem hiding this comment.
Oh we haven't waited ahah We have been using sqlalchemy==2.1.0b2 for the past couple of months, no issues.
My comment is more focused on the future maintenance of this project: if you have a job which continuously test against the new version of sqlalchemy (main); you can catch issues and incompatibilities early rather than having to wait for a release of sqlalchemy to then test and fix everything that is broken.
At my company, we are driving towards compatibility with python
3.14tfree-threaded. While investigating the remaining changes necessary, we noticed that:sqlalchemyversion 2.1.0b2 +sqlmodel0.0.38 (everything pass, we test mainly DB operations withpostgresusingpsycopg[c]against local dockerized DB and against actual AWS DB).sqlmodel0.0.38 (and other versions) have a very conservative"SQLAlchemy >=2.0.14,<2.1.0"constraint, preventing the installation of2.1.0b2by default.sqlmodelseems compatible withSQLAlchemy2.1.0+This PR thus proposes 2 changes:
<2.2.0, offering support for the newSQLAlchemyversion soon-to-be-released and by extension to free-threaded python.sqlalchemy, including pre-release versions.