Issue with mypy and the new version of alembic (1.7.1 agaist 1.6.5)

Skip to first unread message

Stéphane Brunner

Sep 2, 2021, 3:32:11 AMSep 2
to sqlalchemy

In the new version, I get the following error with my mypy check:

Traceback (most recent call last):
File "/usr/local/bin/prospector", line 8, in <module>
File "/usr/local/lib/python3.8/dist-packages/prospector/", line 181, in main
File "/usr/local/lib/python3.8/dist-packages/prospector/", line 70, in execute
messages +=
File "/usr/local/lib/python3.8/dist-packages/prospector/tools/mypy/", line 90, in run
result =
File "mypy/", line 69, in run
File "mypy/", line 58, in _run
File "mypy/", line 69, in <lambda>
File "mypy/", line 87, in main
File "mypy/", line 165, in run_build
File "mypy/", line 179, in build
File "mypy/", line 254, in _build
File "mypy/", line 2697, in dispatch
File "mypy/", line 3021, in process_graph
File "mypy/", line 3138, in process_stale_scc
File "mypy/", line 2288, in write_cache
File "mypy/", line 1475, in write_cache
File "mypy/", line 313, in serialize
File "mypy/", line 3149, in serialize
File "mypy/", line 3083, in serialize
AssertionError: Definition of alembic.runtime.migration.EnvironmentContext is unexpectedly incomplete

Is it an issue in the newly added types in alembic?

Thanks in advance
Stéphane Brunner

Mike Bayer

Sep 2, 2021, 9:45:45 AMSep 2
to noreply-spamdigest via sqlalchemy
this is issue and we don't know how to fix it.  suggestions welcome.
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See for a full description.
You received this message because you are subscribed to the Google Groups "sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to

Stéphane Brunner

Sep 3, 2021, 2:52:15 PMSep 3
to sqlalchemy
OK, thanks for the information :-)
Reply all
Reply to author
0 new messages