forked from numpy/numpy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TST: convert cython test from setup.py to meson (numpy#24206)
The limited-api test has to wait for a new Meson version (see numpygh-24206). This converts the regular Cython test for `numpy.core`. [skip ci]
- Loading branch information
Showing
2 changed files
with
48 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
project('checks', 'c', 'cython') | ||
|
||
py = import('python').find_installation(pure: false) | ||
|
||
cc = meson.get_compiler('c') | ||
cy = meson.get_compiler('cython') | ||
|
||
if not cy.version().version_compare('>=0.29.35') | ||
error('tests requires Cython >= 0.29.35') | ||
endif | ||
|
||
npy_include_path = run_command(py, [ | ||
'-c', | ||
'import os; os.chdir(".."); import numpy; print(os.path.abspath(numpy.get_include()))' | ||
], check: true).stdout().strip() | ||
|
||
py.extension_module( | ||
'checks', | ||
'checks.pyx', | ||
install: false, | ||
c_args: [ | ||
'-DNPY_NO_DEPRECATED_API=0', # Cython still uses old NumPy C API | ||
# Require 1.25+ to test datetime additions | ||
'-DNPY_TARGET_VERSION=NPY_2_0_API_VERSION', | ||
], | ||
include_directories: [npy_include_path], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters