File: 0005-Fix-numpy-header-detection.patch

package info (click to toggle)
pyside6 6.8.2.1-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, trixie
  • size: 45,424 kB
  • sloc: python: 201,635; cpp: 87,447; xml: 18,629; javascript: 1,182; ansic: 178; sh: 163; makefile: 87
file content (34 lines) | stat: -rw-r--r-- 1,187 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
From: Stuart Prescott <stuart@debian.org>
Date: Sun, 16 Feb 2025 01:27:09 +1100
Subject: Fix numpy header detection

Existing code makes assumptions about site-packages/dist-packages
and fails to find the headers; numpy has an explicit function for this
---
 build_scripts/utils.py | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/build_scripts/utils.py b/build_scripts/utils.py
index 29f2545..d5c1063 100644
--- a/build_scripts/utils.py
+++ b/build_scripts/utils.py
@@ -77,17 +77,8 @@ def update_env_path(newpaths):
 
 
 def get_numpy_location():
-    for p in sys.path:
-        if 'site-' in p:
-            numpy = Path(p).resolve() / 'numpy'
-            if numpy.is_dir():
-                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
+    import numpy
+    return numpy.get_include()
 
 
 def platform_cmake_options(as_tuple_list=False):