GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — BLD, TST: refactor test to use meson not setup.py, improve spin test -m ... by mattip · Pull Request #24153 · numpy/numpy

BLD, TST: refactor test to use meson not setup.py, improve spin test -m ... #24153

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Sign up for GitHub

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
rgommers merged 7 commits into numpy:main from mattip:cpp-random
Jul 14, 2023

Uh oh!

There was an error while loading. Please reload this page.

Merged

BLD, TST: refactor test to use meson not setup.py, improve spin test -m ... #24153

Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit Hold shift + click to select a range
dac0135
BLD: add spin -m full and document it
mattip Jul 10, 2023
2e00441
refactor test_extending to use meson
mattip Jul 10, 2023
0a14016
TST: refactor testing/extbuild to use meson on-the-fly
mattip Jul 11, 2023
e290d1c
TST: fix: using meson with windows, MSVC
mattip Jul 11, 2023
bedeacf
TST: refactor to add a cython build that uses cpp
mattip Jul 12, 2023
9236be9
TST: work around pyodide and ninja
mattip Jul 13, 2023
43c32e6
fixes from review
mattip Jul 14, 2023
File filter
Filter by extension


Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view
Prev Previous commit
Next Next commit
TST: refactor to add a cython build that uses cpp
  • Loading branch information

Uh oh!

There was an error while loading. Please reload this page.

@mattip
mattip committed Jul 13, 2023
commit bedeacfc1b5cd1795609ed71d3aed51e9ef1811a

There are no files selected for viewing

1 change: 1 addition & 0 deletions 1 .github/workflows/emscripten.yml
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ jobs:
pyodide venv .venv-pyodide
source .venv-pyodide/bin/activate
pip install dist/*.whl
python -c "import sys; print(sys.platform)"
pip install -r test_requirements.txt
- name: Test
run: |
Expand Down
29 changes: 21 additions & 8 deletions 29 numpy/random/tests/test_extending.py
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,15 @@ def test_cython(tmp_path):
include_directories: [npy_include_path],
dependencies: [npyrandom_lib, npymath_lib],
)
py.extension_module(
'extending_cpp',
'extending_distributions.pyx',
install: false,
override_options : ['cython_language=cpp'],
cython_args: ['--module-name', 'extending_cpp'],
include_directories: [npy_include_path],
dependencies: [npyrandom_lib, npymath_lib],
)
"""))
target_dir = build_dir / "build"
os.makedirs(target_dir, exist_ok=True)
Expand Down Expand Up @@ -132,15 +141,19 @@ def test_cython(tmp_path):
"wrong pxd used".format(txt_to_find))
# import without adding the directory to sys.path
suffix = sysconfig.get_config_var('EXT_SUFFIX')
so1 = (target_dir / "extending").with_suffix(suffix)
so2 = (target_dir / "extending_distributions").with_suffix(suffix)
spec1 = spec_from_file_location("extending", so1)
spec2 = spec_from_file_location("extending_distributions", so2)
extending = module_from_spec(spec1)
spec1.loader.exec_module(extending)
extending_distributions = module_from_spec(spec2)
spec2.loader.exec_module(extending_distributions)

def load(modname):
so = (target_dir / modname).with_suffix(suffix)
spec = spec_from_file_location(modname, so)
mod = module_from_spec(spec)
spec.loader.exec_module(mod)
return mod

# test that the module can be imported
load("extending")
load("extending_cpp")
# actually test the cython c-extension
extending_distributions = load("extending_distributions")
from numpy.random import PCG64
values = extending_distributions.uniforms_ex(PCG64(0), 10, 'd')
assert values.shape == (10,)
Expand Down
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.