Skip to content

Commit 9cf21d6

Browse files
committed
update README to note 1.4 use only
SQLAlchemy 2.0 is now proceeding with its new typing approach, which will be incompatible with that of sqlalchemy2-stubs. Current discussions seem to indicate there's no way for SQLAlchemy 2.0's typing annotations to take effect when any stubs packages are installed, so these will need to be removed.
1 parent 763d9c9 commit 9cf21d6

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed

README.rst

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,34 @@
22
SQLAlchemy 2 Stubs
33
===================
44

5-
These are PEP-484 typing stubs for `SQLAlchemy <https://www.sqlalchemy.org>`_
6-
1.4 and 2.0. They are released concurrently along with
7-
a `Mypy extension <https://docs.sqlalchemy.org/en/14/orm/extensions/mypy.html>`_
8-
which is designed to work with these stubs, which assists primarily in the
9-
area of ORM mappings.
5+
These are interim PEP-484 typing stubs for the
6+
`SQLAlchemy <https://www.sqlalchemy.org>`_ **1.4 release series only**. They
7+
are released concurrently along with a
8+
`Mypy extension <https://docs.sqlalchemy.org/en/14/orm/extensions/mypy.html>`_
9+
which is designed to work with these stubs, which assists primarily in the area
10+
of ORM mappings.
1011

1112
The stubs replace the use of the "sqlalchemy-stubs" package published by
12-
Dropbox. Differences include that these stubs are generated against
13-
1.4's API as well as some adjustments to the use of generics.
13+
Dropbox. Differences include that these stubs are generated against 1.4's API
14+
as well as some adjustments to the use of generics. The sqlalchemy2-stubs stubs
15+
package **will not work with SQLAlchemy 2.0, and will need to be explicitly /
16+
manually uninstalled when upgrading to SQLAlchemy 2.0**.
1417

1518
This project should be considered **alpha level** and is not as mature
1619
as the Dropbox stubs for the initial release.
1720

1821
See the Mypy plugin documentation at https://docs.sqlalchemy.org/en/14/orm/extensions/mypy.html
1922
for an overview of how to use PEP-484 annotations with ORM mapped classes.
2023

24+
For SQLAlchemy 2.0, when released, **the sqlalchemy2-stubs project is not
25+
compatible**. SQLAlchemy 2.0 will be / is fully pep-484 typed inline and
26+
will not be compatible with any stubs. There unfortunately appears to be no
27+
standard approach in Python for the problem of a library that upgrades to
28+
include typing annotations inline, as typing tools will still consider
29+
any installed stubs to take precedence. Therefore **sqlalchemy2-stubs
30+
will need to be manually uninstalled when upgrading to SQLAlchemy 2.0**.
31+
32+
2133
Code of Conduct
2234
---------------
2335

0 commit comments

Comments
 (0)