From c07c578e37d6ced3828343d881a861237d6db567 Mon Sep 17 00:00:00 2001 From: Trevor Gamblin Date: Mon, 12 May 2025 10:43:51 -0400 Subject: python3-cython: upgrade 3.0.12 -> 3.1.0 Many changes are included with this release, including support for freethreading builds of CPython 3.13, cleanup of legacy code, and many other features and bug fixes. Changelog: https://github.com/cython/cython/blob/master/CHANGES.rst Patch '0001-Output-import-relative-paths-in-generated-C-code.-GH.patch' is included in 3.1.0, so we no longer need the backport: |tgamblin@megalith ~/workspace/git/pythonsrc/cython (master)$ git tag --contains 20bceea6b19ffc2f65b9fba2e4f737f09e5a2b20 |3.1.0 |3.1.0-1 |3.1.0a1 |3.1.0b1 |3.1.0rc1 |3.1.0rc2 Reproducibility looks OK. (From OE-Core rev: 26a73392524f648015d55bf421a9b1bf5ac0d955) Signed-off-by: Trevor Gamblin Signed-off-by: Richard Purdie --- ...rt-relative-paths-in-generated-C-code.-GH.patch | 73 ---------------------- .../python/python3-cython_3.0.12.bb | 45 ------------- .../python/python3-cython_3.1.0.bb | 44 +++++++++++++ 3 files changed, 44 insertions(+), 118 deletions(-) delete mode 100644 meta/recipes-devtools/python/python3-cython/0001-Output-import-relative-paths-in-generated-C-code.-GH.patch delete mode 100644 meta/recipes-devtools/python/python3-cython_3.0.12.bb create mode 100644 meta/recipes-devtools/python/python3-cython_3.1.0.bb (limited to 'meta/recipes-devtools/python') diff --git a/meta/recipes-devtools/python/python3-cython/0001-Output-import-relative-paths-in-generated-C-code.-GH.patch b/meta/recipes-devtools/python/python3-cython/0001-Output-import-relative-paths-in-generated-C-code.-GH.patch deleted file mode 100644 index bbafc29416..0000000000 --- a/meta/recipes-devtools/python/python3-cython/0001-Output-import-relative-paths-in-generated-C-code.-GH.patch +++ /dev/null @@ -1,73 +0,0 @@ -From 9b5f3b09f76899eba510c2d8f3ed2b0f752a4d1b Mon Sep 17 00:00:00 2001 -From: Oscar Benjamin -Date: Sat, 24 Aug 2024 08:30:31 +0100 -Subject: [PATCH] Output import-relative paths in generated C code. (GH-6341) - -When cython is run on a file that is not in the current working directory, -it outputs filepaths that are either absolute or are basenames. -It is not good to output absolute paths in the generated C code and -basenames mess up coverage measurement. - -Upstream-Status: Backport [20bceea6b19ffc2f65b9fba2e4f737f09e5a2b20] -Signed-off-by: Ross Burton ---- - Cython/Compiler/ExprNodes.py | 8 +++++++- - Cython/Compiler/ModuleNode.py | 9 ++++++--- - 2 files changed, 13 insertions(+), 4 deletions(-) - -diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py -index a6bb1688e..0fbb15368 100644 ---- a/Cython/Compiler/ExprNodes.py -+++ b/Cython/Compiler/ExprNodes.py -@@ -21,6 +21,7 @@ import re - import sys - import copy - import os.path -+import pathlib - import operator - - from .Errors import ( -@@ -10072,7 +10073,12 @@ class CodeObjectNode(ExprNode): - func_name = code.get_py_string_const( - func.name, identifier=True, is_str=False, unicode_value=func.name) - # FIXME: better way to get the module file path at module init time? Encoding to use? -- file_path = StringEncoding.bytes_literal(func.pos[0].get_filenametable_entry().encode('utf8'), 'utf8') -+ file_path = func.pos[0].get_filenametable_entry() -+ if os.path.isabs(file_path): -+ file_path = func.pos[0].get_description() -+ # Always use / as separator -+ file_path = pathlib.Path(file_path).as_posix() -+ file_path = StringEncoding.bytes_literal(file_path.encode('utf-8'), 'utf8') - file_path_const = code.get_py_string_const(file_path, identifier=False, is_str=True) - - # This combination makes CPython create a new dict for "frame.f_locals" (see GH #1836). -diff --git a/Cython/Compiler/ModuleNode.py b/Cython/Compiler/ModuleNode.py -index 43c6b5f07..8c29d6db7 100644 ---- a/Cython/Compiler/ModuleNode.py -+++ b/Cython/Compiler/ModuleNode.py -@@ -13,6 +13,7 @@ from collections import defaultdict - import json - import operator - import os -+import pathlib - import re - import sys - -@@ -944,9 +945,11 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): - for source_desc in code.globalstate.filename_list: - file_path = source_desc.get_filenametable_entry() - if isabs(file_path): -- file_path = basename(file_path) # never include absolute paths -- escaped_filename = file_path.replace("\\", "\\\\").replace('"', r'\"') -- escaped_filename = as_encoded_filename(escaped_filename) -+ # never include absolute paths -+ file_path = source_desc.get_description() -+ # Always use / as separator -+ file_path = pathlib.Path(file_path).as_posix() -+ escaped_filename = as_encoded_filename(file_path) - code.putln('%s,' % escaped_filename.as_c_string_literal()) - else: - # Some C compilers don't like an empty array --- -2.34.1 - diff --git a/meta/recipes-devtools/python/python3-cython_3.0.12.bb b/meta/recipes-devtools/python/python3-cython_3.0.12.bb deleted file mode 100644 index f1951e3ae6..0000000000 --- a/meta/recipes-devtools/python/python3-cython_3.0.12.bb +++ /dev/null @@ -1,45 +0,0 @@ -SUMMARY = "The Cython language" -HOMEPAGE = "https://pypi.org/project/Cython/" -DESCRIPTION = "Cython is a language specially designed for writing Python extension modules. \ -It's designed to bridge the gap between the nice, high-level, easy-to-use world of Python \ -and the messy, low-level world of C." -SECTION = "devel/python" -LICENSE = "Apache-2.0" -LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=61c3ee8961575861fa86c7e62bc9f69c" - -SRC_URI += "file://0001-Output-import-relative-paths-in-generated-C-code.-GH.patch" -SRC_URI[sha256sum] = "b988bb297ce76c671e28c97d017b95411010f7c77fa6623dd0bb47eed1aee1bc" - -inherit pypi setuptools3 cython - -# No need to depend on self -DEPENDS:remove = "python3-cython-native" - -do_install:append() { - # rename scripts that would conflict with the Python 2 build of Cython - mv ${D}${bindir}/cython ${D}${bindir}/cython3 - mv ${D}${bindir}/cythonize ${D}${bindir}/cythonize3 - mv ${D}${bindir}/cygdb ${D}${bindir}/cygdb3 -} - -RDEPENDS:${PN}:class-target += "\ - python3-misc \ - python3-netserver \ - python3-pkgutil \ - python3-pyparsing \ - python3-setuptools \ - python3-shell \ - python3-xml \ -" - -RDEPENDS:${PN}:class-nativesdk += "\ - nativesdk-python3-misc \ - nativesdk-python3-netserver \ - nativesdk-python3-pkgutil \ - nativesdk-python3-pyparsing \ - nativesdk-python3-setuptools \ - nativesdk-python3-shell \ - nativesdk-python3-xml \ -" - -BBCLASSEXTEND = "native nativesdk" diff --git a/meta/recipes-devtools/python/python3-cython_3.1.0.bb b/meta/recipes-devtools/python/python3-cython_3.1.0.bb new file mode 100644 index 0000000000..f93135b94b --- /dev/null +++ b/meta/recipes-devtools/python/python3-cython_3.1.0.bb @@ -0,0 +1,44 @@ +SUMMARY = "The Cython language" +HOMEPAGE = "https://pypi.org/project/Cython/" +DESCRIPTION = "Cython is a language specially designed for writing Python extension modules. \ +It's designed to bridge the gap between the nice, high-level, easy-to-use world of Python \ +and the messy, low-level world of C." +SECTION = "devel/python" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=61c3ee8961575861fa86c7e62bc9f69c" + +SRC_URI[sha256sum] = "1097dd60d43ad0fff614a57524bfd531b35c13a907d13bee2cc2ec152e6bf4a1" + +inherit pypi setuptools3 cython + +# No need to depend on self +DEPENDS:remove = "python3-cython-native" + +do_install:append() { + # rename scripts that would conflict with the Python 2 build of Cython + mv ${D}${bindir}/cython ${D}${bindir}/cython3 + mv ${D}${bindir}/cythonize ${D}${bindir}/cythonize3 + mv ${D}${bindir}/cygdb ${D}${bindir}/cygdb3 +} + +RDEPENDS:${PN}:class-target += "\ + python3-misc \ + python3-netserver \ + python3-pkgutil \ + python3-pyparsing \ + python3-setuptools \ + python3-shell \ + python3-xml \ +" + +RDEPENDS:${PN}:class-nativesdk += "\ + nativesdk-python3-misc \ + nativesdk-python3-netserver \ + nativesdk-python3-pkgutil \ + nativesdk-python3-pyparsing \ + nativesdk-python3-setuptools \ + nativesdk-python3-shell \ + nativesdk-python3-xml \ +" + +BBCLASSEXTEND = "native nativesdk" -- cgit v1.2.3-54-g00ecf