diff options
author | Alexander Smirnov <alex@ydb.tech> | 2024-04-16 09:11:59 +0000 |
---|---|---|
committer | Alexander Smirnov <alex@ydb.tech> | 2024-04-16 09:11:59 +0000 |
commit | 25de1d521ca218e2b040739fea77a39e9fc543e9 (patch) | |
tree | 21521d8866cf1462dbd52c071cf369974c29650e /contrib/tools/cython | |
parent | bf444b8ed4d0f6bf17fd753e2cf88f9440012e87 (diff) | |
parent | 0a63d9ddc516f206f2b8745ce5e5dfa60190d755 (diff) | |
download | ydb-25de1d521ca218e2b040739fea77a39e9fc543e9.tar.gz |
Merge branch 'rightlib' into mergelibs-240416-0910
Diffstat (limited to 'contrib/tools/cython')
-rw-r--r-- | contrib/tools/cython/Cython/Compiler/FusedNode.py | 8 | ||||
-rw-r--r-- | contrib/tools/cython/Cython/Compiler/Naming.py | 1 | ||||
-rwxr-xr-x | contrib/tools/cython/cython.py | 2 | ||||
-rw-r--r-- | contrib/tools/cython/patches/pr5233-backport-support-const.patch | 37 |
4 files changed, 44 insertions, 4 deletions
diff --git a/contrib/tools/cython/Cython/Compiler/FusedNode.py b/contrib/tools/cython/Cython/Compiler/FusedNode.py index c32b02d941..b833e35189 100644 --- a/contrib/tools/cython/Cython/Compiler/FusedNode.py +++ b/contrib/tools/cython/Cython/Compiler/FusedNode.py @@ -3,7 +3,8 @@ from __future__ import absolute_import import copy from . import (ExprNodes, PyrexTypes, MemoryView, - ParseTreeTransforms, StringEncoding, Errors) + ParseTreeTransforms, StringEncoding, Errors, + Naming) from .ExprNodes import CloneNode, ProxyNode, TupleNode from .Nodes import FuncDefNode, CFuncDefNode, StatListNode, DefNode from ..Utils import OrderedSet @@ -291,9 +292,10 @@ class FusedCFuncDefNode(StatListNode): """) def _dtype_name(self, dtype): + name = str(dtype).replace('_', '__').replace(' ', '_') if dtype.is_typedef: - return '___pyx_%s' % dtype - return str(dtype).replace(' ', '_') + name = Naming.fused_dtype_prefix + name + return name def _dtype_type(self, dtype): if dtype.is_typedef: diff --git a/contrib/tools/cython/Cython/Compiler/Naming.py b/contrib/tools/cython/Cython/Compiler/Naming.py index 4dd6cbbd5c..ceaddf4b18 100644 --- a/contrib/tools/cython/Cython/Compiler/Naming.py +++ b/contrib/tools/cython/Cython/Compiler/Naming.py @@ -118,6 +118,7 @@ frame_cname = pyrex_prefix + "frame" frame_code_cname = pyrex_prefix + "frame_code" binding_cfunc = pyrex_prefix + "binding_PyCFunctionType" fused_func_prefix = pyrex_prefix + 'fuse_' +fused_dtype_prefix = pyrex_prefix + 'fused_dtype_' quick_temp_cname = pyrex_prefix + "temp" # temp variable for quick'n'dirty temping tp_dict_version_temp = pyrex_prefix + "tp_dict_version" obj_dict_version_temp = pyrex_prefix + "obj_dict_version" diff --git a/contrib/tools/cython/cython.py b/contrib/tools/cython/cython.py index 554ba1b4ff..4111f048da 100755 --- a/contrib/tools/cython/cython.py +++ b/contrib/tools/cython/cython.py @@ -1,6 +1,6 @@ #!/usr/bin/env python -# Change content of this file to change uids for cython programs - cython 0.29.37 r0 +# Change content of this file to change uids for cython programs - cython 0.29.37 r1 # # Cython -- Main Program, generic diff --git a/contrib/tools/cython/patches/pr5233-backport-support-const.patch b/contrib/tools/cython/patches/pr5233-backport-support-const.patch new file mode 100644 index 0000000000..bb7a9c3f6e --- /dev/null +++ b/contrib/tools/cython/patches/pr5233-backport-support-const.patch @@ -0,0 +1,37 @@ +https://github.com/cython/cython/pull/5233 + +--- contrib/tools/cython/Cython/Compiler/FusedNode.py (index) ++++ contrib/tools/cython/Cython/Compiler/FusedNode.py (working tree) +@@ -3,7 +3,8 @@ from __future__ import absolute_import + import copy + + from . import (ExprNodes, PyrexTypes, MemoryView, +- ParseTreeTransforms, StringEncoding, Errors) ++ ParseTreeTransforms, StringEncoding, Errors, ++ Naming) + from .ExprNodes import CloneNode, ProxyNode, TupleNode + from .Nodes import FuncDefNode, CFuncDefNode, StatListNode, DefNode + from ..Utils import OrderedSet +@@ -291,9 +292,10 @@ class FusedCFuncDefNode(StatListNode): + """) + + def _dtype_name(self, dtype): ++ name = str(dtype).replace('_', '__').replace(' ', '_') + if dtype.is_typedef: +- return '___pyx_%s' % dtype +- return str(dtype).replace(' ', '_') ++ name = Naming.fused_dtype_prefix + name ++ return name + + def _dtype_type(self, dtype): + if dtype.is_typedef: +--- contrib/tools/cython/Cython/Compiler/Naming.py (index) ++++ contrib/tools/cython/Cython/Compiler/Naming.py (working tree) +@@ -118,6 +118,7 @@ frame_cname = pyrex_prefix + "frame" + frame_code_cname = pyrex_prefix + "frame_code" + binding_cfunc = pyrex_prefix + "binding_PyCFunctionType" + fused_func_prefix = pyrex_prefix + 'fuse_' ++fused_dtype_prefix = pyrex_prefix + 'fused_dtype_' + quick_temp_cname = pyrex_prefix + "temp" # temp variable for quick'n'dirty temping + tp_dict_version_temp = pyrex_prefix + "tp_dict_version" + obj_dict_version_temp = pyrex_prefix + "obj_dict_version" |