GeezerVison is showing github.com — fixes from review · numpy/numpy@43c32e6
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboard +45Lines changed: 45 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +project('random-build-examples', 'c', 'cpp', 'cython') | | 2 | + | | 3 | +py_mod = import('python') | | 4 | +py3 = py_mod.find_installation(pure: false) | | 5 | + | | 6 | +cc = meson.get_compiler('c') | | 7 | +cy = meson.get_compiler('cython') | | 8 | + | | 9 | +if not cy.version().version_compare('>=0.29.35') | | 10 | + error('tests requires Cython >= 0.29.35') | | 11 | +endif | | 12 | + | | 13 | +_numpy_abs = run_command(py3, ['-c', | | 14 | + 'import os; os.chdir(".."); import numpy; print(os.path.abspath(numpy.get_include() + "../../.."))'], | | 15 | + check: true).stdout().strip() | | 16 | + | | 17 | +npymath_path = _numpy_abs / 'core' / 'lib' | | 18 | +npy_include_path = _numpy_abs / 'core' / 'include' | | 19 | +npyrandom_path = _numpy_abs / 'random' / 'lib' | | 20 | +npymath_lib = cc.find_library('npymath', dirs: npymath_path) | | 21 | +npyrandom_lib = cc.find_library('npyrandom', dirs: npyrandom_path) | | 22 | + | | 23 | +py3.extension_module( | | 24 | + 'extending_distributions', | | 25 | + 'extending_distributions.pyx', | | 26 | + install: false, | | 27 | + include_directories: [npy_include_path], | | 28 | + dependencies: [npyrandom_lib, npymath_lib], | | 29 | +) | | 30 | +py3.extension_module( | | 31 | + 'extending', | | 32 | + 'extending.pyx', | | 33 | + install: false, | | 34 | + include_directories: [npy_include_path], | | 35 | + dependencies: [npyrandom_lib, npymath_lib], | | 36 | +) | | 37 | +py3.extension_module( | | 38 | + 'extending_cpp', | | 39 | + 'extending_distributions.pyx', | | 40 | + install: false, | | 41 | + override_options : ['cython_language=cpp'], | | 42 | + cython_args: ['--module-name', 'extending_cpp'], | | 43 | + include_directories: [npy_include_path], | | 44 | + dependencies: [npyrandom_lib, npymath_lib], | | 45 | +) |
Collapse file Copy file name to clipboardExpand all lines: numpy/random/_examples/cython/setup.py -46Lines changed: 0 additions & 46 deletions Collapse file Copy file name to clipboardExpand all lines: numpy/random/meson.build +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -152,7 +152,7 @@ py.install_sources( | 152 | 152 | [ | 153 | 153 | '_examples/cython/extending.pyx', | 154 | 154 | '_examples/cython/extending_distributions.pyx', | 155 | | - '_examples/cython/setup.py', | | 155 | + '_examples/cython/meson.build', | 156 | 156 | ], | 157 | 157 | subdir: 'numpy/random/_examples/cython' | 158 | 158 | ) | |
Collapse file Copy file name to clipboardExpand all lines: numpy/random/tests/test_extending.py -55Lines changed: 0 additions & 55 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -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": | |
Collapse file Copy file name to clipboardExpand all lines: tools/travis-test.sh +1-5Lines changed: 1 addition & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -80,11 +80,7 @@ setup_base() | 80 | 80 |
| 81 | 81 | run_test() | 82 | 82 | { | 83 | | - # meson has a hard dependency on ninja, and we need meson to build | 84 | | - # c-extensions in tests. There is a hack ninja PyPI package used in | 85 | | - # build_requirements.txt for macOS, windows, linux but it cannot be in | 86 | | - # test_requirements.txt since pyodide, which uses test_requirements.txt, does | 87 | | - # not have it. | | 83 | + # see note in pyproject.toml for why ninja is installed as a test requirement | 88 | 84 | PYTHONOPTIMIZE="" $PIP install ninja | 89 | 85 |
| 90 | 86 | # Install the test dependencies. | |
|