Skip to content

Dependency on mypy and black breaks tests on pypy #22

Description

@jaraco

In jaraco/keyring#442, I learned that mypy and black do not install on Python 3 and fail with a CalledProcessError:

pypy py3.7 $ pypy -m pip-run black
Collecting black
  Using cached black-19.10b0-py36-none-any.whl (97 kB)
Collecting click>=6.5
  Using cached click-7.1.2-py2.py3-none-any.whl (82 kB)
Collecting attrs>=18.1.0
  Using cached attrs-20.1.0-py2.py3-none-any.whl (49 kB)
Collecting appdirs
  Using cached appdirs-1.4.4-py2.py3-none-any.whl (9.6 kB)
Collecting toml>=0.9.4
  Using cached toml-0.10.1-py2.py3-none-any.whl (19 kB)
Collecting typed-ast>=1.4.0
  Using cached typed_ast-1.4.1.tar.gz (208 kB)
Processing /Users/jaraco/Library/Caches/pip/wheels/7a/25/f7/0438bbbab2deb9797b030008cdcad3255de77e940a6231e1b0/regex-2020.7.14-pp36-pypy36_pp73-macosx_10_7_x86_64.whl
Collecting pathspec<1,>=0.6
  Using cached pathspec-0.8.0-py2.py3-none-any.whl (28 kB)
Installing collected packages: click, attrs, appdirs, toml, typed-ast, regex, pathspec, black
    Running setup.py install for typed-ast ... \    ERROR: Command errored out with exit status 1:
     command: /usr/local/bin/pypy -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-install-z3yz71_6/typed-ast/setup.py'"'"'; __file__='"'"'/private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-install-z3yz71_6/typed-ast/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-record-dit5pdzu/install-record.txt --single-version-externally-managed --home /private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-target-8kwwkmay --compile --install-headers /private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-target-8kwwkmay/include/python/typed-ast
         cwd: /private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-install-z3yz71_6/typed-ast/
    Complete output (33 lines):
error
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.7-x86_64-3.6
    creating build/lib.macosx-10.7-x86_64-3.6/typed_ast
    copying typed_ast/conversions.py -> build/lib.macosx-10.7-x86_64-3.6/typed_ast
    copying typed_ast/__init__.py -> build/lib.macosx-10.7-x86_64-3.6/typed_ast
    copying typed_ast/ast3.py -> build/lib.macosx-10.7-x86_64-3.6/typed_ast
    copying typed_ast/ast27.py -> build/lib.macosx-10.7-x86_64-3.6/typed_ast
    package init file 'ast3/tests/__init__.py' not found (or not a regular file)
    creating build/lib.macosx-10.7-x86_64-3.6/typed_ast/tests
    copying ast3/tests/test_basics.py -> build/lib.macosx-10.7-x86_64-3.6/typed_ast/tests
    running build_ext
    building '_ast27' extension
    creating build/temp.macosx-10.7-x86_64-3.6
    creating build/temp.macosx-10.7-x86_64-3.6/ast27
    creating build/temp.macosx-10.7-x86_64-3.6/ast27/Parser
    creating build/temp.macosx-10.7-x86_64-3.6/ast27/Python
    creating build/temp.macosx-10.7-x86_64-3.6/ast27/Custom
    gcc -pthread -arch x86_64 -DNDEBUG -O2 -fPIC -Iast27/Include -I/usr/local/Cellar/pypy3/7.3.1_1/libexec/include -c ast27/Parser/acceler.c -o build/temp.macosx-10.7-x86_64-3.6/ast27/Parser/acceler.o
    gcc -pthread -arch x86_64 -DNDEBUG -O2 -fPIC -Iast27/Include -I/usr/local/Cellar/pypy3/7.3.1_1/libexec/include -c ast27/Parser/bitset.c -o build/temp.macosx-10.7-x86_64-3.6/ast27/Parser/bitset.o
    gcc -pthread -arch x86_64 -DNDEBUG -O2 -fPIC -Iast27/Include -I/usr/local/Cellar/pypy3/7.3.1_1/libexec/include -c ast27/Parser/grammar.c -o build/temp.macosx-10.7-x86_64-3.6/ast27/Parser/grammar.o
    gcc -pthread -arch x86_64 -DNDEBUG -O2 -fPIC -Iast27/Include -I/usr/local/Cellar/pypy3/7.3.1_1/libexec/include -c ast27/Parser/grammar1.c -o build/temp.macosx-10.7-x86_64-3.6/ast27/Parser/grammar1.o
    gcc -pthread -arch x86_64 -DNDEBUG -O2 -fPIC -Iast27/Include -I/usr/local/Cellar/pypy3/7.3.1_1/libexec/include -c ast27/Parser/node.c -o build/temp.macosx-10.7-x86_64-3.6/ast27/Parser/node.o
    gcc -pthread -arch x86_64 -DNDEBUG -O2 -fPIC -Iast27/Include -I/usr/local/Cellar/pypy3/7.3.1_1/libexec/include -c ast27/Parser/parser.c -o build/temp.macosx-10.7-x86_64-3.6/ast27/Parser/parser.o
    gcc -pthread -arch x86_64 -DNDEBUG -O2 -fPIC -Iast27/Include -I/usr/local/Cellar/pypy3/7.3.1_1/libexec/include -c ast27/Parser/parsetok.c -o build/temp.macosx-10.7-x86_64-3.6/ast27/Parser/parsetok.o
    gcc -pthread -arch x86_64 -DNDEBUG -O2 -fPIC -Iast27/Include -I/usr/local/Cellar/pypy3/7.3.1_1/libexec/include -c ast27/Parser/tokenizer.c -o build/temp.macosx-10.7-x86_64-3.6/ast27/Parser/tokenizer.o
    ast27/Parser/tokenizer.c:17:10: fatal error: 'codecs.h' file not found
    #include "codecs.h"
             ^~~~~~~~~~
    1 error generated.
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/bin/pypy -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-install-z3yz71_6/typed-ast/setup.py'"'"'; __file__='"'"'/private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-install-z3yz71_6/typed-ast/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-record-dit5pdzu/install-record.txt --single-version-externally-managed --home /private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-target-8kwwkmay --compile --install-headers /private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-target-8kwwkmay/include/python/typed-ast Check the logs for full command output.
Traceback (most recent call last):
  File "/usr/local/Cellar/pypy3/7.3.1_1/libexec/lib-python/3/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/local/Cellar/pypy3/7.3.1_1/libexec/lib-python/3/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/usr/local/Cellar/pypy3/7.3.1_1/libexec/site-packages/pip-run.py", line 4, in <module>
    __name__ == '__main__' and run()
  File "/usr/local/Cellar/pypy3/7.3.1_1/libexec/site-packages/pip_run/__init__.py", line 18, in run
    with deps.load(*deps.not_installed(pip_args)) as home:
  File "/usr/local/Cellar/pypy3/7.3.1_1/libexec/lib-python/3/contextlib.py", line 81, in __enter__
    return next(self.gen)
  File "/usr/local/Cellar/pypy3/7.3.1_1/libexec/site-packages/pip_run/deps.py", line 48, in load
    _installable(args) and subprocess.check_call(cmd)
  File "/usr/local/Cellar/pypy3/7.3.1_1/libexec/lib-python/3/subprocess.py", line 311, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '('/usr/local/bin/pypy', '-m', 'pip', 'install', '-t', '/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-run-f1hxkkx7', 'black')' returned non-zero exit status 1.

As a result, no project that derives from the skeleton, which currently enables pytest-black and pytest-mypy unconditionally, will fail to run tests on PyPy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions