Skip to content

Commit 72d5647

Browse files
cosminbascatimfel
authored andcommitted
update scipy-1.9.3.patch
- update threadpoolctl-2.2.0.patch
1 parent 8955a8b commit 72d5647

File tree

2 files changed

+96
-18
lines changed

2 files changed

+96
-18
lines changed

graalpython/lib-graalpython/patches/scipy/sdist/scipy-1.9.3.patch

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,102 @@ index 5b4a1d52..c29ec297 100644
1111
'blas=openblas',
1212
'lapack=openblas'
1313
],
14+
diff --git a/pyproject.toml b/pyproject.toml
15+
index 6dc1d407..2d0189ef 100644
16+
--- a/pyproject.toml
17+
+++ b/pyproject.toml
18+
@@ -17,45 +17,7 @@ requires = [
19+
# `wheel` is needed for non-isolated builds, given that `meson-python`
20+
# doesn't list it as a runtime requirement (at least in 0.5.0)
21+
"wheel<0.38.0",
22+
-
23+
- # NumPy dependencies - to update these, sync from
24+
- # https://github.com/scipy/oldest-supported-numpy/, and then
25+
- # update minimum version to match our install_requires min version
26+
- # ----------------------------------------------------------------
27+
-
28+
- # numpy 1.19 was the first minor release to provide aarch64 wheels, but
29+
- # wheels require fixes contained in numpy 1.19.2
30+
- "numpy==1.19.2; python_version=='3.8' and platform_machine=='aarch64' and platform_python_implementation != 'PyPy'",
31+
- # aarch64 for py39 is covered by default requirement below
32+
-
33+
- # arm64 on Darwin supports Python 3.8 and above requires numpy>=1.21.0
34+
- # (first version with arm64 wheels available)
35+
- "numpy==1.21.0; python_version=='3.8' and platform_machine=='arm64' and platform_system=='Darwin'",
36+
- "numpy==1.21.0; python_version=='3.9' and platform_machine=='arm64' and platform_system=='Darwin'",
37+
-
38+
- # loongarch64 requires numpy>=1.22.0
39+
- "numpy==1.22.0; platform_machine=='loongarch64'",
40+
-
41+
- # On Windows we need to avoid 1.21.6, 1.22.0 and 1.22.1 because they were
42+
- # built with vc142. 1.22.3 is the first version that has 32-bit Windows
43+
- # wheels *and* was built with vc141. So use that:
44+
- "numpy==1.22.3; python_version=='3.10' and platform_system=='Windows' and platform_python_implementation != 'PyPy'",
45+
-
46+
- # default numpy requirements
47+
- "numpy==1.18.5; python_version=='3.8' and (platform_machine!='arm64' or platform_system!='Darwin') and platform_machine!='aarch64' and platform_machine!='loongarch64' and platform_python_implementation != 'PyPy'",
48+
- "numpy==1.19.3; python_version=='3.9' and (platform_machine!='arm64' or platform_system!='Darwin') and platform_machine!='loongarch64' and platform_python_implementation != 'PyPy'",
49+
- # Note that 1.21.3 was the first version with a complete set of 3.10 wheels,
50+
- # however macOS was broken and it's safe C API/ABI-wise to build against 1.21.6
51+
- # (see oldest-supported-numpy issues gh-28 and gh-45)
52+
- "numpy==1.21.6; python_version=='3.10' and (platform_system!='Windows' and platform_machine!='loongarch64') and platform_python_implementation != 'PyPy'",
53+
- "numpy==1.23.2; python_version=='3.11' and platform_python_implementation != 'PyPy'",
54+
-
55+
- # For Python versions which aren't yet officially supported,
56+
- # we specify an unpinned NumPy which allows source distributions
57+
- # to be used and allows wheels to be used as soon as they
58+
- # become available.
59+
- "numpy; python_version>='3.12'",
60+
- "numpy; python_version>='3.8' and platform_python_implementation=='PyPy'",
61+
+ "numpy",
62+
]
63+
64+
[project]
65+
diff --git a/scipy/_lib/_ccallback_c.pyx b/scipy/_lib/_ccallback_c.pyx
66+
index 871fb5d3..864656f4 100644
67+
--- a/scipy/_lib/_ccallback_c.pyx
68+
+++ b/scipy/_lib/_ccallback_c.pyx
69+
@@ -210,15 +210,15 @@ cdef double sine(double x, void *user_data) nogil except *:
70+
import ctypes
71+
72+
plus1_t = ctypes.CFUNCTYPE(ctypes.c_double, ctypes.c_double, ctypes.POINTER(ctypes.c_int), ctypes.c_void_p)
73+
-plus1_ctypes = ctypes.cast(<size_t>&plus1_cython, plus1_t)
74+
+# plus1_ctypes = ctypes.cast(<size_t>&plus1_cython, plus1_t)
75+
76+
plus1b_t = ctypes.CFUNCTYPE(ctypes.c_double, ctypes.c_double, ctypes.c_double,
77+
ctypes.POINTER(ctypes.c_int), ctypes.c_void_p)
78+
-plus1b_ctypes = ctypes.cast(<size_t>&plus1b_cython, plus1b_t)
79+
+# plus1b_ctypes = ctypes.cast(<size_t>&plus1b_cython, plus1b_t)
80+
81+
plus1bc_t = ctypes.CFUNCTYPE(ctypes.c_double, ctypes.c_double, ctypes.c_double, ctypes.c_double,
82+
ctypes.POINTER(ctypes.c_int), ctypes.c_void_p)
83+
-plus1bc_ctypes = ctypes.cast(<size_t>&plus1bc_cython, plus1bc_t)
84+
+# plus1bc_ctypes = ctypes.cast(<size_t>&plus1bc_cython, plus1bc_t)
85+
86+
sine_t = ctypes.CFUNCTYPE(ctypes.c_double, ctypes.c_double, ctypes.c_void_p)
87+
-sine_ctypes = ctypes.cast(<size_t>&sine, sine_t)
88+
+# sine_ctypes = ctypes.cast(<size_t>&sine, sine_t)
89+
diff --git a/scipy/_lib/setup.py b/scipy/_lib/setup.py
90+
index 6fca8a66..95000399 100644
91+
--- a/scipy/_lib/setup.py
92+
+++ b/scipy/_lib/setup.py
93+
@@ -55,8 +55,6 @@ def configuration(parent_package='',top_path=None):
94+
# Generate a header file containing defines
95+
config_cmd = config.get_config_cmd()
96+
defines = []
97+
- if config_cmd.check_func('open_memstream', decl=True, call=True):
98+
- defines.append(('HAVE_OPEN_MEMSTREAM', '1'))
99+
target = os.path.join(os.path.dirname(__file__), 'src',
100+
'messagestream_config.h')
101+
with open(target, 'w') as f:
102+
diff --git a/scipy/_lib/src/messagestream_config.h.in b/scipy/_lib/src/messagestream_config.h.in
103+
index fe2a3876..1cdf6c79 100644
104+
--- a/scipy/_lib/src/messagestream_config.h.in
105+
+++ b/scipy/_lib/src/messagestream_config.h.in
106+
@@ -1 +1 @@
107+
-#define HAVE_OPEN_MEMSTREAM @has_openmemstream@
108+
+#define HAVE_OPEN_MEMSTREAM 0 // @has_openmemstream@
109+
\ No newline at end of file
14110
diff --git a/scipy/sparse/linalg/meson.build b/scipy/sparse/linalg/meson.build
15111
index db2f199d..763e1ef6 100644
16112
--- a/scipy/sparse/linalg/meson.build
Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +0,0 @@
1-
diff --git a/threadpoolctl.py b/threadpoolctl.py
2-
index 9386882..b380083 100644
3-
--- a/threadpoolctl.py
4-
+++ b/threadpoolctl.py
5-
@@ -403,10 +403,11 @@ class _ThreadpoolInfo():
6-
c_func_signature = ctypes.CFUNCTYPE(
7-
ctypes.c_int, # Return type
8-
ctypes.POINTER(_dl_phdr_info), ctypes.c_size_t, ctypes.c_char_p)
9-
- c_match_module_callback = c_func_signature(match_module_callback)
10-
+ # callbacks not yet supported
11-
+ # c_match_module_callback = c_func_signature(match_module_callback)
12-
13-
data = ctypes.c_char_p(b"")
14-
- libc.dl_iterate_phdr(c_match_module_callback, data)
15-
+ # libc.dl_iterate_phdr(c_match_module_callback, data)
16-
17-
def _find_modules_with_dyld(self):
18-
"""Loop through loaded libraries and return binders on supported ones

0 commit comments

Comments
 (0)