Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sqlalchemy-stubs are installed in conda environment and entered in mypy.ini, but in pre-commit, one gets error: Error importing plugin "sqlmypy": No module named 'sqlmypy' #243

Open
serhiy-yevtushenko opened this issue Jun 20, 2022 · 2 comments

Comments

@serhiy-yevtushenko
Copy link

I have installed sqlaclhemy-stubs in my local environment (I have tried both versions from pypi and the development version from the github), but when I tried to run mypy analysis via pre-commit, I'm getting the following error message from the mypy:

mypy.ini:6:1: error: Error importing plugin "sqlmypy": No module named 'sqlmypy'

python version is 3.8
mypy version is 0.961
sqlalchemy-stubs version is 0.4

@sohnya
Copy link

sohnya commented Jun 21, 2022

@serhiy-yevtushenko this is my pre-commit config that did the trick:

  - repo: https://github.com/pre-commit/mirrors-mypy
    rev: 'v0.961'
    hooks:
    -   id: mypy
        additional_dependencies:
          - sqlalchemy-stubs

@serhiy-yevtushenko
Copy link
Author

Thanks a lot.

The suggested fix solves my issue.

It would be good to describe this use-case in the documentation, as I believe it is a pretty frequently occuring one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants