summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur Zamarin <arthurzam@gentoo.org>2022-07-15 15:12:03 +0300
committerArthur Zamarin <arthurzam@gentoo.org>2022-07-15 15:13:40 +0300
commitd66618100ede704ce4371fbe1fd031723869e022 (patch)
tree20e8d03296463cebbebdf7b9d994841281fc806a /dev-python/oslo-i18n
parentdev-python/netifaces: enable py3.11 (diff)
downloadgentoo-d66618100ede704ce4371fbe1fd031723869e022.tar.gz
gentoo-d66618100ede704ce4371fbe1fd031723869e022.tar.bz2
gentoo-d66618100ede704ce4371fbe1fd031723869e022.zip
dev-python/oslo-i18n: enable py3.11
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
Diffstat (limited to 'dev-python/oslo-i18n')
-rw-r--r--dev-python/oslo-i18n/files/oslo-i18n-5.1.0-fix-py3.11.patch22
-rw-r--r--dev-python/oslo-i18n/files/oslo-i18n-5.1.0-fix-py3.11.patch.bck14
-rw-r--r--dev-python/oslo-i18n/oslo-i18n-5.1.0-r1.ebuild6
3 files changed, 41 insertions, 1 deletions
diff --git a/dev-python/oslo-i18n/files/oslo-i18n-5.1.0-fix-py3.11.patch b/dev-python/oslo-i18n/files/oslo-i18n-5.1.0-fix-py3.11.patch
new file mode 100644
index 000000000000..488dac1dedc6
--- /dev/null
+++ b/dev-python/oslo-i18n/files/oslo-i18n-5.1.0-fix-py3.11.patch
@@ -0,0 +1,22 @@
+diff --git a/oslo_i18n/tests/test_message.py b/oslo_i18n/tests/test_message.py
+index 85dbd67..16492bb 100644
+--- a/oslo_i18n/tests/test_message.py
++++ b/oslo_i18n/tests/test_message.py
+@@ -386,7 +386,7 @@ class MessageTestCase(test_base.BaseTestCase):
+
+ self.assertEqual(default_translation, msg.translation('es'))
+
+- self.assertEqual(1, len(w))
++ self.assertLessEqual(1, len(w))
+ # Note(gibi): in python 3.4 str.__repr__ does not put the unicode
+ # marker 'u' in front of the string representations so the test
+ # removes that to have the same result in python 2.7 and 3.4
+@@ -394,7 +394,7 @@ class MessageTestCase(test_base.BaseTestCase):
+ "translated message A message in Spanish: %s %s "
+ "(Original: 'A message: %s'): "
+ "not enough arguments for format string",
+- str(w[0].message).replace("u'", "'"))
++ str(w[-1].message).replace("u'", "'"))
+
+ mock_log.debug.assert_called_with(('Failed to insert replacement '
+ 'values into translated message '
diff --git a/dev-python/oslo-i18n/files/oslo-i18n-5.1.0-fix-py3.11.patch.bck b/dev-python/oslo-i18n/files/oslo-i18n-5.1.0-fix-py3.11.patch.bck
new file mode 100644
index 000000000000..2faae7eb88af
--- /dev/null
+++ b/dev-python/oslo-i18n/files/oslo-i18n-5.1.0-fix-py3.11.patch.bck
@@ -0,0 +1,14 @@
+On python 3.11, we have some more warnings (deprecation warnings),
+so the count is >=1
+
+--- a/oslo_i18n/tests/test_message.py
++++ b/oslo_i18n/tests/test_message.py
+@@ -386,7 +386,7 @@ class MessageTestCase(test_base.BaseTestCase):
+
+ self.assertEqual(default_translation, msg.translation('es'))
+
+- self.assertEqual(1, len(w))
++ self.assertLessEqual(1, len(w))
+ # Note(gibi): in python 3.4 str.__repr__ does not put the unicode
+ # marker 'u' in front of the string representations so the test
+ # removes that to have the same result in python 2.7 and 3.4
diff --git a/dev-python/oslo-i18n/oslo-i18n-5.1.0-r1.ebuild b/dev-python/oslo-i18n/oslo-i18n-5.1.0-r1.ebuild
index 7053c73f76d7..0dd4662cf5a3 100644
--- a/dev-python/oslo-i18n/oslo-i18n-5.1.0-r1.ebuild
+++ b/dev-python/oslo-i18n/oslo-i18n-5.1.0-r1.ebuild
@@ -4,7 +4,7 @@
EAPI=8
DISTUTILS_USE_PEP517=setuptools
-PYTHON_COMPAT=( python3_{8..10} )
+PYTHON_COMPAT=( python3_{8..11} )
inherit distutils-r1
@@ -24,6 +24,10 @@ LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="amd64 ~arm arm64 ~riscv x86"
+PATCHES=(
+ "${FILESDIR}/${PN}-5.1.0-fix-py3.11.patch"
+)
+
RDEPEND="
>=dev-python/pbr-2.0.0[${PYTHON_USEDEP}]
"