diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2024-06-27 14:37:23 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2024-06-27 14:45:59 +0200 |
commit | 68d2b13a44fffcc72fe8aef88a194f1ed78ef1f2 (patch) | |
tree | 0d03116da18dc2f77888a27c4a1133071b925c8d /build_scripts/utils.py | |
parent | 779f9c929db1c7aae6b4d129fa1618590378179a (diff) |
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 <Shyamnath.Premnadh@qt.io>
Diffstat (limited to 'build_scripts/utils.py')
-rw-r--r-- | build_scripts/utils.py | 7 |
1 files changed, 6 insertions, 1 deletions
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 |