Skip to content

Commit 5b992b3

Browse files
committed
GR-43511: numpy - cythonize in process
1 parent 6fd6ff7 commit 5b992b3

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

graalpython/lib-graalpython/patches/numpy/sdist/numpy-1.23.5.patch

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -782,3 +782,30 @@ index 3aa7504..6ab7210 100755
782782
entry_points={
783783
'console_scripts': f2py_cmds,
784784
'array_api': ['numpy = numpy.array_api'],
785+
diff --git a/tools/cythonize.py b/tools/cythonize.py
786+
index 002b2fa..367ec0a 100755
787+
--- a/tools/cythonize.py
788+
+++ b/tools/cythonize.py
789+
@@ -48,10 +48,19 @@ def process_pyx(fromfile, tofile):
790+
if tofile.endswith('.cxx'):
791+
flags.append('--cplus')
792+
793+
- subprocess.check_call(
794+
- [sys.executable, '-m', 'cython'] + flags + ["-o", tofile, fromfile])
795+
-
796+
+ # subprocess.check_call(
797+
+ # [sys.executable, '-m', 'cython'] + flags + ["-o", tofile, fromfile])
798+
799+
+ from Cython.Compiler.Main import setuptools_main
800+
+ prev_argv = sys.argv[1:]
801+
+ try:
802+
+ sys.argv[1:] = flags + ["-o", tofile, fromfile]
803+
+ retcode = setuptools_main()
804+
+ if retcode:
805+
+ sys.exit(retcode)
806+
+ finally:
807+
+ sys.argv[1:] = prev_argv
808+
+
809+
def process_tempita_pyx(fromfile, tofile):
810+
import npy_tempita as tempita
811+

0 commit comments

Comments
 (0)