mypy icon indicating copy to clipboard operation
mypy copied to clipboard

Actually test a debug build

Open hauntsaninja opened this issue 1 year ago • 10 comments

Fixes https://github.com/python/mypy/issues/17819

hauntsaninja avatar Sep 25 '24 07:09 hauntsaninja

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

github-actions[bot] avatar Sep 25 '24 07:09 github-actions[bot]

Great, of course the tests fail!

hauntsaninja avatar Sep 25 '24 07:09 hauntsaninja

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).

JukkaL avatar Sep 25 '24 09:09 JukkaL

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.

JelleZijlstra avatar Sep 25 '24 13:09 JelleZijlstra

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

github-actions[bot] avatar Sep 26 '24 01:09 github-actions[bot]

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

github-actions[bot] avatar Sep 26 '24 01:09 github-actions[bot]

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

github-actions[bot] avatar Sep 26 '24 02:09 github-actions[bot]

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

github-actions[bot] avatar Sep 26 '24 03:09 github-actions[bot]

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.

hauntsaninja avatar Sep 26 '24 03:09 hauntsaninja

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

github-actions[bot] avatar Oct 11 '24 03:10 github-actions[bot]