From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Alexander Kanavin <alex.kanavin@gmail.com>
Cc: openembedded-core@lists.openembedded.org,
Alexander Kanavin <alex@linutronix.de>
Subject: Re: [OE-core] [PATCH 2/3] python3-pyaaml: make compatible with cython 3.x
Date: Sun, 7 Jan 2024 20:49:32 +0100 [thread overview]
Message-ID: <2024010719493289a2a15c@mail.local> (raw)
In-Reply-To: <20240105133543.3017997-2-alex@linutronix.de>
Hello,
You have a typo in the subject.
On 05/01/2024 14:35:42+0100, Alexander Kanavin wrote:
> 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.
>
> Signed-off-by: Alexander Kanavin <alex@linutronix.de>
> ---
> .../0001-Fix-builds-with-Cython-3.patch | 54 +++++++++++++++++++
> .../python/python3-pyyaml_6.0.1.bb | 1 +
> 2 files changed, 55 insertions(+)
> create mode 100644 meta/recipes-devtools/python/python3-pyyaml/0001-Fix-builds-with-Cython-3.patch
>
> 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 00000000000..a87d588b6a1
> --- /dev/null
> +++ b/meta/recipes-devtools/python/python3-pyyaml/0001-Fix-builds-with-Cython-3.patch
> @@ -0,0 +1,54 @@
> +From 9cc23db56add79357b8f8257fe6fc0d6879d4579 Mon Sep 17 00:00:00 2001
> +From: "Andrew J. Hesford" <ajh@sideband.org>
> +Date: Fri, 21 Jul 2023 09:50:00 -0400
> +Subject: [PATCH] Fix builds with Cython 3
> +
> +This is a *de minimis* fix for building with Cython 3. Recent Cython<3
> +releases provided `Cython.Distutils.build_ext` as an alias to
> +`Cython.Distutils.old_build_ext.old_build_ext`; Cython 3 drops this
> +alias and instead uses a wholly new `Cython.Distutils.build_ext` that
> +does not provide the `cython_sources` function used in `setup.py`.
> +
> +Explicitly importing `old_build_ext` preserves the existing behavior for
> +recent Cython<3 and uses the correct behavior for Cython 3. Should the
> +import fail (*e.g.*, because the version of Cython available predates
> +the availability of `old_build_ext`), the import falls back to just
> +`Cython.Distutils.build_ext`.
> +
> +Signed-off-by: Andrew J. Hesford <ajh@sideband.org>
> +Upstream-Status: Denied [https://github.com/yaml/pyyaml/pull/731]
> +Signed-off-by: Alexander Kanavin <alex@linutronix.de>
> +---
> + pyproject.toml | 2 +-
> + setup.py | 6 +++++-
> + 2 files changed, 6 insertions(+), 2 deletions(-)
> +
> +diff --git a/pyproject.toml b/pyproject.toml
> +index 4bc04c0..2bf5ec8 100644
> +--- a/pyproject.toml
> ++++ b/pyproject.toml
> +@@ -1,3 +1,3 @@
> + [build-system]
> +-requires = ["setuptools", "wheel", "Cython<3.0"]
> ++requires = ["setuptools", "wheel", "Cython"]
> + build-backend = "setuptools.build_meta"
> +diff --git a/setup.py b/setup.py
> +index 65b0ea0..4461580 100644
> +--- a/setup.py
> ++++ b/setup.py
> +@@ -82,7 +82,11 @@ if 'sdist' in sys.argv or os.environ.get('PYYAML_FORCE_CYTHON') == '1':
> + with_cython = True
> + try:
> + from Cython.Distutils.extension import Extension as _Extension
> +- from Cython.Distutils import build_ext as _build_ext
> ++ try:
> ++ from Cython.Distutils.old_build_ext import old_build_ext as _build_ext
> ++ except ImportError:
> ++ from Cython.Distutils import build_ext as _build_ext
> ++
> + with_cython = True
> + except ImportError:
> + if with_cython:
> +--
> +2.39.2
> +
> diff --git a/meta/recipes-devtools/python/python3-pyyaml_6.0.1.bb b/meta/recipes-devtools/python/python3-pyyaml_6.0.1.bb
> index 4ab8f038f42..61f7cbc6b36 100644
> --- a/meta/recipes-devtools/python/python3-pyyaml_6.0.1.bb
> +++ b/meta/recipes-devtools/python/python3-pyyaml_6.0.1.bb
> @@ -9,6 +9,7 @@ PYPI_PACKAGE = "PyYAML"
>
> inherit pypi python_setuptools_build_meta
>
> +SRC_URI += "file://0001-Fix-builds-with-Cython-3.patch"
> SRC_URI[sha256sum] = "bfdf460b1736c775f2ba9f6a92bca30bc2095067b8a9d77876d1fad6cc3b4a43"
>
> RDEPENDS:${PN} += "\
> --
> 2.39.2
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#193356): https://lists.openembedded.org/g/openembedded-core/message/193356
> Mute This Topic: https://lists.openembedded.org/mt/103542145/3617179
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alexandre.belloni@bootlin.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
next prev parent reply other threads:[~2024-01-07 19:49 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-05 13:35 [PATCH 1/3] devtool/standard: correctly escape \ Alexander Kanavin
2024-01-05 13:35 ` [PATCH 2/3] python3-pyaaml: make compatible with cython 3.x Alexander Kanavin
2024-01-07 19:49 ` Alexandre Belloni [this message]
2024-01-05 13:35 ` [PATCH 3/3] python3-cython: update 0.29.36 -> 3.0.7 Alexander Kanavin
2024-01-07 19:54 ` [OE-core] " Alexandre Belloni
2024-01-07 20:05 ` Alexander Kanavin
2024-01-07 20:09 ` Alexandre Belloni
2024-01-07 20:14 ` Alexandre Belloni
[not found] ` <17A828BF39EB0275.11644@lists.openembedded.org>
2024-01-08 7:39 ` Alexandre Belloni
2024-01-08 8:10 ` Alexander Kanavin
2024-01-09 21:50 ` Alexandre Belloni
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2024010719493289a2a15c@mail.local \
--to=alexandre.belloni@bootlin.com \
--cc=alex.kanavin@gmail.com \
--cc=alex@linutronix.de \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.