summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2023-06-01 14:32:21 +0200
committerMichał Górny <mgorny@gentoo.org>2023-06-01 14:40:11 +0200
commitd14d03f5953c143007b43e2c2109aef90c526a96 (patch)
treebea075b94037ebd9655503f71423a5fd5a2994b3 /dev-python/ijson
parentdev-tex/tex4ht: update HOMEPAGE (diff)
downloadgentoo-d14d03f5953c143007b43e2c2109aef90c526a96.tar.gz
gentoo-d14d03f5953c143007b43e2c2109aef90c526a96.tar.bz2
gentoo-d14d03f5953c143007b43e2c2109aef90c526a96.zip
dev-python/ijson: Enable py3.12
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python/ijson')
-rw-r--r--dev-python/ijson/files/ijson-3.2.0_p0-py312.patch29
-rw-r--r--dev-python/ijson/ijson-3.2.0_p0-r1.ebuild40
2 files changed, 69 insertions, 0 deletions
diff --git a/dev-python/ijson/files/ijson-3.2.0_p0-py312.patch b/dev-python/ijson/files/ijson-3.2.0_p0-py312.patch
new file mode 100644
index 000000000000..52db9704f1f3
--- /dev/null
+++ b/dev-python/ijson/files/ijson-3.2.0_p0-py312.patch
@@ -0,0 +1,29 @@
+From e076d8343f63698355fd52dc2d6983fd1c1a745e Mon Sep 17 00:00:00 2001
+From: Rodrigo Tobar <rtobar@icrar.org>
+Date: Mon, 29 May 2023 12:24:27 +0800
+Subject: [PATCH] Obtain gi_code by attribute lookup
+
+We were previously getting it by intrusively examining the structure,
+which was flaky and indeed broke during the transition to 3.12, where
+the gi_code struct member was re-implemented via get/set methods.
+
+This should address #95.
+
+Signed-off-by: Rodrigo Tobar <rtobar@icrar.org>
+---
+ ijson/backends/yajl2_c/async_reading_generator.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/ijson/backends/yajl2_c/async_reading_generator.c b/ijson/backends/yajl2_c/async_reading_generator.c
+index 25947cb..0e52a7d 100644
+--- a/ijson/backends/yajl2_c/async_reading_generator.c
++++ b/ijson/backends/yajl2_c/async_reading_generator.c
+@@ -77,7 +77,7 @@ static PyObject *maybe_pop_event(async_reading_generator *self)
+ static int is_gen_coroutine(PyObject *o)
+ {
+ if (PyGen_CheckExact(o)) {
+- PyCodeObject *code = (PyCodeObject *)((PyGenObject*) o)->gi_code;
++ PyCodeObject *code = (PyCodeObject *)PyObject_GetAttrString(o, "gi_code");
+ return code->co_flags & CO_ITERABLE_COROUTINE;
+ }
+ return 0;
diff --git a/dev-python/ijson/ijson-3.2.0_p0-r1.ebuild b/dev-python/ijson/ijson-3.2.0_p0-r1.ebuild
new file mode 100644
index 000000000000..e2f912075f33
--- /dev/null
+++ b/dev-python/ijson/ijson-3.2.0_p0-r1.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_EXT=1
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{10..12} pypy3 )
+
+inherit distutils-r1
+
+MY_P="${P//_p/.post}"
+DESCRIPTION="Iterative JSON parser with a Pythonic interface"
+HOMEPAGE="
+ https://github.com/ICRAR/ijson/
+ https://pypi.org/project/ijson/
+"
+SRC_URI="
+ https://github.com/ICRAR/${PN}/archive/v${PV/_p/.post}.tar.gz
+ -> ${MY_P}.gh.tar.gz
+"
+S=${WORKDIR}/${MY_P}
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc64 ~x86"
+
+DEPEND="
+ dev-libs/yajl
+"
+RDEPEND="
+ ${DEPEND}
+"
+
+distutils_enable_tests pytest
+
+PATCHES=(
+ # https://github.com/ICRAR/ijson/commit/e076d8343f63698355fd52dc2d6983fd1c1a745e
+ "${FILESDIR}/${P}-py312.patch"
+)