Skip to content

Relax sqlalchemy version pin and add pre-release test workflow#1884

Closed
mscheltienne wants to merge 2 commits into
fastapi:mainfrom
mscheltienne:rm_pin
Closed

Relax sqlalchemy version pin and add pre-release test workflow#1884
mscheltienne wants to merge 2 commits into
fastapi:mainfrom
mscheltienne:rm_pin

Conversation

@mscheltienne

Copy link
Copy Markdown

At my company, we are driving towards compatibility with python 3.14t free-threaded. While investigating the remaining changes necessary, we noticed that:

  • Our CIs are happy with sqlalchemy version 2.1.0b2 + sqlmodel 0.0.38 (everything pass, we test mainly DB operations with postgres using psycopg[c] against local dockerized DB and against actual AWS DB).
  • The test environment was tricky to build because sqlmodel 0.0.38 (and other versions) have a very conservative "SQLAlchemy >=2.0.14,<2.1.0" constraint, preventing the installation of 2.1.0b2 by default.
  • As far as I could tell, sqlmodel seems compatible with SQLAlchemy 2.1.0+

This PR thus proposes 2 changes:

  1. Relax the constraint to <2.2.0, offering support for the new SQLAlchemy version soon-to-be-released and by extension to free-threaded python.
  2. Add a test job which runs against the latest release of sqlalchemy, including pre-release versions.

@mscheltienne

mscheltienne commented Apr 23, 2026

Copy link
Copy Markdown
Author

Should I run uv lock --upgrade? What is your workflow here? For now I ran it without the --upgrade flag.

@github-actions

Copy link
Copy Markdown
Contributor

📝 Docs preview

Last commit 175f9db at: https://6588ea3c.sqlmodel.pages.dev

@YuriiMotov

Copy link
Copy Markdown
Member

I think until SQLAlchemy 2.1 released, they can still break things. So, it's not correct to relax the pin now.
Let's wait for the release

@YuriiMotov YuriiMotov closed this Jul 15, 2026
Comment thread pyproject.toml
]

dependencies = [
"SQLAlchemy >=2.0.14,<2.1.0",

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants