Closed neutrinoceros closed 8 months ago
I also updated the minimal requirement for numpy to sync it with python-requires
: NumPy 1.19.3
was the first version to support Python 3.9, which is the current minimal requirement.
Your suggestion sounds good to me. However, there are still some issues in building the wheels in CI:
numexpr/interpreter.cpp:1206:28: error: ‘PyArray_Descr’ {aka ‘struct _PyArray_Descr’} has no member named ‘elsize’
1206 | dtypes[0]->elsize = (int)self->memsizes[1];
| ^~~~~~
numexpr/interpreter.cpp:1452:44: error: ‘PyArray_Descr’ {aka ‘struct _PyArray_Descr’} has no member named ‘elsize’
1452 | self->memsizes[i] = dtypes_tmp[i]->elsize;
| ^~~~~~
Oh, I didn't see this when I tested locally, but luckilly I already had to deal with this exact change in a different package downstream of NumPy ! I should be able to fix this quickly.
I was able to reproduce the crash locally when I switched from Python 3.12 to 3.9, and I just pushed a fix. For reference, this corresponds to an intentional change in NumPy 2.0's C API, xref https://github.com/numpy/numpy/pull/25943
LGTM. Thanks @neutrinoceros !
This was included in numexpr 2.10, right? However I see an import failure of numexpr claiming it wasn't compiled against numpy 2.0 here:
https://github.com/PyTables/PyTables/actions/runs/8734526298/job/23965425971?pr=1160#step:7:13
Any idea? Or am I misreadig this and it's not actually numexpr?
It was indeed included in 2.10
Grepping your example logs for numexpr
, I see that version 2.8.7 is used
Requirement already satisfied: numexpr>=2.6.2 in /usr/share/miniconda/envs/test/lib/python3.12/site-packages (from tables==3.9.3.dev0) (2.8.7)
so I think a different dependency may be adding constraints which prevent 2.10 from being installed.
I would recommend running pip list
or some variation of it in CI between installation and tests, so it's easier to figure this stuff out :)
Thanks! I saw 2.10 but that was only in the isolated wheel build environment, indeed in the actual runtime environment, the old version was installed.
I noticed while testing a downstream package that the following
ImportError
was raised from NumPy 2.0.0rc1 pointing to numexpr:Traceback
```python-traceback A module that was compiled using NumPy 1.x cannot be run in NumPy 2.1.0.dev0 as it may crash. To support both 1.x and 2.x versions of NumPy, modules must be compiled with NumPy 2.0. Some module may need to rebuild instead e.g. with 'pybind11>=2.12'. If you are a user of the module, the easiest solution will be to downgrade to 'numpy<2' or try to upgrade the affected module. We expect that some modules will need time to support NumPy 2. Traceback (most recent call last): File "/opt/hostedtoolcache/Python/3.12.2/x64/bin/pytest", line 8, inFor more context:
oldest-supported-numpy
is superseded by NumPy itself since version 1.25.0It is recommended by NumPy developers to plan releases of packages with Python extensions a some point between 2.0.0rc1 and 2.0.0 (final), which from the looks of it should be a couple months from now.