Mypy 0.750 not compatible with Python 3.9
thundergolfer opened this issue · 0 comments
At time of writing, the README
offers Mypy version 0.750 in it's demo code/config. It can be found that this version is not compatible with Python 3.9, producing a great number of "syntax error in type comment"
errors when attempting to run a type-checking aspect or rule. See this issue: python/mypy#9916.
The investigation of this issue was done in the following reproduction repo: github.com/bogdan-lytvynov/bazel-mypy-integration-failed
If you clone that repo and attempt to run the integration using Python 3.9, with --test_output=all
you will see the following kind of error lines:
/usr/local/lib/python3.9/site-packages/mypy/typeshed/stdlib/2and3/builtins.pyi:41: error: syntax error in type comment
/usr/local/lib/python3.9/site-packages/mypy/typeshed/stdlib/2and3/builtins.pyi:42: error: syntax error in type comment
/usr/local/lib/python3.9/site-packages/mypy/typeshed/stdlib/2and3/builtins.pyi:43: error: syntax error in type comment
/usr/local/lib/python3.9/site-packages/mypy/typeshed/stdlib/2and3/builtins.pyi:46: error: syntax error in type comment
...
To see that the error is not coming from the Bazel integration, I did python3 -m pip install mypy==0.750
and ran mypy print/print.py
and got the same errors.
Action:
This is not a bug in the integration but I'll add a note in the README about it.