Skip to content

chore: upgrade dependencies, pin sqlalchemy below 2.1 - #69

Merged
lesnik512 merged 1 commit into
mainfrom
chore/upgrade-deps
Sep 27, 2026
Merged

lesnik512 merged 1 commit into
mainfrom
chore/upgrade-deps

Conversation

@lesnik512

Copy link
Copy Markdown
Member

Upgrades all locked dependencies (uv lock --upgrade) and adapts to the breaking changes. Mirrors modern-python/litestar-sqlalchemy-template#43.

  • modern-di-fastapi constraint raised from >=2,<3 to >=3,<4 (modern-di 2 -> 3): cache_settings= is renamed to cache=.
  • psycopg2 -> psycopg, and Alembic now names the driver explicitly (postgresql+psycopg), so migrations don't depend on SQLAlchemy's default Postgres driver, which changes in 2.1.
  • ruff 0.16: ignore CPY001 (copyright header).

Why sqlalchemy is pinned below 2.1

On SQLAlchemy 2.1 (checked on 2.1.0 and 2.1.1) the asyncpg adapter no longer includes the DETAIL: Key (...)=(...) already exists. line in exc.orig.args. advanced-alchemy 1.11.0 (latest) detects duplicate keys with regexes that need that line, so a unique violation surfaces as a generic IntegrityError instead of DuplicateKeyError and the API returns 500 instead of 400. tests/test_cards.py::test_create_cards catches this.

Upstream: litestar-org/advanced-alchemy#803. Remove the pin once a fixed release is out.

@lesnik512
lesnik512 merged commit ae2d843 into main Sep 27, 2026
2 checks passed
@lesnik512
lesnik512 deleted the chore/upgrade-deps branch September 27, 2026 17:19
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.

1 participant