Skip to content

Commit 8219167

Browse files
authored
Merge pull request #2147 from sycloid/fix-test-cython-api
Add project root folder to include_dirs in _cython_api setup script
2 parents 33069cb + b03ce57 commit 8219167

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

dpctl/tests/setup_cython_api.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,26 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17+
import os.path
18+
1719
import setuptools
1820
from Cython.Build import build_ext
1921

2022
import dpctl
2123

24+
25+
def get_includes():
26+
# path to dpctl/include
27+
dpctl_incl_dir = dpctl.get_include()
28+
# path to folder where __init__.pxd resides
29+
dpctl_pxd_dir = os.path.dirname(os.path.dirname(dpctl_incl_dir))
30+
return [dpctl_incl_dir, dpctl_pxd_dir]
31+
32+
2233
ext = setuptools.Extension(
2334
"_cython_api",
2435
["_cython_api.pyx"],
25-
include_dirs=[dpctl.get_include()],
36+
include_dirs=get_includes(),
2637
language="c++",
2738
)
2839

0 commit comments

Comments
 (0)