From b03ce57d32f5cafe1eaa18e1d99943ac1e54b2a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?SYCLo=C3=AFd?= <213797226+sycloid@users.noreply.github.com> Date: Sat, 13 Sep 2025 16:13:54 -0500 Subject: [PATCH] Add project root folder to include_dirs in _cython_api setup script Add project root folder to include_dirs in the setup_cython_api.py so that Cython can find dpctl/__init__.pxd This resolves gh-2146 for me locally with Cython 3.1.3 --- dpctl/tests/setup_cython_api.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/dpctl/tests/setup_cython_api.py b/dpctl/tests/setup_cython_api.py index 41f71f0bd7..d4f7c00f5c 100644 --- a/dpctl/tests/setup_cython_api.py +++ b/dpctl/tests/setup_cython_api.py @@ -14,15 +14,26 @@ # See the License for the specific language governing permissions and # limitations under the License. +import os.path + import setuptools from Cython.Build import build_ext import dpctl + +def get_includes(): + # path to dpctl/include + dpctl_incl_dir = dpctl.get_include() + # path to folder where __init__.pxd resides + dpctl_pxd_dir = os.path.dirname(os.path.dirname(dpctl_incl_dir)) + return [dpctl_incl_dir, dpctl_pxd_dir] + + ext = setuptools.Extension( "_cython_api", ["_cython_api.pyx"], - include_dirs=[dpctl.get_include()], + include_dirs=get_includes(), language="c++", )