python / typed_ast

Modified fork of CPython's ast module that parses `# type:` comments
Other
228 stars 54 forks source link

Older releases crash pip when it tries to build them #166

Closed flying-sheep closed 3 years ago

flying-sheep commented 3 years ago

When trying to run pre-commit, I see pip resolving like this:

    Collecting mypy==0.700
      Downloading mypy-0.700-py3-none-any.whl (1.5 MB)
    Collecting typed-ast<1.4.0,>=1.3.1
      Downloading typed-ast-1.3.5.tar.gz (205 kB)

It then crashes trying to build this typed-ast version:

In file included from ast3/Custom/typed_ast.c:3:
ast3/Include/compile-ast3.h:6: warning: "Py_func_type_input" redefined
    6 | #define Py_func_type_input 343
      |
In file included from /usr/include/python3.9/Python.h:151,
                 from ast3/Custom/typed_ast.c:1:
/usr/include/python3.9/compile.h:111: note: this is the location of the previous definition
  111 | #define Py_func_type_input 345
      |

What’s the best fix here? Never pinning mypy?

srittau commented 3 years ago

typed-ast 1.3.5 only supports Python versions up to 3.7. mypy 0.700 is also ancient. I suggest to update mypy (and typed-ast) to a version that supports Python 3.9.

flying-sheep commented 3 years ago

I see, thank you!