3

I am using alembic in a project. Everything works as expected, but when checking the types with mypy I am getting:

error: Module "alembic" has no attribute "op"  [attr-defined]
error: Module "alembic" has no attribute "context"  [attr-defined]

Any idea how to resolve this? Do I need to install types? Is there something else that I am missing?

Imre_G
  • 2,468
  • 1
  • 17
  • 33
  • 1
    There are stubs for `op` and `context` only. You need only `alembic` installed into the same environment where `mypy` lives (e.g. add it into `additional_dependencies` of .pre-commit-config). [Relevant issue](https://github.com/sqlalchemy/alembic/issues/745) – STerliakov Jan 23 '23 at 20:07

0 Answers0