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 D96DD15806E for ; Wed, 31 May 2023 10:50:08 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 1A609E08BD; Wed, 31 May 2023 10:50:08 +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 EFC34E08BD for ; Wed, 31 May 2023 10:50:07 +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 DA4D2340E8A for ; Wed, 31 May 2023 10:50:06 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 3FB9F990 for ; Wed, 31 May 2023 10:50:05 +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: <1685530194.48b5e659f3b13315b05445a6d2ddf11e02fdb2ad.mgorny@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/pbr/files/, dev-python/pbr/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-python/pbr/files/pbr-5.11.1-importlib-suffixes.patch dev-python/pbr/pbr-5.11.1.ebuild X-VCS-Directories: dev-python/pbr/files/ dev-python/pbr/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 48b5e659f3b13315b05445a6d2ddf11e02fdb2ad X-VCS-Branch: master Date: Wed, 31 May 2023 10:50:05 +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: aa7d7aed-8163-4d70-9823-85449d9fa3e8 X-Archives-Hash: 724c240644fd0e88d4f0e62ac31cb5f9 commit: 48b5e659f3b13315b05445a6d2ddf11e02fdb2ad Author: Petr Vaněk atlas cz> AuthorDate: Tue May 30 21:22:25 2023 +0000 Commit: Michał Górny gentoo org> CommitDate: Wed May 31 10:49:54 2023 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=48b5e659 dev-python/pbr: enable py3.12 - One test source file needs a patch due to removed library in py3.12, the patch was sent to github mirror[1] and later resend to upstream[2]. - Tests fail with dev-python/sphinx-7, because build_sphinx hook in setup.py was removed [3], sphinx is now limmited to atlas.cz> Signed-off-by: Michał Górny gentoo.org> .../pbr/files/pbr-5.11.1-importlib-suffixes.patch | 41 ++++++++++++++++++++++ dev-python/pbr/pbr-5.11.1.ebuild | 19 +++++++--- 2 files changed, 55 insertions(+), 5 deletions(-) diff --git a/dev-python/pbr/files/pbr-5.11.1-importlib-suffixes.patch b/dev-python/pbr/files/pbr-5.11.1-importlib-suffixes.patch new file mode 100644 index 000000000000..27609131fc59 --- /dev/null +++ b/dev-python/pbr/files/pbr-5.11.1-importlib-suffixes.patch @@ -0,0 +1,41 @@ +Subject: [PATCH] Replace imp with importlib.machinery + +The imp was removed in Python 3.12 [1]. This commit replaces +get_suffixes() method call with _SUFFIXES array from imprtlib.machinery. + +[1] https://github.com/python/cpython/issues/98040 + +--- + +This is original patch submitted to Github mirror, it was later resubmitted to +upstream Gerrit, where they are taking care of Python2.7. We can stick with +this version of patch for now because we don't care about py2.7 anymore. + +Original-PR: https://github.com/openstack/pbr/pull/22 +Upstream-PR: https://review.opendev.org/c/openstack/pbr/+/884789 + +diff --git a/pbr/tests/test_packaging.py b/pbr/tests/test_packaging.py +index c719d1e..068bab7 100644 +--- a/pbr/tests/test_packaging.py ++++ b/pbr/tests/test_packaging.py +@@ -40,7 +40,7 @@ + + import email + import email.errors +-import imp ++import importlib + import os + import re + import sysconfig +@@ -1217,7 +1217,7 @@ def get_soabi(): + # NOTE(sigmavirus24): PyPy only added support for the SOABI config var + # to sysconfig in 2015. That was well after 2.2.1 was published in the + # Ubuntu 14.04 archive. +- for suffix, _, _ in imp.get_suffixes(): ++ for suffix, _, _ in importlib.machinery._SUFFIXES: + if suffix.startswith('.pypy') and suffix.endswith('.so'): + soabi = suffix.split('.')[1] + break +-- +2.39.2 + diff --git a/dev-python/pbr/pbr-5.11.1.ebuild b/dev-python/pbr/pbr-5.11.1.ebuild index 016fd4a7679a..5448662cdd64 100644 --- a/dev-python/pbr/pbr-5.11.1.ebuild +++ b/dev-python/pbr/pbr-5.11.1.ebuild @@ -4,7 +4,7 @@ EAPI=8 DISTUTILS_USE_PEP517=setuptools -PYTHON_TESTED=( python3_{9..11} ) +PYTHON_TESTED=( python3_{10..12} ) PYTHON_COMPAT=( "${PYTHON_TESTED[@]}" pypy3 ) PYTHON_REQ_USE="threads(+)" @@ -24,9 +24,14 @@ KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv RDEPEND=" >=dev-python/setuptools-60.5.0[${PYTHON_USEDEP}] " -# git is needed for tests, see https://bugs.launchpad.net/pbr/+bug/1326682 and https://bugs.gentoo.org/show_bug.cgi?id=561038 -# docutils is needed for sphinx exceptions... https://bugs.gentoo.org/show_bug.cgi?id=603848 -# stestr is run as external tool + +# git is needed for tests, see https://bugs.launchpad.net/pbr/+bug/1326682 and +# https://bugs.gentoo.org/show_bug.cgi?id=561038 docutils is needed for sphinx +# exceptions... https://bugs.gentoo.org/show_bug.cgi?id=603848 stestr is run as +# external tool. +# +# =dev-python/fixtures-3.0.0[${PYTHON_USEDEP}] >=dev-python/mock-2.0.0[${PYTHON_USEDEP}] >=dev-python/six-1.12.0[${PYTHON_USEDEP}] - dev-python/sphinx[${PYTHON_USEDEP}] + =dev-python/testresources-2.0.0[${PYTHON_USEDEP}] >=dev-python/testscenarios-0.4[${PYTHON_USEDEP}] >=dev-python/testtools-2.2.0[${PYTHON_USEDEP}] @@ -44,6 +49,10 @@ BDEPEND=" ) " +PATCHES=( + "${FILESDIR}/${P}-importlib-suffixes.patch" +) + distutils_enable_tests unittest python_prepare_all() {