dropbox / mypy-PyCharm-plugin

A simple plugin that allows running mypy from PyCharm and navigate between errors
Apache License 2.0
313 stars 14 forks source link

Mypy plugin doesn't honor the python 2.7 option #21

Open abhishekrb19 opened 5 years ago

abhishekrb19 commented 5 years ago

I installed the mypy-plugin.jar on PyCharm 2018.1, and I am trying to run mypy on some python 2.7 code with the 2.7 interpreter and PATH suffix configured correctly.

dmypy start -- --python-version=2.7; dmypy check test_api.py or dmypy start -- --py2; dmypy check test_api.py

I see this:

test_api:95: error: Missing parentheses in call to 'print'. Did you mean print(out, err)?

This appears to be a python3 error.

Appears that the'py2'option is not being honored. I know this because running the same from command line using the option gives me different warnings (specific to python 2.7).

E.g., mypy --py2 --ignore-missing-imports test_api.py

test_api.py:16: error: Argument 1 to "join" has incompatible type "Optional[str]"; expected "str"

Has anyone tried this? It is easily reproducible. Am I missing something here?

ilevkivskyi commented 5 years ago

Thanks for reporting! This looks a bit strange, your command should always fail because currently daemon must be started with either --follow-import=skip or --follow-imports=error. Have you tried your exact command in the terminal and/or the command with correct import flags in the plugin?