@@ -58,61 +58,6 @@ def test_cython(tmp_path):
58
58
srcdir = os .path .join (os .path .dirname (__file__ ), '..' )
59
59
shutil .copytree (srcdir , tmp_path / 'random' )
60
60
build_dir = tmp_path / 'random' / '_examples' / 'cython'
61
- # We don't want a wheel build, so do the steps in a controlled way
62
- # The meson.build file is not copied as part of the build, so generate it
63
- with open (build_dir / "meson.build" , "wt" , encoding = "utf-8" ) as fid :
64
- get_inc = ('import os; os.chdir(".."); import numpy; '
65
- 'print(os.path.abspath(numpy.get_include() + "../../.."))' )
66
- fid .write (textwrap .dedent (f"""\
67
- project('random-build-examples', 'c', 'cpp', 'cython')
68
-
69
- # https://mesonbuild.com/Python-module.html
70
- py_mod = import('python')
71
- py3 = py_mod.find_installation(pure: false)
72
- py3_dep = py3.dependency()
73
-
74
- py_mod = import('python')
75
- py = py_mod.find_installation(pure: false)
76
- cc = meson.get_compiler('c')
77
- cy = meson.get_compiler('cython')
78
-
79
- if not cy.version().version_compare('>=0.29.35')
80
- error('tests requires Cython >= 0.29.35')
81
- endif
82
-
83
- _numpy_abs = run_command(py3, ['-c', '{ get_inc } '],
84
- check: true).stdout().strip()
85
-
86
- npymath_path = _numpy_abs / 'core' / 'lib'
87
- npy_include_path = _numpy_abs / 'core' / 'include'
88
- npyrandom_path = _numpy_abs / 'random' / 'lib'
89
- npymath_lib = cc.find_library('npymath', dirs: npymath_path)
90
- npyrandom_lib = cc.find_library('npyrandom', dirs: npyrandom_path)
91
-
92
- py.extension_module(
93
- 'extending_distributions',
94
- 'extending_distributions.pyx',
95
- install: false,
96
- include_directories: [npy_include_path],
97
- dependencies: [npyrandom_lib, npymath_lib],
98
- )
99
- py.extension_module(
100
- 'extending',
101
- 'extending.pyx',
102
- install: false,
103
- include_directories: [npy_include_path],
104
- dependencies: [npyrandom_lib, npymath_lib],
105
- )
106
- py.extension_module(
107
- 'extending_cpp',
108
- 'extending_distributions.pyx',
109
- install: false,
110
- override_options : ['cython_language=cpp'],
111
- cython_args: ['--module-name', 'extending_cpp'],
112
- include_directories: [npy_include_path],
113
- dependencies: [npyrandom_lib, npymath_lib],
114
- )
115
- """ ))
116
61
target_dir = build_dir / "build"
117
62
os .makedirs (target_dir , exist_ok = True )
118
63
if sys .platform == "win32" :
0 commit comments