File tree Expand file tree Collapse file tree 2 files changed +33
-33
lines changed
Expand file tree Collapse file tree 2 files changed +33
-33
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,39 @@ arrow_dep = dependency(
4343 required : false ,
4444)
4545
46+ # When NumPy 2.0 becomes the minimum we can remove the
47+ # custom location check
48+ numpy_dep = dependency (' numpy' , required : false )
49+ if not numpy_dep.found()
50+ cmd = run_command (
51+ py,
52+ [
53+ ' -c' ,
54+ ''' import os
55+ import numpy as np
56+ try:
57+ # Check if include directory is inside the pyarrow dir
58+ # e.g. a venv created inside the pyarrow dir
59+ # If so, convert it to a relative path
60+ incdir = os.path.relpath(np.get_include())
61+ except Exception:
62+ incdir = np.get_include()
63+ print(incdir)
64+ ''' ,
65+ ],
66+ check : false ,
67+ )
68+
69+ if cmd.returncode() != 0
70+ message (cmd.stdout())
71+ message (cmd.stderr())
72+ error (' Failure with NumPy command' )
73+ endif
74+ numpy_inc = cmd.stdout().strip()
75+
76+ numpy_dep = declare_dependency (include_directories : incdir_numpy)
77+ endif
78+
4679cc = meson .get_compiler(' cpp' )
4780
4881subdir (' pyarrow' )
Original file line number Diff line number Diff line change 1515# specific language governing permissions and limitations
1616# under the License.
1717
18- # When NumPy 2.0 becomes the minimum we can remove the
19- # custom location check
20- numpy_dep = dependency (' numpy' , required : false )
21- if not numpy_dep.found()
22- cmd = run_command (
23- py,
24- [
25- ' -c' ,
26- ''' import os
27- import numpy as np
28- try:
29- # Check if include directory is inside the pyarrow dir
30- # e.g. a venv created inside the pyarrow dir
31- # If so, convert it to a relative path
32- incdir = os.path.relpath(np.get_include())
33- except Exception:
34- incdir = np.get_include()
35- print(incdir)
36- ''' ,
37- ],
38- check : false ,
39- )
40-
41- if cmd.returncode() != 0
42- message (cmd.stdout())
43- message (cmd.stderr())
44- error (' Failure with NumPy command' )
45- endif
46- numpy_inc = cmd.stdout().strip()
47-
48- numpy_dep = declare_dependency (include_directories : incdir_numpy)
49- endif
50-
5118cython_args = [' --include-dir' , meson .current_source_dir()]
5219if get_option (' buildtype' ) in [' debug' , ' debugoptimized' ]
5320 cython_args += [' --gdb' ]
You can’t perform that action at this time.
0 commit comments