Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,38 @@ jobs:
path: coverage
include-hidden-files: true

test-sqlalchemy-prerelease:
# Run tests against the latest SQLAlchemy pre-release to catch compatibility
# issues early. This job is intentionally not required by alls-green.
runs-on: ubuntu-latest
env:
UV_PYTHON: "3.14"
UV_RESOLUTION: highest
UV_PRERELEASE: allow
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.14"
- name: Setup uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
enable-cache: true
cache-dependency-glob: |
pyproject.toml
uv.lock
- name: Install Dependencies
run: uv sync --no-dev --group tests --upgrade-package sqlalchemy
- name: Show SQLAlchemy version
run: uv run python -c "import sqlalchemy; print(f'SQLAlchemy {sqlalchemy.__version__}')"
- run: mkdir coverage
- name: Test
run: uv run bash scripts/test.sh
env:
COVERAGE_FILE: coverage/.coverage.sqlalchemy-prerelease
CONTEXT: sqlalchemy-prerelease

coverage-combine:
needs:
- test
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ classifiers = [
]

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

But will we need this after 2.1.0 is out? We will just test if it works and bump the pin

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.

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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

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.

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.

"SQLAlchemy >=2.0.14,<2.2.0",
"pydantic>=2.11.0",
"typing-extensions>=4.5.0",
]
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading