summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/python/python3-pyyaml
diff options
context:
space:
mode:
authorAlexander Kanavin <alex.kanavin@gmail.com>2024-01-05 14:35:42 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-01-10 17:01:28 +0000
commit1a2708509216f1d94eb763081b76e9207323e098 (patch)
treed40041e300951b55da4b29936a302b26ad37426f /meta/recipes-devtools/python/python3-pyyaml
parent7b3668a0aa8fa675f5de6544893e4f4247386ba0 (diff)
downloadpoky-1a2708509216f1d94eb763081b76e9207323e098.tar.gz
python3-pyyaml: make compatible with cython 3.x
This has been rejected by upstream in favour of requiring obsolete cython until there's 'proper' 3.x support. Months later, there's still no progress so let's just take the rejected fix, as it does work (as reported by others as well), and allows moving forward with cython. (From OE-Core rev: cf4e45176a37b6f53a6316ec6b1556d6aea39b57) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/python/python3-pyyaml')
-rw-r--r--meta/recipes-devtools/python/python3-pyyaml/0001-Fix-builds-with-Cython-3.patch54
1 files changed, 54 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python3-pyyaml/0001-Fix-builds-with-Cython-3.patch b/meta/recipes-devtools/python/python3-pyyaml/0001-Fix-builds-with-Cython-3.patch
new file mode 100644
index 0000000000..a87d588b6a
--- /dev/null
+++ b/meta/recipes-devtools/python/python3-pyyaml/0001-Fix-builds-with-Cython-3.patch
@@ -0,0 +1,54 @@
1From 9cc23db56add79357b8f8257fe6fc0d6879d4579 Mon Sep 17 00:00:00 2001
2From: "Andrew J. Hesford" <ajh@sideband.org>
3Date: Fri, 21 Jul 2023 09:50:00 -0400
4Subject: [PATCH] Fix builds with Cython 3
5
6This is a *de minimis* fix for building with Cython 3. Recent Cython<3
7releases provided `Cython.Distutils.build_ext` as an alias to
8`Cython.Distutils.old_build_ext.old_build_ext`; Cython 3 drops this
9alias and instead uses a wholly new `Cython.Distutils.build_ext` that
10does not provide the `cython_sources` function used in `setup.py`.
11
12Explicitly importing `old_build_ext` preserves the existing behavior for
13recent Cython<3 and uses the correct behavior for Cython 3. Should the
14import fail (*e.g.*, because the version of Cython available predates
15the availability of `old_build_ext`), the import falls back to just
16`Cython.Distutils.build_ext`.
17
18Signed-off-by: Andrew J. Hesford <ajh@sideband.org>
19Upstream-Status: Denied [https://github.com/yaml/pyyaml/pull/731]
20Signed-off-by: Alexander Kanavin <alex@linutronix.de>
21---
22 pyproject.toml | 2 +-
23 setup.py | 6 +++++-
24 2 files changed, 6 insertions(+), 2 deletions(-)
25
26diff --git a/pyproject.toml b/pyproject.toml
27index 4bc04c0..2bf5ec8 100644
28--- a/pyproject.toml
29+++ b/pyproject.toml
30@@ -1,3 +1,3 @@
31 [build-system]
32-requires = ["setuptools", "wheel", "Cython<3.0"]
33+requires = ["setuptools", "wheel", "Cython"]
34 build-backend = "setuptools.build_meta"
35diff --git a/setup.py b/setup.py
36index 65b0ea0..4461580 100644
37--- a/setup.py
38+++ b/setup.py
39@@ -82,7 +82,11 @@ if 'sdist' in sys.argv or os.environ.get('PYYAML_FORCE_CYTHON') == '1':
40 with_cython = True
41 try:
42 from Cython.Distutils.extension import Extension as _Extension
43- from Cython.Distutils import build_ext as _build_ext
44+ try:
45+ from Cython.Distutils.old_build_ext import old_build_ext as _build_ext
46+ except ImportError:
47+ from Cython.Distutils import build_ext as _build_ext
48+
49 with_cython = True
50 except ImportError:
51 if with_cython:
52--
532.39.2
54