Actually test a debug build
Fixes https://github.com/python/mypy/issues/17819
According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅
Great, of course the tests fail!
It looks like the errors coming from CPython and psutil?
python: Objects/typeobject.c:3129: _PyType_Lookup: Assertion `!PyErr_Occurred()' failed.
...
ImportError: /home/runner/work/mypy/mypy/.tox/py/lib/python3.8/site-packages/psutil/_psutil_linux.abi3.so: undefined symbol: PyModule_Create2
I wonder if the tests would pass on a Python 3.9 debug build (or on an even more recent Python).
The first error is from here: https://github.com/python/cpython/blob/63e54e6d4227e7cbdbb2a0ea69d11a904951f3a9/Objects/typeobject.c#L3129. This likely means we're calling _PyType_Lookup while there is an active exception; most C API functions don't support that.
I don't know what the psutil error is about. My first thought was that the release and debug ABIs were not yet compatible in 3.8, but Victor already made them compatible in 3.8 (https://github.com/python/cpython/commit/f4e4703e746067d6630410408d414b11003334d6). Regardless, it's probably not worth trying to get these tests to pass on 3.8.
According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅
According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅
According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅
According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅
I tried to reproduce the psutil error standalone, but haven't yet been able to. The PyErr_Occurred and LookupError are probably less mysterious. Putting this down for now, will pick it up later.
According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅