From 704076e8b14427775180ac4d7f008ab5a057b2f2 Mon Sep 17 00:00:00 2001 From: Thomas Li <47963215+lithomas1@users.noreply.github.com> Date: Thu, 1 Jun 2023 11:01:50 -0700 Subject: [PATCH] BLD: Fix compiling pandas with a venv located in the src dir --- pandas/meson.build | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pandas/meson.build b/pandas/meson.build index ab84fd688b762..1dc9955aa4ff6 100644 --- a/pandas/meson.build +++ b/pandas/meson.build @@ -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() +print(incdir) + ''' ], check: true ).stdout().strip()