Skip to content

Commit

Permalink
TST: Explicitly pass NumPy path to cython during tests
Browse files Browse the repository at this point in the history
This papers over numpygh-25135, it doesn't fix it, since we are finding
the right NumPy, Cython should be finding the right pyd files also
(whether this is a NumPy or a Cython issue).
  • Loading branch information
seberg committed Nov 14, 2023
1 parent 919fd3a commit 3fc43d3
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions numpy/_core/tests/examples/cython/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ npy_include_path = run_command(py, [
'import os; os.chdir(".."); import numpy; print(os.path.abspath(numpy.get_include()))'
], check: true).stdout().strip()

npy_path = run_command(py, [
'-c',
'import os; os.chdir(".."); import numpy; print(os.path.dirname(numpy.__file__).removesuffix("numpy"))'
], check: true).stdout().strip()

# TODO: This is a hack due to gh-25135, where cython may not find the right
# __init__.pyd file.
add_project_arguments('-I', npy_path, language : 'cython')

py.extension_module(
'checks',
'checks.pyx',
Expand Down

0 comments on commit 3fc43d3

Please sign in to comment.