From b35f5fcbd8447cb36268d0d344c8ef65b1912187 Mon Sep 17 00:00:00 2001 From: Sebastian Berg Date: Wed, 8 May 2024 15:31:04 +0200 Subject: [PATCH] MAINT: Allow building with NumPy 1.x locally I have build locally without build isolation and it seems to work fine. --- numexpr/interpreter.cpp | 6 ++++++ 1 file changed, 6 insertions(+) Index: numexpr-2.10.0/numexpr/interpreter.cpp =================================================================== --- numexpr-2.10.0.orig/numexpr/interpreter.cpp +++ numexpr-2.10.0/numexpr/interpreter.cpp @@ -47,6 +47,12 @@ #define AVAILABLE(Haystack, Haystack_Len, J, Needle_Len) \ ((Haystack_Len) >= (J) + (Needle_Len)) +// To allow building with NumPy<2 locally define the new NumPy macros: +#if NPY_ABI_VERSION < 0x02000000 + #define PyDataType_ELSIZE(descr) ((descr)->elsize) + #define PyDataType_SET_ELSIZE(descr, size) (descr)->elsize = size +#endif + #include "str-two-way.hpp" #ifdef DEBUG