commit:     f4d57558f7662efb03f1bbbea58c18f73b6e0005
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 12 05:51:16 2024 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Jun 12 05:58:22 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f4d57558

dev-python/oslo-config: Enable py3.13

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

 .../files/oslo-config-9.4.0-py313.patch            | 42 ++++++++++++++++++++++
 dev-python/oslo-config/oslo-config-9.4.0.ebuild    |  7 +++-
 2 files changed, 48 insertions(+), 1 deletion(-)

diff --git a/dev-python/oslo-config/files/oslo-config-9.4.0-py313.patch 
b/dev-python/oslo-config/files/oslo-config-9.4.0-py313.patch
new file mode 100644
index 000000000000..b3e6979f9e4f
--- /dev/null
+++ b/dev-python/oslo-config/files/oslo-config-9.4.0-py313.patch
@@ -0,0 +1,42 @@
+From 4f916edb457eb02bede0a7c4a64741ef13709af7 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <[email protected]>
+Date: Wed, 12 Jun 2024 07:47:18 +0200
+Subject: [PATCH] Fix tests for Python 3.13
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Fix expected argparse --help output to account for changes in Python
+3.13.
+
+Closes-Bug: 2069108
+Change-Id: Ie221e5f5b369930f015a74998f50ddb473b53b94
+Signed-off-by: Michał Górny <[email protected]>
+---
+ oslo_config/tests/test_cfg.py | 10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/oslo_config/tests/test_cfg.py b/oslo_config/tests/test_cfg.py
+index 926eb8c..f69f7a0 100644
+--- a/oslo_config/tests/test_cfg.py
++++ b/oslo_config/tests/test_cfg.py
+@@ -264,8 +264,14 @@ class HelpTestCase(BaseTestCase):
+         self.conf.register_cli_opt(uvw)
+         self.conf([])
+         self.conf.print_help(file=f)
+-        self.assertIn('--a-bc A_BC, --d-ef A_BC, --d_ef A_BC', f.getvalue())
+-        self.assertIn('--u-vw U_VW, --x-yz U_VW, --x_yz U_VW', f.getvalue())
++        if sys.version_info >= (3, 13):
++            self.assertIn('--a-bc, --d-ef, --d_ef A_BC', f.getvalue())
++            self.assertIn('--u-vw, --x-yz, --x_yz U_VW', f.getvalue())
++        else:
++            self.assertIn('--a-bc A_BC, --d-ef A_BC, --d_ef A_BC',
++                          f.getvalue())
++            self.assertIn('--u-vw U_VW, --x-yz U_VW, --x_yz U_VW',
++                          f.getvalue())
+ 
+ 
+ class FindConfigFilesTestCase(BaseTestCase):
+-- 
+2.45.2
+

diff --git a/dev-python/oslo-config/oslo-config-9.4.0.ebuild 
b/dev-python/oslo-config/oslo-config-9.4.0.ebuild
index 8a5bbb36170a..69c20f0f2f3d 100644
--- a/dev-python/oslo-config/oslo-config-9.4.0.ebuild
+++ b/dev-python/oslo-config/oslo-config-9.4.0.ebuild
@@ -6,7 +6,7 @@ EAPI=8
 DISTUTILS_USE_PEP517=setuptools
 PYPI_NO_NORMALIZE=1
 PYPI_PN=${PN/-/.}
-PYTHON_COMPAT=( python3_{10..12} )
+PYTHON_COMPAT=( python3_{10..13} )
 
 inherit distutils-r1 pypi
 
@@ -46,6 +46,11 @@ BDEPEND="
 distutils_enable_tests unittest
 
 src_prepare() {
+       local PATCHES=(
+               # https://review.opendev.org/c/openstack/oslo.log/+/921797
+               "${FILESDIR}/${P}-py313.patch"
+       )
+
        # broken by some dep upgrade
        sed -i -e '/DeprecationWarningTestsNoOsloLog/,$d' \
                oslo_config/tests/test_cfg.py || die

Reply via email to