-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Missing unit test dependencies on Linux? #12903
Comments
Thanks for reporting! You probably need to install something like |
@JelleZijlstra Thanks. I'll try python3-dev later today. |
@JelleZijlstra (venv) edreamleo@edreamleo-MS-7D09:~/mypy$ python3 -m pytest
======================================= test session starts ========================================
platform linux -- Python 3.8.10, pytest-7.1.2, pluggy-1.0.0
rootdir: /home/edreamleo/mypy, configfile: pytest.ini, testpaths: mypy/test, mypyc/test
plugins: xdist-2.5.0, cov-2.12.1, forked-1.4.0
gw0 [10345] / gw1 [10345] / gw2 [10345] / gw3 [10345] / gw4 [10345] / gw5 [10345] / gw6 [10345] / gwgw0 [10345] / gw1 [10345] / gw2 [10345] / gw3 [10345] / gw4 [10345] / gw5 [10345] / gw6 [10345] / gw7 [10345]
..........................................s................................................. [ 0%]
................x........................................................................... [ 1%]
............................................................................................ [ 2%]
............................................................................................ [ 3%]
............................................................................................. [ 4%]
............................................................................................ [ 5%]
............................................................................................ [ 6%]
............................................................................................ [ 7%]
................................................................................s........... [ 8%]
....................................................s....................................... [ 8%]
...................................................................................s........ [ 9%]
.................................................................................s.......... [ 10%]
............................................................................................ [ 11%]
............................................................................................. [ 12%]
............................................................................................ [ 13%]
............................................................................................ [ 14%]
............................................................................................ [ 15%]
..............s............................................................................. [ 16%]
............................................................................................ [ 16%]
............................................................................................ [ 17%]
............................................................................................ [ 18%]
............................................................................................ [ 19%]
............................................................................................ [ 20%]
............................................................................................ [ 21%]
...............................................s............................................ [ 22%]
............................................................................................ [ 23%]
............................................................................................ [ 24%]
............................................................................................ [ 24%]
............................................................................................ [ 25%]
............................................................................................ [ 26%]
............................................................................................ [ 27%]
............................................................................................ [ 28%]
............................................................................................ [ 29%]
.............................................................ss............................. [ 30%]
............................................................................................ [ 31%]
............................................................................................ [ 32%]
........................................s.................................................... [ 32%]
............................................................................................ [ 33%]
....................................s........................................................ [ 34%]
............................................................................................ [ 35%]
.......................................................................s.................... [ 36%]
............................................................................................ [ 37%]
............................................................................................ [ 38%]
............................................................................................ [ 39%]
............................................................................................ [ 40%]
...............................................................s............................ [ 40%]
.........................................................................................s.. [ 41%]
............................................................................................ [ 42%]
............................................................................................ [ 43%]
............................................................................................ [ 44%]
............................................................................................ [ 45%]
............................................................................................ [ 46%]
..................x..........x.............................................................. [ 47%]
............................................................................................ [ 48%]
............................................................................................ [ 48%]
....................s....................................................................... [ 49%]
........................................................................s............s....... [ 50%]
............................................................................................ [ 51%]
............................................................................................ [ 52%]
............................................................................................ [ 53%]
............................................................................................ [ 54%]
............................................................................................ [ 55%]
............................................................................................ [ 56%]
...........s..............s.....................................................s........... [ 56%]
....................................ssssss.ss................................s.............. [ 57%]
..............x.....................s...............s...........................sss........s [ 58%]
....s............x.......................s.................................................. [ 59%]
.sx.......s.............ss..........s...............................................s......... [ 60%]
.................s.............................................sss.......................... [ 61%]
..............sss...........sssssss.ss..s......s...s..............................s.....sss. [ 62%]
s....s............sss.....ssssss..s....s...ss.........s..ssss....s..s..sss..........s......s [ 63%]
.........s.s........ss.ss....s....ss.ss.s.....s.s..........ss..............s.s.............. [ 64%]
s.........s....ssss.s.....sss...ssss......sssssss.....s......s...s............s.....s...s... [ 64%]
................s....ss.s.sss...ss...ssssssss.ss.......ss...ss..s...s.s.ssssss.sssssssssss.s [ 65%]
ssss.sssss................ss.....s.......s................................................... [ 66%]
.......................s..s..........s........s...s.....s.......ssss......ss.............sss [ 67%]
sss.....s.ss.s.....................s.s.s.ss...........................................s...... [ 68%]
....................ss..ss..s..s.s..s..s.s.s..s.s.s.s..s.s.s........................ssssssss [ 69%]
sssssssssssssssss.s.s.ss.s..s.s.s.ss.s.s..s..s.s.s.s.ss.s.s.s.s.s.s.ss.s.s.s.....ss.ssss..ss [ 70%]
s..s.s.s.s..................................................s.s.s..ss.....s................. [ 71%]
......s........................s........................s...............s................... [ 72%]
.....................................s...................................................... [ 73%]
.............s.................s........ss.................................................. [ 73%]
............................................................................................. [ 74%]
............................s...s........................................................... [ 75%]
............................................................................................ [ 76%]
........................................................................s................... [ 77%]
............................................................................................. [ 78%]
..............................................................s............................. [ 79%]
............................................................................................ [ 80%]
............................................................................................ [ 81%]
............................................................................................ [ 81%]
............................................................................................ [ 82%]
.s........................................................................................... [ 83%]
............................................................................................. [ 84%]
...........................................s................................................ [ 85%]
....................................................ss.s...............................s.... [ 86%]
............................................................................................ [ 87%]
............s............................................................................... [ 88%]
............................................................................F............... [ 89%]
............................................................................................ [ 89%]
.s.......................................................................................... [ 90%]
............................................................................................ [ 91%]
............................................................................................ [ 92%]
............................................................................................ [ 93%]
............................................................................................ [ 94%]
............................................................................................ [ 95%]
....................................s....................................................... [ 96%]
............................................................................................ [ 97%]
...................................x......x................................................. [ 97%]
...............................................................................x............ [ 98%]
.............................sssssssssssssss.ssssssssssssssssss............................. [ 99%]
............................ [100%]
=========================================================================== FAILURES ============================================================================
_________________________________________________________________ TestExternal.test_c_unit_test _________________________________________________________________
[gw7] linux -- Python 3.8.10 /home/edreamleo/mypy/venv/bin/python3
self = <mypyc.test.test_external.TestExternal testMethod=test_c_unit_test>
@unittest.skipIf(sys.platform.startswith("win"), "rt tests don't work on windows")
def test_c_unit_test(self) -> None:
"""Run C unit tests in a subprocess."""
# Build Google Test, the C++ framework we use for testing C code.
# The source code for Google Test is copied to this repository.
cppflags: List[str] = []
env = os.environ.copy()
if sys.platform == 'darwin':
cppflags += ['-mmacosx-version-min=10.10', '-stdlib=libc++']
env['CPPFLAGS'] = ' '.join(cppflags)
> subprocess.check_call(
['make', 'libgtest.a'],
env=env,
cwd=os.path.join(base_dir, 'mypyc', 'external', 'googletest', 'make'))
mypyc/test/test_external.py:27:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
popenargs = (['make', 'libgtest.a'],)
kwargs = {'cwd': '/home/edreamleo/mypy/mypyc/test/../../mypyc/external/googletest/make', 'env': {'COLORTERM': 'truecolor', 'CPPFLAGS': '', 'DBUS_SESSION_BUS_ADDRESS': 'unix:path=/run/user/1000/bus', 'DESKTOP_SESSION': 'ubuntu', ...}}
retcode = 2, cmd = ['make', 'libgtest.a']
def check_call(*popenargs, **kwargs):
"""Run command with arguments. Wait for command to complete. If
the exit code was zero then return, otherwise raise
CalledProcessError. The CalledProcessError object will have the
return code in the returncode attribute.
The arguments are the same as for the call function. Example:
check_call(["ls", "-l"])
"""
retcode = call(*popenargs, **kwargs)
if retcode:
cmd = kwargs.get("args")
if cmd is None:
cmd = popenargs[0]
> raise CalledProcessError(retcode, cmd)
E subprocess.CalledProcessError: Command '['make', 'libgtest.a']' returned non-zero exit status 2.
/usr/lib/python3.8/subprocess.py:364: CalledProcessError
--------------------------------------------------------------------- Captured stdout call ----------------------------------------------------------------------
g++ -isystem ../include -I.. -g -Wall -Wextra -pthread -fPIC -c \
../src/gtest-all.cc
--------------------------------------------------------------------- Captured stderr call ----------------------------------------------------------------------
make: g++: Command not found
make: *** [Makefile:50: gtest-all.o] Error 127
==================================================================== short test summary info ====================================================================
FAILED mypyc/test/test_external.py::TestExternal::test_c_unit_test - subprocess.CalledProcessError: Command '['make', 'libgtest.a']' returned non-zero exit st...
============================================== 1 failed, 9965 passed, 370 skipped, 9 xfailed in 232.83s (0:03:52) ===============================================
(venv) edreamleo@edreamleo-MS-7D09:~/mypy$ So it looks like g++ must be installed too. Indeed, all tests pass for me after |
I think a helper to try to compile a simple file that includes Python.h in conftest that can be used to skip the mypyc tests makes sense? Unless we think that the mypyc tests should always be run, in which case we can just show a helpful error. |
Bug Report
It appears that there are several missing dependencies in test-requirements.txt, including:
#include <Python.h>
fails. For example:To Reproduce
Rather than including multiple (huge) console logs, I'll summarize. I'll be happy to run any tests that you might want.
Hundreds of tests will fail, complaining either that
x86_64-linux-gnu-gcc
does not exist or thatmake
does not exist.After:
I still get many failures:
346 failed, 9620 passed, 370 skipped, 9 xfailed
,with many tests failing because
#include <Python.h>
fails, as shown above.Expected Behavior
All unit tests pass (in the venv) after installing mypy.
Actual Behavior
See above.
Your Environment
mypy installation:
Environment:
pip list
(outer):(venv) pip list
:I have spent several hours trying various permutations. This report is far from the last word. To repeat, I'll be happy to run any tests that you might want.
The text was updated successfully, but these errors were encountered: