Files
gentoo/dev-python/pyopencl/files/pyopencl-2023.1.2_numpy-include-dir.patch
Marek Szuba 85d4a5c8f4 dev-python/pyopencl: add 2023.1.2
Now with py3.12 support thanks to a patch which uses the canonical NumPy
way of getting the location of its header files instead of messing with
imp.find_module(). Upstream said in the relevant file they did it that
way because importing numpy "screws up distutils", however either this
is no longer the case with the current versions of everything involved
or PEP-517 installation is not affected.

Signed-off-by: Marek Szuba <marecki@gentoo.org>
2023-08-20 17:50:38 +01:00

17 lines
409 B
Diff

--- a/aksetup_helper.py
+++ b/aksetup_helper.py
@@ -43,11 +43,8 @@
def get_numpy_incpath():
- from imp import find_module
- # avoid actually importing numpy, it screws up distutils
- file, pathname, descr = find_module("numpy")
- from os.path import join
- return join(pathname, "core", "include")
+ import numpy as np
+ return np.get_include()
class NumpyExtension(Extension):