Skip to content

Commit 07848e9

Browse files
authored
Revert numpy version to 2.2.5 until we update Scipy (#382)
1 parent 9a2e919 commit 07848e9

File tree

3 files changed

+78
-7
lines changed

3 files changed

+78
-7
lines changed

packages/numpy-tests/meta.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
package:
22
name: numpy-tests
3-
version: 2.3.1
3+
version: 2.2.5
44
tag:
55
- min-scipy-stack
66
top-level:
77
- numpy
88
# NOTE: keep in sync with numpy/meta.yaml
99
source:
10-
path: ../numpy/build/numpy-2.3.1
10+
path: ../numpy/build/numpy-2.2.5
1111

1212
build:
1313
unvendor-tests: false # we do this on our own using Meson's install tags

packages/numpy/meta.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
# NOTE: keep the name, version, and other fields in sync with source/path in numpy-tests/meta.yaml.
21
package:
32
name: numpy
4-
version: 2.3.1
3+
version: 2.2.5
54
tag:
65
- min-scipy-stack
76
top-level:
87
- numpy
98
source:
10-
url: https://files.pythonhosted.org/packages/source/n/numpy/numpy-2.3.1.tar.gz
11-
sha256: 1ec9ae20a4226da374362cca3c62cd753faf2f951440b0e3b98e93c235441d2b
9+
url: https://files.pythonhosted.org/packages/source/n/numpy/numpy-2.2.5.tar.gz
10+
sha256: a9c0d994680cd991b1cb772e8b297340085466a6fe964bc9d4e80f5e2f43c291
11+
patches:
12+
- patches/0001-TST-Prevent-import-error-when-tests-are-not-included.patch
1213

1314
build:
1415
unvendor-tests: false # we do this on our own using Meson's install tags
@@ -17,7 +18,6 @@ build:
1718
setup-args=-Dallow-noblas=true
1819
setup-args=--cross-file=${MESON_CROSS_FILE}
1920
install-args=--tags=runtime,python-runtime,devel
20-
build-dir=build
2121
# numpy creates numpy/distutils/__pycache__ directory during the build.
2222
# It breaks our test because there is a .pyc in the directory.
2323
post: |
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
From 8b298aa6f666449fff1844253cd6e0be5fbf3612 Mon Sep 17 00:00:00 2001
2+
From: ryanking13 <[email protected]>
3+
Date: Sun, 11 May 2025 11:05:05 +0900
4+
Subject: [PATCH 1/1] TST: Prevent import error when tests are not included in
5+
6+
https://github.com/numpy/numpy/pull/28936
7+
8+
---
9+
numpy/_core/tests/_natype.py | 7 +++++++
10+
numpy/conftest.py | 4 ++--
11+
numpy/testing/_private/utils.py | 9 ---------
12+
3 files changed, 9 insertions(+), 11 deletions(-)
13+
14+
diff --git a/numpy/_core/tests/_natype.py b/numpy/_core/tests/_natype.py
15+
index e529e548cf..86eb68801d 100644
16+
--- a/numpy/_core/tests/_natype.py
17+
+++ b/numpy/_core/tests/_natype.py
18+
@@ -196,3 +196,10 @@ def __array_ufunc__(self, ufunc, method, *inputs, **kwargs):
19+
20+
21+
pd_NA = NAType()
22+
+
23+
+def get_stringdtype_dtype(na_object, coerce=True):
24+
+ # explicit is check for pd_NA because != with pd_NA returns pd_NA
25+
+ if na_object is pd_NA or na_object != "unset":
26+
+ return np.dtypes.StringDType(na_object=na_object, coerce=coerce)
27+
+ else:
28+
+ return np.dtypes.StringDType(coerce=coerce)
29+
\ No newline at end of file
30+
diff --git a/numpy/conftest.py b/numpy/conftest.py
31+
index 0eb42d1103..5105b43b03 100644
32+
--- a/numpy/conftest.py
33+
+++ b/numpy/conftest.py
34+
@@ -14,8 +14,8 @@
35+
import numpy as np
36+
37+
from numpy._core._multiarray_tests import get_fpu_mode
38+
-from numpy._core.tests._natype import pd_NA
39+
-from numpy.testing._private.utils import NOGIL_BUILD, get_stringdtype_dtype
40+
+from numpy._core.tests._natype import pd_NA, get_stringdtype_dtype
41+
+from numpy.testing._private.utils import NOGIL_BUILD
42+
43+
try:
44+
from scipy_doctest.conftest import dt_config
45+
diff --git a/numpy/testing/_private/utils.py b/numpy/testing/_private/utils.py
46+
index 42e43e21f3..a1a6f4f1ff 100644
47+
--- a/numpy/testing/_private/utils.py
48+
+++ b/numpy/testing/_private/utils.py
49+
@@ -28,7 +28,6 @@
50+
from numpy import isfinite, isnan, isinf
51+
import numpy.linalg._umath_linalg
52+
from numpy._utils import _rename_parameter
53+
-from numpy._core.tests._natype import pd_NA
54+
55+
from io import StringIO
56+
57+
@@ -2750,11 +2749,3 @@ def run_threaded(func, max_workers=8, pass_count=False,
58+
barrier.abort()
59+
for f in futures:
60+
f.result()
61+
-
62+
-
63+
-def get_stringdtype_dtype(na_object, coerce=True):
64+
- # explicit is check for pd_NA because != with pd_NA returns pd_NA
65+
- if na_object is pd_NA or na_object != "unset":
66+
- return np.dtypes.StringDType(na_object=na_object, coerce=coerce)
67+
- else:
68+
- return np.dtypes.StringDType(coerce=coerce)
69+
--
70+
2.29.2.windows.2
71+

0 commit comments

Comments
 (0)