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

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

Open
abhishekrb19 opened this issue Nov 22, 2018 · 1 comment
Open

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

abhishekrb19 opened this issue Nov 22, 2018 · 1 comment

Comments

@abhishekrb19
Copy link

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
Copy link
Contributor

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?

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