Chih-Hsuan Yen pushed to branch main at Arch Linux / Packaging / Packages / python-ubjson
Commits: 6b084e94 by Chih-Hsuan Yen at 2024-04-24T23:46:38+08:00 Use a better patch for testing on Python 3.12 The new patch is a squashed version of the updated pull request https://github.com/Iotic-Labs/py-ubjson/pull/19 - - - - - 4 changed files: - .SRCINFO - PKGBUILD - + py312.diff - − py312.patch Changes: ===================================== .SRCINFO ===================================== @@ -14,10 +14,10 @@ pkgbase = python-ubjson depends = python source = https://files.pythonhosted.org/packages/source/p/py-ubjson/py-ubjson-0.16.1.tar.gz source = py-ubjson-0.16.1.tar.gz.asc - source = py312.patch + source = py312.diff validpgpkeys = A262040D27F5F4700D097A02CF651F44EF65072E sha256sums = b9bfb8695a1c7e3632e800fb83c943bf67ed45ddd87cd0344851610c69a5a482 sha256sums = SKIP - sha256sums = c146862cdb9fcafd6c38d7111183e7b022e7da03ee4cc7edb018a5242a9d92d3 + sha256sums = 9309c5337ebdcb206deedf2dc46d98f4b32df3fda414c4bd98f15c85c8bcd3f1 pkgname = python-ubjson ===================================== PKGBUILD ===================================== @@ -20,10 +20,10 @@ makedepends=(python-build python-installer python-setuptools python-wheel) depends=(python) source=("https://files.pythonhosted.org/packages/source/p/py-ubjson/py-ubjson-$pkgver.tar.gz" "py-ubjson-$pkgver.tar.gz.asc" - "py312.patch") + "py312.diff") sha256sums=('b9bfb8695a1c7e3632e800fb83c943bf67ed45ddd87cd0344851610c69a5a482' 'SKIP' - 'c146862cdb9fcafd6c38d7111183e7b022e7da03ee4cc7edb018a5242a9d92d3') + '9309c5337ebdcb206deedf2dc46d98f4b32df3fda414c4bd98f15c85c8bcd3f1') validpgpkeys=( 'A262040D27F5F4700D097A02CF651F44EF65072E' # Iotic Labs Ltd (Software release signing key) <i...@iotic-labs.com> ) @@ -31,7 +31,7 @@ validpgpkeys=( prepare() { cd py-ubjson-$pkgver # Part of https://github.com/Iotic-Labs/py-ubjson/pull/19 (unmerged) - patch -Np1 -i ../py312.patch + patch -Np1 -i ../py312.diff } build() { ===================================== py312.diff ===================================== @@ -0,0 +1,40 @@ +diff --git a/test/test.py b/test/test.py +index c3920c4..67a9fbc 100644 +--- a/test/test.py ++++ b/test/test.py +@@ -464,23 +464,18 @@ def assert_raises_regex(self, *args, **kwargs): + return (self.assertRaisesRegexp if PY2 else self.assertRaisesRegex)(*args, **kwargs) + + def test_recursion(self): +- old_limit = getrecursionlimit() +- setrecursionlimit(200) +- try: +- obj = current = [] +- for _ in range(getrecursionlimit() * 2): +- new_list = [] +- current.append(new_list) +- current = new_list +- +- with self.assert_raises_regex(RuntimeError, 'recursion'): +- self.ubjdumpb(obj) +- +- raw = ARRAY_START * (getrecursionlimit() * 2) +- with self.assert_raises_regex(RuntimeError, 'recursion'): +- self.ubjloadb(raw) +- finally: +- setrecursionlimit(old_limit) ++ obj = current = [] ++ for _ in range(getrecursionlimit() * 30): ++ new_list = [] ++ current.append(new_list) ++ current = new_list ++ ++ with self.assert_raises_regex(RuntimeError, 'recursion'): ++ self.ubjdumpb(obj) ++ ++ raw = ARRAY_START * (getrecursionlimit() * 30) ++ with self.assert_raises_regex(RuntimeError, 'recursion'): ++ self.ubjloadb(raw) + + def test_encode_default(self): + def default(obj): ===================================== py312.patch deleted ===================================== @@ -1,37 +0,0 @@ -From 1e69041e86947e360f30b8ee5ee0993ddd68469c Mon Sep 17 00:00:00 2001 -From: Vilnis Termanis <vilnis.terma...@iotics.com> -Date: Fri, 20 Oct 2023 17:10:10 +0200 -Subject: [PATCH] Fix recursion test case for Python 3.12 - ---- - CHANGELOG | 4 ++++ - setup.py | 4 ++++ - 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: View it on GitLab: https://gitlab.archlinux.org/archlinux/packaging/packages/python-ubjson/-/commit/6b084e94b187ccf41c74b2a861937bce1778c4d7 -- This project does not include diff previews in email notifications. View it on GitLab: https://gitlab.archlinux.org/archlinux/packaging/packages/python-ubjson/-/commit/6b084e94b187ccf41c74b2a861937bce1778c4d7 You're receiving this email because of your account on gitlab.archlinux.org.