Skip to content

Commit 9dc9bea

Browse files
authored
Merge pull request #558 from chirizxc/starlette-integration
add warn for starlette integration
2 parents 3c40d99 + bd2d2c2 commit 9dc9bea

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

docs/integrations/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Some of the integrations are supported by a community, refer to their documentat
6969
-
7070
- `Jobify <https://github.com/C3EQUALZz/dishka-jobify>`_ (:abbr:`com (Community support)`)
7171
-
72-
* - :ref:`Starlette`
72+
* - `Starlette <https://github.com/reagento/starlette-dishka>`_ (:abbr:`com (Community support)`)
7373
-
7474
-
7575
-

docs/integrations/starlette.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
Starlette
44
===========================================
55

6+
.. warning::
7+
The integration has been moved to the `starlette-dishka <https://github.com/reagento/starlette-dishka>`_ package and will be removed in future versions.
8+
.. code-block:: shell
9+
10+
pip install starlette-dishka
11+
612
Though it is not required, you can use *dishka-starlette* integration. It features:
713

814
* automatic *REQUEST* and *SESSION* scope management using middleware

src/dishka/integrations/starlette.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"setup_dishka",
66
]
77

8+
import warnings
89
from collections.abc import Callable
910
from typing import ParamSpec, TypeVar
1011

@@ -20,6 +21,14 @@
2021
T = TypeVar("T")
2122
P = ParamSpec("P")
2223

24+
warnings.warn(
25+
"`dishka.integrations.starlette` will be removed in `dishka==2.0`.\n"
26+
"Use `starlette-dishka` package instead, as integrations "
27+
"are now maintained in separate third-party packages for faster updates.",
28+
DeprecationWarning,
29+
stacklevel=2,
30+
)
31+
2332

2433
def inject(func: Callable[P, T]) -> Callable[P, T]:
2534
return wrap_injection(

0 commit comments

Comments
 (0)