From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id E0DDF15812E for ; Thu, 8 Jun 2023 04:39:29 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D8AA5E08CD; Thu, 8 Jun 2023 04:39:28 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id BACE3E08CD for ; Thu, 8 Jun 2023 04:39:28 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id A457C340C98 for ; Thu, 8 Jun 2023 04:39:27 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 0ED85A8E for ; Thu, 8 Jun 2023 04:39:26 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <1686197198.f52a24017053437ee589d851942946283a4c9310.mgorny@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/pygobject/files/, dev-python/pygobject/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-python/pygobject/files/pygobject-3.44.1-py312.patch dev-python/pygobject/pygobject-3.44.1.ebuild X-VCS-Directories: dev-python/pygobject/files/ dev-python/pygobject/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: f52a24017053437ee589d851942946283a4c9310 X-VCS-Branch: master Date: Thu, 8 Jun 2023 04:39:26 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: dc043264-6a5e-43f9-97d4-1f91f750c70f X-Archives-Hash: a7b390a0d7aae48044109f46b22fea68 commit: f52a24017053437ee589d851942946283a4c9310 Author: Michał Górny gentoo org> AuthorDate: Thu Jun 8 04:06:38 2023 +0000 Commit: Michał Górny gentoo org> CommitDate: Thu Jun 8 04:06:38 2023 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f52a2401 dev-python/pygobject: Replace our py3.12 sed with upstream fix Replace our cheap test hack using `.*` regex with upstream patch that conditionalizes the expected value per Python version. Signed-off-by: Michał Górny gentoo.org> .../pygobject/files/pygobject-3.44.1-py312.patch | 48 ++++++++++++++++++++++ dev-python/pygobject/pygobject-3.44.1.ebuild | 13 +++--- 2 files changed, 53 insertions(+), 8 deletions(-) diff --git a/dev-python/pygobject/files/pygobject-3.44.1-py312.patch b/dev-python/pygobject/files/pygobject-3.44.1-py312.patch new file mode 100644 index 000000000000..331e3bc0a3f8 --- /dev/null +++ b/dev-python/pygobject/files/pygobject-3.44.1-py312.patch @@ -0,0 +1,48 @@ +From fe6aedd8eebd92844b873f72e99dc4023316c6f3 Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Wed, 7 Jun 2023 22:27:55 +0200 +Subject: [PATCH] tests: fix test_gvalue_flat_array_in_item_marshal_failure for + Python 3.12 + +See https://gitlab.gnome.org/GNOME/pygobject/-/issues/582 + +_PyGI_ERROR_PREFIX() no longer works with 3.12 since we only get normalized +exceptions in there and can't add a prefix like "Item X: " to the message. + +Until we figure out how to add this back for 3.12, align the tests with the +new behaviour (the new exception notes API would be an option, see the +linked issue) +--- + tests/test_gi.py | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/tests/test_gi.py b/tests/test_gi.py +index 25a3b659..261d8b2b 100644 +--- a/tests/test_gi.py ++++ b/tests/test_gi.py +@@ -1573,9 +1573,12 @@ class TestGValue(unittest.TestCase): + self.assertRaises(OverflowError, GIMarshallingTests.gvalue_flat_array, + [GLib.MININT - 1, "42", True]) + ++ # FIXME: https://gitlab.gnome.org/GNOME/pygobject/-/issues/582#note_1764164 ++ exc_prefix = "Item 0: " if sys.version_info[:2] < (3, 12) else "" ++ + with pytest.raises( + OverflowError, +- match='Item 0: %d not in range %d to %d' % ( ++ match=exc_prefix + '%d not in range %d to %d' % ( + GLib.MAXINT + 1, GLib.MININT, GLib.MAXINT)): + GIMarshallingTests.gvalue_flat_array([GLib.MAXINT + 1, "42", True]) + +@@ -1583,7 +1586,7 @@ class TestGValue(unittest.TestCase): + + with pytest.raises( + OverflowError, +- match='Item 0: %d not in range %d to %d' % ( ++ match=exc_prefix + '%d not in range %d to %d' % ( + GLib.MAXUINT64 * 2, min_, max_)): + GIMarshallingTests.gvalue_flat_array([GLib.MAXUINT64 * 2, "42", True]) + +-- +GitLab + diff --git a/dev-python/pygobject/pygobject-3.44.1.ebuild b/dev-python/pygobject/pygobject-3.44.1.ebuild index 231063a2d18f..713c63dc4584 100644 --- a/dev-python/pygobject/pygobject-3.44.1.ebuild +++ b/dev-python/pygobject/pygobject-3.44.1.ebuild @@ -44,14 +44,11 @@ BDEPEND=" virtual/pkgconfig " -src_prepare() { - # workaround minor py3.12 test failure - # (I wish we could just use EPYTEST_DESELECT here, sigh) - # https://gitlab.gnome.org/GNOME/pygobject/-/issues/582 - sed -i -e 's@Item 0: @.*@' tests/test_gi.py || die - - distutils-r1_src_prepare -} +PATCHES=( + # fix test failure on py3.12 + # https://gitlab.gnome.org/GNOME/pygobject/-/commit/fe6aedd8eebd92844b873f72e99dc4023316c6f3 + "${FILESDIR}/${P}-py312.patch" +) python_configure() { local emesonargs=(