@@ -6,13 +6,29 @@ Mypy / Pep-484 Support for ORM Mappings
6
6
Support for :pep: `484 ` typing annotations as well as the
7
7
`Mypy <https://mypy.readthedocs.io/ >`_ type checking tool.
8
8
9
+ .. topic :: SQLAlchemy Mypy Plugin Status Update
10
+
11
+ The SQLAlchemy Mypy plugin, while it has technically never left the
12
+ "alpha" stage, should **now be considered as legacy **. SQLAlchemy 2.0
13
+ will allow for construction of declarative mappings in place which will
14
+ support proper typing directly, without the need for plugins.
15
+
16
+ The Mypy plugin itself does not solve the issue of supplying correct typing
17
+ with other typing tools such as Pylance/Pyright, Pytype, Pycharm, etc, which
18
+ cannot make use of Mypy plugins. Additionally, Mypy plugins are extremely
19
+ difficult to develop, maintain and test, as a Mypy plugin must be deeply
20
+ integrated with Mypy's internal datastructures and processes, which itself
21
+ are not stable within the Mypy project itself. The SQLAlchemy Mypy plugin
22
+ has lots of limitations when used with code that deviates from very basic
23
+ patterns which are reported regularly.
24
+
25
+ For these reasons, new non-regression issues reported against the Mypy
26
+ plugin are unlikely to be fixed; the plugin will be supplied with SQLAlchemy
27
+ 2.0 as well but will be legacy support only. SQLAlchemy 2.0 code that
28
+ makes use of upcoming declarative APIs, which are slightly adjusted from
29
+ the existing APIs, will enjoy full compliance with pep-484 as well as
30
+ working correctly within IDEs and other typing tools.
9
31
10
- .. note :: The Mypy plugin and typing annotations should be regarded as
11
- **alpha level ** for the
12
- early 1.4 releases of SQLAlchemy. The plugin has not been tested in real world
13
- scenarios and may have many unhandled cases and error conditions.
14
- Specifics of the new typing stubs are also **subject to change ** during
15
- the 1.4 series.
16
32
17
33
Installation
18
34
------------
0 commit comments