diff options
author | Matti Picus <matti.picus@gmail.com> | 2023-01-30 19:21:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-30 19:21:51 +0200 |
commit | 9d2c0197b1b7171be722c9cb2642e438c472edcc (patch) | |
tree | 592b966d7fdf415a5ff727eac075da1fe94d8b69 /numpy/f2py | |
parent | 243c42e5d2ede60fd07d5df126ace216683d4783 (diff) | |
parent | 2293a623b9deebdd284336e223ac175a7baa77b0 (diff) | |
download | numpy-9d2c0197b1b7171be722c9cb2642e438c472edcc.tar.gz |
Merge pull request #23073 from DWesl/patch-2
CI: Rebase NumPy compiled extension test modules on Cygwin
Diffstat (limited to 'numpy/f2py')
-rw-r--r-- | numpy/f2py/tests/util.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/numpy/f2py/tests/util.py b/numpy/f2py/tests/util.py index 1534c4e7d..26fa7e49d 100644 --- a/numpy/f2py/tests/util.py +++ b/numpy/f2py/tests/util.py @@ -6,6 +6,7 @@ Utility functions for - determining paths to tests """ +import glob import os import sys import subprocess @@ -30,6 +31,10 @@ from importlib import import_module _module_dir = None _module_num = 5403 +if sys.platform == "cygwin": + NUMPY_INSTALL_ROOT = Path(__file__).parent.parent.parent + _module_list = list(NUMPY_INSTALL_ROOT.glob("**/*.dll")) + def _cleanup(): global _module_dir @@ -147,6 +152,21 @@ def build_module(source_files, options=[], skip=[], only=[], module_name=None): for fn in dst_sources: os.unlink(fn) + # Rebase (Cygwin-only) + if sys.platform == "cygwin": + # If someone starts deleting modules after import, this will + # need to change to record how big each module is, rather than + # relying on rebase being able to find that from the files. + _module_list.extend( + glob.glob(os.path.join(d, "{:s}*".format(module_name))) + ) + subprocess.check_call( + ["/usr/bin/rebase", "--database", "--oblivious", "--verbose"] + + _module_list + ) + + + # Import return import_module(module_name) |