The new version should support 2.7, but pip-installing it fails with a SyntaxError on a line with python 3 type-annotation syntax (which is kinda ironic):
Traceback (most recent call last):
...
from mypy import git
File "mypy/git.py", line 10
def is_git_repo(dir: str) -> bool:
^
SyntaxError: invalid syntax
You can't run Mypy on Python 2. The project's README is specific about this:
You need Python 3.2 or later to run mypy.
You can still use it on Python 2 code though. Just use the comment-based annotations and give Mypy the --py2
flag. You also need the typing library for Python 2, which you can install using pip:
pip install typing
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With