dropbox / sqlalchemy-stubs

Mypy plugin and stubs for SQLAlchemy
Apache License 2.0
570 stars 101 forks source link

support for sqlalchemy version 1.4 and 2.0 #184

Open GunpowderGuy opened 3 years ago

GunpowderGuy commented 3 years ago

Those versions will introduce massive api changes, will this package support them? If so, has work towards that started?

playfulpachyderm commented 3 years ago

I'm currently using this package with sqlalchemy 1.4; it's fairly usable. The only problems I've had so far is that some of the imports have changed, e.g. sqlalchemy.orm.exc.NoResultFound has moved to sqlalchemy.exc.NoResultFound. I believe this is the only place I've had to add an inline # type: ignore.

CaselIT commented 3 years ago

sqlalchemy 1.4 added support for mypy. See the documentation

It's not yet released on pypi tough cc @zzzeek

andersk commented 3 years ago

It’s awesome that SQLAlchemy upstream is going to support mypy, but at present they don’t seem to have anything more than auto-generated stubs with everything annotated as Any or None, and a significant number of the None annotations being wrong. So sqlalchemy-stubs will continue to be needed for some time.

ZanderBrown commented 3 years ago

Haven't had a chance to play yet but it does have a plug-in