FAILED numpy/core/tests/test_cython.py::test_conv_intp - TypeError: 'float' object cannot be interpreted as an integer
========================================================= test session starts =========================================================
platform linux -- Python 3.11.6, pytest-7.4.0, pluggy-1.3.0
rootdir: /tmp/numpy
configfile: pytest.ini
plugins: hypothesis-6.81.1, xdist-3.4.0, cov-4.1.0
collected 1 item
numpy/core/tests/test_cython.py F [100%]
============================================================== FAILURES ===============================================================
___________________________________________________________ test_conv_intp ____________________________________________________________
install_temp = None
def test_conv_intp(install_temp):
import checks
class myint:
def __int__(self):
return 3
# These conversion passes via `__int__`, not `__index__`:
> assert checks.conv_intp(3.) == 3
checks = <module 'checks' from '/tmp/pytest-of-mgorny/pytest-5/test_conv_intp0/build/checks.cpython-311-x86_64-linux-gnu.so'>
install_temp = None
myint = <class 'numpy.core.tests.test_cython.test_conv_intp.<locals>.myint'>
numpy/core/tests/test_cython.py:134:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> ???
E TypeError: 'float' object cannot be interpreted as an integer
checks.pyx:34: TypeError
-------------------------------------------------------- Captured stdout setup --------------------------------------------------------
1.2.3
The Meson build system
Version: 1.2.3
Source dir: /tmp/numpy/numpy/core/tests/examples/cython
Build dir: /tmp/pytest-of-mgorny/pytest-5/test_conv_intp0/build
Build type: native build
Project name: checks
Project version: undefined
C compiler for the host machine: ccache cc (gcc 13.2.1 "cc (Gentoo 13.2.1_p20231014 p8) 13.2.1 20231014")
C linker for the host machine: cc ld.bfd 2.41
Cython compiler for the host machine: cython (cython 3.0.5)
Host machine cpu family: x86_64
Host machine cpu: x86_64
Program python3 found: YES (/tmp/numpy/.venv/bin/python3.11)
Found pkg-config: /usr/bin/pkg-config (2.0.3)
Run-time dependency python found: YES 3.11
Build targets in project: 1
Found ninja-1.11.1 at /usr/bin/ninja
[1/3] cython -M --fast-fail -3 /tmp/numpy/numpy/core/tests/examples/cython/checks.pyx -o checks.cpython-311-x86_64-linux-gnu.so.p/checks.pyx.c
[2/3] ccache cc -Ichecks.cpython-311-x86_64-linux-gnu.so.p -I. -I../../../../numpy/numpy/core/tests/examples/cython -I/tmp/numpy/numpy/core/include -I/usr/include/python3.11 -fvisibility=hidden -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -w -O0 -g -fPIC -DNPY_NO_DEPRECATED_API=0 -DNPY_TARGET_VERSION=NPY_2_0_API_VERSION -MD -MQ checks.cpython-311-x86_64-linux-gnu.so.p/meson-generated_checks.pyx.c.o -MF checks.cpython-311-x86_64-linux-gnu.so.p/meson-generated_checks.pyx.c.o.d -o checks.cpython-311-x86_64-linux-gnu.so.p/meson-generated_checks.pyx.c.o -c checks.cpython-311-x86_64-linux-gnu.so.p/checks.pyx.c
[3/3] cc -o checks.cpython-311-x86_64-linux-gnu.so checks.cpython-311-x86_64-linux-gnu.so.p/meson-generated_checks.pyx.c.o -Wl,--as-needed -Wl,--allow-shlib-undefined -shared -fPIC
INFO: autodetecting backend as ninja
INFO: calculating backend command to run: /usr/bin/ninja -v
======================================================= short test summary info =======================================================
FAILED numpy/core/tests/test_cython.py::test_conv_intp - TypeError: 'float' object cannot be interpreted as an integer
========================================================== 1 failed in 8.36s ==========================================================
1.26.3
3.11.6 (main, Oct 26 2023, 14:30:39) [GCC 13.2.1 20231014]
WARNING: `threadpoolctl` not found in system! Install it by `pip install threadpoolctl`. Once installed, try `np.show_runtime` again for more detailed build information
[{'numpy_version': '1.26.3',
'python': '3.11.6 (main, Oct 26 2023, 14:30:39) [GCC 13.2.1 20231014]',
'uname': uname_result(system='Linux', node='pomiot', release='6.6.1-gentoo-dist', version='#1 SMP PREEMPT_DYNAMIC Fri Nov 10 16:04:08 -00 2023', machine='x86_64')},
{'simd_extensions': {'baseline': ['SSE', 'SSE2', 'SSE3'],
'found': ['SSSE3',
'SSE41',
'POPCNT',
'SSE42',
'AVX',
'F16C',
'FMA3',
'AVX2'],
'not_found': ['AVX512F',
'AVX512CD',
'AVX512_KNL',
'AVX512_KNM',
'AVX512_SKX',
'AVX512_CLX',
'AVX512_CNL',
'AVX512_ICL',
'AVX512_SPR']}}]
None
Describe the issue:
The 1.26.2 introduced a new test failure:
Full log below. I've used
maintenance/1.26.xbranch as of 4962e22 (which is equivalent to 1.26.2, except for the version number).Reproduce the code example:
Error message:
Runtime information:
Context for the issue:
No response