From 68d2b13a44fffcc72fe8aef88a194f1ed78ef1f2 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 27 Jun 2024 14:37:23 +0200 Subject: Adapt to numpy 2.0 The include paths have changed in 2.0 Task-number: PYSIDE-2789 Pick-to: 6.7 6.5 6.2 5.15 Change-Id: I052eaba0f8ed6a5d39817fefad5befc42a8ac871 Reviewed-by: Shyamnath Premnadh --- build_scripts/utils.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'build_scripts/utils.py') diff --git a/build_scripts/utils.py b/build_scripts/utils.py index 0aeee256f..5103875b9 100644 --- a/build_scripts/utils.py +++ b/build_scripts/utils.py @@ -72,7 +72,12 @@ def get_numpy_location(): if 'site-' in p: numpy = Path(p).resolve() / 'numpy' if numpy.is_dir(): - return os.fspath(numpy / 'core' / 'include') + candidate = numpy / '_core' / 'include' # Version 2 + if not candidate.is_dir(): + candidate = numpy / 'core' / 'include' # Version 1 + if candidate.is_dir(): + return os.fspath(candidate) + log.warning(f"Cannot find numpy include dir under {numpy}") return None -- cgit v1.2.3