diff options
| author | shadchin <[email protected]> | 2025-05-20 08:08:08 +0300 |
|---|---|---|
| committer | shadchin <[email protected]> | 2025-05-20 08:23:54 +0300 |
| commit | 9e84784e35e577b7a63832b44dae1e50799759f6 (patch) | |
| tree | 406d8635f55dd022dcc6b9b9157733cd5a83c884 | |
| parent | 6da74f6344a8d690a32e7eea752054c829742c96 (diff) | |
Fix reimport for Cython
commit_hash:42f70df990e2d7ee884e3992b246bc66e8374beb
| -rw-r--r-- | build/ymake.core.conf | 2 | ||||
| -rw-r--r-- | contrib/tools/cython/.yandex_meta/licenses.list.txt | 6 | ||||
| -rw-r--r-- | contrib/tools/cython/Cython/.yandex_meta/licenses.list.txt | 6 | ||||
| -rw-r--r-- | contrib/tools/cython/Cython/Coverage.py | 1 | ||||
| -rw-r--r-- | contrib/tools/cython/Cython/Utility/ImportExport.c | 7 | ||||
| -rw-r--r-- | contrib/tools/cython/Cython/Utils.py | 1 | ||||
| -rw-r--r-- | contrib/tools/cython/patches/DEVTOOLSSUPPORT-52386.patch | 47 | ||||
| -rw-r--r-- | contrib/tools/cython/patches/all-changes.patch | 17 | ||||
| -rw-r--r-- | contrib/tools/cython/ya.make | 6 |
9 files changed, 25 insertions, 68 deletions
diff --git a/build/ymake.core.conf b/build/ymake.core.conf index 41f54b29bd2..61a1354cb43 100644 --- a/build/ymake.core.conf +++ b/build/ymake.core.conf @@ -13,7 +13,7 @@ CPP_FAKEID=2024-01-23 GO_FAKEID=11100371 ANDROID_FAKEID=2023-05-17 CLANG_TIDY_FAKEID=2023-06-06 -CYTHON_FAKEID=10784829 +CYTHON_FAKEID=16584065 JAVA_FAKEID=14386852 PROTO_FAKEID=0 FBS_FAKEID=2024-03-13 diff --git a/contrib/tools/cython/.yandex_meta/licenses.list.txt b/contrib/tools/cython/.yandex_meta/licenses.list.txt index d34a1de27d5..d7279f3bcbb 100644 --- a/contrib/tools/cython/.yandex_meta/licenses.list.txt +++ b/contrib/tools/cython/.yandex_meta/licenses.list.txt @@ -1,7 +1,7 @@ ====================Apache-2.0==================== Apache License Version 2.0, January 2004 - http://www.apache.org/licenses/ + https://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION @@ -186,13 +186,13 @@ Software License. More precisely, all modifications and new code ====================Apache-2.0==================== -License: Apache +License: Apache-2.0 ====================File: LICENSE.txt==================== Apache License Version 2.0, January 2004 - http://www.apache.org/licenses/ + https://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION diff --git a/contrib/tools/cython/Cython/.yandex_meta/licenses.list.txt b/contrib/tools/cython/Cython/.yandex_meta/licenses.list.txt new file mode 100644 index 00000000000..f5cf5d119e5 --- /dev/null +++ b/contrib/tools/cython/Cython/.yandex_meta/licenses.list.txt @@ -0,0 +1,6 @@ +====================COPYRIGHT==================== +# Copyright (C) 2010-2011, IPython Development Team. + + +====================Public-Domain==================== +// Written by Rusty Russell, public domain, https://ccodearchive.net/ diff --git a/contrib/tools/cython/Cython/Coverage.py b/contrib/tools/cython/Cython/Coverage.py index 834aab04f66..78c57062381 100644 --- a/contrib/tools/cython/Cython/Coverage.py +++ b/contrib/tools/cython/Cython/Coverage.py @@ -541,3 +541,4 @@ if standalone(): def _find_dep_file_path(main_file, file_path, relative_path_search=False): # file_path is already arcadia root relative return canonical_filename(file_path) + diff --git a/contrib/tools/cython/Cython/Utility/ImportExport.c b/contrib/tools/cython/Cython/Utility/ImportExport.c index b04553add88..18c2cef7db3 100644 --- a/contrib/tools/cython/Cython/Utility/ImportExport.c +++ b/contrib/tools/cython/Cython/Utility/ImportExport.c @@ -534,7 +534,7 @@ static PyTypeObject *__Pyx_ImportType_$cyversion(PyObject *module, const char *m size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_$cyversion check_size) { PyObject *result = 0; - //char warning[200]; + char warning[200]; Py_ssize_t basicsize; Py_ssize_t itemsize; #if CYTHON_COMPILING_IN_LIMITED_API @@ -602,6 +602,11 @@ static PyTypeObject *__Pyx_ImportType_$cyversion(PyObject *module, const char *m goto bad; } else if (check_size == __Pyx_ImportType_CheckSize_Warn_$cyversion && (size_t)basicsize > size) { + PyOS_snprintf(warning, sizeof(warning), + "%s.%s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize); + if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; } /* check_size == __Pyx_ImportType_CheckSize_Ignore does not warn nor error */ return (PyTypeObject *)result; diff --git a/contrib/tools/cython/Cython/Utils.py b/contrib/tools/cython/Cython/Utils.py index cb74026b162..929d99fcbdd 100644 --- a/contrib/tools/cython/Cython/Utils.py +++ b/contrib/tools/cython/Cython/Utils.py @@ -763,3 +763,4 @@ def generated_file_exists(filename, is_standalone=False): return library.python.resource.resfs_src(filename, resfs_file=True) return os.path.exists(filename) + diff --git a/contrib/tools/cython/patches/DEVTOOLSSUPPORT-52386.patch b/contrib/tools/cython/patches/DEVTOOLSSUPPORT-52386.patch deleted file mode 100644 index 51509ebc7d3..00000000000 --- a/contrib/tools/cython/patches/DEVTOOLSSUPPORT-52386.patch +++ /dev/null @@ -1,47 +0,0 @@ -commit 3bb34c7656f9f425d9f9dbe140340f1d5b57586f -merge: 78a88b4da152acc232b549f8a7415d3f8a67bd31 b694ac6e026f3dd205118ad0f939efc45e985a69 -author: pg -date: 2024-10-11T10:22:30+03:00 -revision: 15073732 - - DEVTOOLSSUPPORT-52386 - - REVIEW: 6974995 - ---- contrib/tools/cython/Cython/Utility/ImportExport.c (78a88b4da152acc232b549f8a7415d3f8a67bd31) -+++ contrib/tools/cython/Cython/Utility/ImportExport.c (3bb34c7656f9f425d9f9dbe140340f1d5b57586f) -@@ -331,7 +331,7 @@ static PyTypeObject *__Pyx_ImportType_$cyversion(PyObject *module, const char *m - size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_$cyversion check_size) - { - PyObject *result = 0; -- char warning[200]; -+ //char warning[200]; - Py_ssize_t basicsize; - Py_ssize_t itemsize; - #ifdef Py_LIMITED_API -@@ -382,25 +382,10 @@ static PyTypeObject *__Pyx_ImportType_$cyversion(PyObject *module, const char *m - itemsize = (Py_ssize_t)alignment; - } - if ((size_t)(basicsize + itemsize) < size) { -- PyErr_Format(PyExc_ValueError, -- "%.200s.%.200s size changed, may indicate binary incompatibility. " -- "Expected %zd from C header, got %zd from PyObject", -- module_name, class_name, size, basicsize); -- goto bad; - } - if (check_size == __Pyx_ImportType_CheckSize_Error_$cyversion && (size_t)basicsize != size) { -- PyErr_Format(PyExc_ValueError, -- "%.200s.%.200s size changed, may indicate binary incompatibility. " -- "Expected %zd from C header, got %zd from PyObject", -- module_name, class_name, size, basicsize); -- goto bad; - } - else if (check_size == __Pyx_ImportType_CheckSize_Warn_$cyversion && (size_t)basicsize > size) { -- PyOS_snprintf(warning, sizeof(warning), -- "%s.%s size changed, may indicate binary incompatibility. " -- "Expected %zd from C header, got %zd from PyObject", -- module_name, class_name, size, basicsize); -- if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; - } - /* check_size == __Pyx_ImportType_CheckSize_Ignore does not warn nor error */ - return (PyTypeObject *)result; diff --git a/contrib/tools/cython/patches/all-changes.patch b/contrib/tools/cython/patches/all-changes.patch index c5cd61b4734..d2a72348c68 100644 --- a/contrib/tools/cython/patches/all-changes.patch +++ b/contrib/tools/cython/patches/all-changes.patch @@ -579,6 +579,9 @@ + +# ========================== Arcadia specific ================================= + ++def standalone(): ++ return getattr(sys, 'is_standalone_binary', False) ++ +# ======================= Redefine some methods =============================== + +if standalone(): @@ -1001,17 +1004,3 @@ # Make sure we import the right Cython cythonpath, _ = os.path.split(os.path.realpath(__file__)) ---- contrib/tools/cython/Cython/Utils.py (index) -+++ contrib/tools/cython/Cython/Utils.py (working tree) -@@ -4,9 +4,9 @@ Cython -- Things that don't belong anywhere else in particular - - from __future__ import absolute_import - --import cython -+from .Shadow import declare - --cython.declare( -+declare( - basestring=object, - os=object, sys=object, re=object, io=object, codecs=object, glob=object, shutil=object, tempfile=object, - cython_version=object, diff --git a/contrib/tools/cython/ya.make b/contrib/tools/cython/ya.make index 846b3b1c87b..ba485359605 100644 --- a/contrib/tools/cython/ya.make +++ b/contrib/tools/cython/ya.make @@ -2,13 +2,15 @@ PY3_LIBRARY() -SUBSCRIBER(g:python-contrib) - LICENSE( Apache-2.0 AND LicenseRef-scancode-unknown-license-reference ) +LICENSE_TEXTS(.yandex_meta/licenses.list.txt) + +SUBSCRIBER(g:python-contrib) + VERSION(3.0.10) ORIGINAL_SOURCE(mirror://pypi/C/Cython/Cython-3.0.10.tar.gz) |
