Skip to content

Commit aec4daf

Browse files
authored
BLD: Fix compiling pandas with a venv located in the src dir (#53489)
1 parent 99bebeb commit aec4daf

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

pandas/meson.build

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
11
incdir_numpy = run_command(py,
22
[
33
'-c',
4-
'import os; os.chdir(".."); import numpy; print(numpy.get_include())'
4+
'''
5+
import os
6+
import numpy as np
7+
try:
8+
# Check if include directory is inside the pandas dir
9+
# e.g. a venv created inside the pandas dir
10+
# If so, convert it to a relative path
11+
incdir = os.path.relpath(np.get_include())
12+
except Exception:
13+
incdir = np.get_include()
14+
print(incdir)
15+
'''
516
],
617
check: true
718
).stdout().strip()

0 commit comments

Comments
 (0)