fixes for numpy regress tests

Daniel Dickman <[email protected]>
Newsgroups gmane.os.openbsd.ports
Message-ID <[email protected]>
While investigating some of the remaining numpy test failures I applied 
these 2 changes locally which help slightly.

The first patch fixes failures where our lack of an strtold_l function 
causes numpy to fallback to strtod which then causes a few regress tests 
to fail. As a local fix I changed the fallback to strtold instead.

The second test seems to have to do with a test for an old glibc. However 
the test doesn't seem to consider the fact that there are non-glibc 
platforms as well.

With this and the local catan/catanf fixes I have for libm I get down to 9 
remaining failures on amd64.

ok?

Index: Makefile
===================================================================
RCS file: /cvs/ports/math/py-numpy/Makefile,v
diff -u -p -u -r1.105 Makefile
--- Makefile	6 Jul 2026 10:40:11 -0000	1.105
+++ Makefile	9 Aug 2026 15:30:18 -0000
@@ -3,6 +3,7 @@ COMMENT=	fast array and numeric programm
 MODPY_DISTV=	2.5.1
 DISTNAME=	numpy-${MODPY_DISTV}
 PKGNAME=	py-${DISTNAME}
+REVISION=	0
 
 CATEGORIES=	math devel
 
Index: patches/patch-numpy__core_src_common_numpyos_c
===================================================================
RCS file: patches/patch-numpy__core_src_common_numpyos_c
diff -N patches/patch-numpy__core_src_common_numpyos_c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-numpy__core_src_common_numpyos_c	9 Aug 2026 15:30:18 -0000
@@ -0,0 +1,16 @@
+use strtold as a fallback on platforms that don't have strtold_l.
+
+fixes a few numpy regress tests
+
+Index: numpy/_core/src/common/numpyos.c
+--- numpy/_core/src/common/numpyos.c.orig
++++ numpy/_core/src/common/numpyos.c
+@@ -601,7 +601,7 @@ NumPyOS_ascii_strtold(const char *s, char** endptr)
+     }
+     return result;
+ #else
+-    return NumPyOS_ascii_strtod(s, endptr);
++    return strtold(s, endptr);
+ #endif
+ }
+ 
Index: patches/patch-numpy_testing__private_utils_py
===================================================================
RCS file: patches/patch-numpy_testing__private_utils_py
diff -N patches/patch-numpy_testing__private_utils_py
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-numpy_testing__private_utils_py	9 Aug 2026 15:30:18 -0000
@@ -0,0 +1,17 @@
+Treat non-glibc platforms the same as old glibc. AVX dispatch
+requires glibc.
+
+fixes failing numpy regress tests
+
+Index: numpy/testing/_private/utils.py
+--- numpy/testing/_private/utils.py.orig
++++ numpy/testing/_private/utils.py
+@@ -2804,7 +2804,7 @@ def _get_glibc_version():
+ 
+ 
+ _glibcver = _get_glibc_version()
+-_glibc_older_than = lambda x: (_glibcver != '0.0' and _glibcver < x)
++_glibc_older_than = lambda x: (_glibcver == '0.0' or _glibcver < x)
+ 
+ 
+ def run_threaded(func, max_workers=8, pass_count=False,
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.