Page MenuHomePhabricator

Disable mypy cache
Needs ReviewPublic

Authored by thopre on Jan 20 2021, 4:47 AM.

Details

Summary

Mypy crashes with "AssertionError: Cannot find module for UpdatedBase"
when analyzing lnt/server/db/migrations/upgrade_0_to_1.py with a
populated cache. This leads to a number of files not being analyzed by
mypy.

Event Timeline

thopre requested review of this revision.Jan 20 2021, 4:47 AM
thopre created this revision.

Why does the cache cause this error in mypy? Is it a documented problem?

Why does the cache cause this error in mypy? Is it a documented problem?

I think it might be a problem with the sqlalchemy stub/plugin. UpdatedBase is alias to the same call to declarative_base() as Base in the same file. I'm guessing that plugin does not inform Mypy of the dynamic nature of that function call or something like that. It's still early days for that plugin apparently but without using it we get some error that cannot be fixed due to that same declarative_base. I'll try to report the bug.