Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion pandas/meson.build
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
incdir_numpy = run_command(py,
[
'-c',
'import os; os.chdir(".."); import numpy; print(numpy.get_include())'
'''
import os
import numpy as np
try:
# Check if include directory is inside the pandas dir
# e.g. a venv created inside the pandas dir
# If so, convert it to a relative path
incdir = os.path.relpath(np.get_include())
except Exception:
incdir = np.get_include()
Comment on lines +7 to +13
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wondering if you're expecting relpath to raise if the path is not a subdirectory. It doesn't:

import os

print(os.getcwd())
# /home/richard/dev
print(os.path.relpath('/home/richard/dev'))
# '.'
print(os.path.relpath('/home/richard/dev/pandas'))
# pandas
print(os.path.relpath('/home/richard'))
# ..

print(incdir)
'''
],
check: true
).stdout().strip()
Expand Down