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

Signed-off-by: Michał Górny <mgorny@gentoo.org>
This commit is contained in:
Michał Górny 2024-06-12 07:51:16 +02:00
parent 58f3a4a36c
commit f4d57558f7
No known key found for this signature in database
GPG Key ID: 639ADAE2329E240E
2 changed files with 48 additions and 1 deletions

View File

@ -0,0 +1,42 @@
From 4f916edb457eb02bede0a7c4a64741ef13709af7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
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 <mgorny@gentoo.org>
---
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

View File

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