diff options
author | Alexander Kanavin <alex.kanavin@gmail.com> | 2024-01-05 14:35:42 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-01-10 17:01:28 +0000 |
commit | 1a2708509216f1d94eb763081b76e9207323e098 (patch) | |
tree | d40041e300951b55da4b29936a302b26ad37426f /meta/recipes-devtools/python/python3-pyyaml | |
parent | 7b3668a0aa8fa675f5de6544893e4f4247386ba0 (diff) | |
download | poky-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.patch | 54 |
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 @@ | |||
1 | From 9cc23db56add79357b8f8257fe6fc0d6879d4579 Mon Sep 17 00:00:00 2001 | ||
2 | From: "Andrew J. Hesford" <ajh@sideband.org> | ||
3 | Date: Fri, 21 Jul 2023 09:50:00 -0400 | ||
4 | Subject: [PATCH] Fix builds with Cython 3 | ||
5 | |||
6 | This is a *de minimis* fix for building with Cython 3. Recent Cython<3 | ||
7 | releases provided `Cython.Distutils.build_ext` as an alias to | ||
8 | `Cython.Distutils.old_build_ext.old_build_ext`; Cython 3 drops this | ||
9 | alias and instead uses a wholly new `Cython.Distutils.build_ext` that | ||
10 | does not provide the `cython_sources` function used in `setup.py`. | ||
11 | |||
12 | Explicitly importing `old_build_ext` preserves the existing behavior for | ||
13 | recent Cython<3 and uses the correct behavior for Cython 3. Should the | ||
14 | import fail (*e.g.*, because the version of Cython available predates | ||
15 | the availability of `old_build_ext`), the import falls back to just | ||
16 | `Cython.Distutils.build_ext`. | ||
17 | |||
18 | Signed-off-by: Andrew J. Hesford <ajh@sideband.org> | ||
19 | Upstream-Status: Denied [https://github.com/yaml/pyyaml/pull/731] | ||
20 | Signed-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 | |||
26 | diff --git a/pyproject.toml b/pyproject.toml | ||
27 | index 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" | ||
35 | diff --git a/setup.py b/setup.py | ||
36 | index 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 | -- | ||
53 | 2.39.2 | ||
54 | |||