commit:     39f8dd1c48c3cbf2614027426754752df686fec8
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Nov  5 16:33:17 2023 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Nov  5 17:00:08 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=39f8dd1c

dev-python/py-ubjson: Enable py3.12

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 .../py-ubjson/files/py-ubjson-0.16.1-py312.patch   | 35 ++++++++++++++++++++++
 dev-python/py-ubjson/py-ubjson-0.16.1-r1.ebuild    |  7 ++++-
 2 files changed, 41 insertions(+), 1 deletion(-)

diff --git a/dev-python/py-ubjson/files/py-ubjson-0.16.1-py312.patch 
b/dev-python/py-ubjson/files/py-ubjson-0.16.1-py312.patch
new file mode 100644
index 000000000000..ab2bb2cab503
--- /dev/null
+++ b/dev-python/py-ubjson/files/py-ubjson-0.16.1-py312.patch
@@ -0,0 +1,35 @@
+From 1e69041e86947e360f30b8ee5ee0993ddd68469c Mon Sep 17 00:00:00 2001
+From: Vilnis Termanis <[email protected]>
+Date: Fri, 20 Oct 2023 17:10:10 +0200
+Subject: [PATCH] Fix recursion test case for Python 3.12
+
+---
+ test/test.py | 6 +++---
+ 3 files changed, 11 insertions(+), 3 deletions(-)
+
+diff --git a/test/test.py b/test/test.py
+index c3920c4..d685194 100644
+--- a/test/test.py
++++ b/test/test.py
+@@ -465,10 +465,10 @@ def assert_raises_regex(self, *args, **kwargs):
+ 
+     def test_recursion(self):
+         old_limit = getrecursionlimit()
+-        setrecursionlimit(200)
++        setrecursionlimit(100)
+         try:
+             obj = current = []
+-            for _ in range(getrecursionlimit() * 2):
++            for _ in range(getrecursionlimit() * 30):
+                 new_list = []
+                 current.append(new_list)
+                 current = new_list
+@@ -476,7 +476,7 @@ def test_recursion(self):
+             with self.assert_raises_regex(RuntimeError, 'recursion'):
+                 self.ubjdumpb(obj)
+ 
+-            raw = ARRAY_START * (getrecursionlimit() * 2)
++            raw = ARRAY_START * (getrecursionlimit() * 30)
+             with self.assert_raises_regex(RuntimeError, 'recursion'):
+                 self.ubjloadb(raw)
+         finally:

diff --git a/dev-python/py-ubjson/py-ubjson-0.16.1-r1.ebuild 
b/dev-python/py-ubjson/py-ubjson-0.16.1-r1.ebuild
index e378a5cd0702..d04531f7b07d 100644
--- a/dev-python/py-ubjson/py-ubjson-0.16.1-r1.ebuild
+++ b/dev-python/py-ubjson/py-ubjson-0.16.1-r1.ebuild
@@ -6,7 +6,7 @@ EAPI=8
 DISTUTILS_EXT=1
 DISTUTILS_USE_PEP517=setuptools
 PYPI_NO_NORMALIZE=1
-PYTHON_COMPAT=( python3_{9..11} )
+PYTHON_COMPAT=( python3_{10..12} )
 
 inherit distutils-r1 pypi
 
@@ -22,6 +22,11 @@ KEYWORDS="amd64 arm arm64 ~riscv ~sparc x86 ~amd64-linux 
~x86-linux"
 
 distutils_enable_tests unittest
 
+PATCHES=(
+       # https://github.com/Iotic-Labs/py-ubjson/pull/19
+       "${FILESDIR}/${P}-py312.patch"
+)
+
 python_test() {
        eunittest -s test
 }

Reply via email to