refactor(repository): migrate in-tree callers to advanced_alchemy.filters#4735
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4735 +/- ##
=======================================
Coverage 67.38% 67.38%
=======================================
Files 292 292
Lines 14999 14999
Branches 1685 1685
=======================================
Hits 10107 10107
Misses 4756 4756
Partials 136 136 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
cofin
force-pushed
the
feat/repository-deprecation
branch
from
April 26, 2026 16:02
ed051e5 to
9dec4bf
Compare
Harshal6927
approved these changes
Apr 26, 2026
Three call sites import LimitOffset from litestar.repository.filters; swap each to advanced_alchemy.filters so the package is warning-free on a clean install once the deprecation shims land in the next commit.
cofin
force-pushed
the
feat/repository-deprecation
branch
from
April 26, 2026 18:06
9dec4bf to
883a58f
Compare
This was referenced May 9, 2026
cofin
added a commit
that referenced
this pull request
May 11, 2026
…ns.minijinja (#4760) Moves the MiniJinja template engine integration from `litestar.contrib.minijinja` to `litestar.plugins.minijinja`, and removes the contrib path on `main`. A follow-up PR onto `v2` will add a deprecation shim covering both public and private symbols. Same shape as the OTel split (#4691 + #4759) and the repository split (#4735 + #4758). `litestar/plugins/flash.py` lazily imports the private `_transform_state` from MiniJinja, so any deprecation shim has to forward private symbols. That diagnosis came from @xronocode's audit in #4754; this PR preserves it by migrating flash.py before deleting contrib, so every intermediate commit keeps the dependency graph valid. Salvages the contrib tests into `tests/unit/test_plugins/test_minijinja.py` (98% coverage), migrates every internal call site, and adds `docs/reference/plugins/minijinja.rst`. Closes #4718. Co-authored-by: xronocode <myevdokimov@gmail.com>
cofin
added a commit
that referenced
this pull request
May 11, 2026
…4764) Moves the Mako template engine integration from `litestar.contrib.mako` to `litestar.plugins.mako`, and removes the contrib path on `main`. A follow-up PR onto `v2` will add a deprecation shim, giving 2.x users a migration window. Same shape as the OTel split (#4691 + #4759) and the repository split (#4735 + #4758). Implementation reference: PR #4753 by @xronocode. Every commit carries a co-author trailer. Salvages the contrib tests into `tests/unit/test_plugins/test_mako.py`, migrates every internal call site (csrf middleware, flash, template suite), and adds `docs/reference/plugins/mako.rst`. Closes #4717. Co-authored-by: xronocode <myevdokimov@gmail.com>
cofin
added a commit
that referenced
this pull request
May 13, 2026
…#4762) Moves the Jinja2 template engine integration from `litestar.contrib.jinja` to `litestar.plugins.jinja`, and removes the contrib path on `main`. A follow-up PR onto `v2` will add a deprecation shim, giving 2.x users a migration window. Same shape as the OTel split (#4691 + #4759) and the repository split (#4735 + #4758). Implementation reference: PR #4752 by @xronocode. Every commit carries a co-author trailer. Salvages the contrib tests into `tests/unit/test_plugins/test_jinja.py`, migrates every internal call site (csrf middleware, flash, template suite, htmx examples), and adds `docs/reference/plugins/jinja.rst`. Closes #4716. Co-authored-by: xronocode <myevdokimov@gmail.com>
cofin
added a commit
that referenced
this pull request
May 17, 2026
This deprecates `litestar.repository` in favor of `advanced_alchemy`. The `litestar.repository` module — including its `filters`, `exceptions`, `handlers`, `abc`, and `testing` submodules — will be removed before 3.0.0, and this lands the deprecation on the v2 line so users have a release to migrate against. The new home for everything is `advanced_alchemy`: - `advanced_alchemy.filters` for the filter types - `advanced_alchemy.exceptions` for the repository exceptions - `advanced_alchemy.repository.SQLAlchemyAsyncRepository` / `SQLAlchemySyncRepository` for the abstract base classes - `advanced_alchemy.repository.memory.SQLAlchemyAsyncMockRepository` / `SQLAlchemySyncMockRepository` for the generic mock under `litestar.repository.testing` Each public symbol's warning text spells out exactly what to import instead, so users get a one-line fix from the `DeprecationWarning` itself. Under the hood this is PEP 562 `__getattr__` shims at every submodule entry point. Importing `litestar.repository` is silent; only attribute access fires the warning, so test runs that touch the package transitively don't get spammed. Documentation gets a `.. deprecated:: 2.22.0` notice on each of the three reference pages, and there's a changelog entry under a new `2.22.0` block. A parametrized test in `tests/unit/test_deprecations.py` asserts every public symbol fires `DeprecationWarning` and that the message names the `advanced_alchemy` target. ### Note on `nitpick_ignore` The deprecation notes cross-reference `advanced_alchemy` classes via `:class:` directives. Those can't be resolved through intersphinx right now — advanced-alchemy's `objects.inv` is missing `py:class` entries for everything under `advanced_alchemy.repository` and `advanced_alchemy.repository.memory` (only `py:parameter` entries are indexed). Filed upstream as [advanced-alchemy#729](litestar-org/advanced-alchemy#729). As a temporary workaround, this PR adds three entries to `nitpick_ignore` in `docs/conf.py`, matching the existing entry for `SQLAlchemyAsyncRepository`: - `advanced_alchemy.repository.SQLAlchemySyncRepository` - `advanced_alchemy.repository.memory.SQLAlchemyAsyncMockRepository` - `advanced_alchemy.repository.memory.SQLAlchemySyncMockRepository` Once the upstream fix ships and the v3.x line picks up the new inventory, those entries can be removed. Closes #4721 once merged. The main-side migration of in-tree callers landed in #4735.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three call sites in tests and examples still imported
LimitOffsetfromlitestar.repository.filterseven thoughadvanced_alchemy.filtershas been the canonical home for those types. This swaps the imports so the package is warning-free against itself, plus a small isort follow-up to keep the groupedadvanced_alchemyimports tidy.The deprecation shim that originally lived on this branch has been split out into a follow-up PR targeting
v2— that's where theDeprecationWarningbelongs so 2.x users get a migration window before 3.0 GA removes the old path. This PR is now just the in-tree caller hygiene.📚 Documentation preview 📚: https://litestar-org.github.io/litestar-docs-preview/4735