summaryrefslogtreecommitdiff
path: root/dev-python/python-glanceclient
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2024-07-09 12:24:59 +0100
committerV3n3RiX <venerix@koprulu.sector>2024-07-09 12:24:59 +0100
commitc218398bbbe70a616790cf146c28c1066b9284bf (patch)
treea598e8c85afbc52bb7eca18ae415ef4971e65c8f /dev-python/python-glanceclient
parenta5442e2318cb4df55867389654e322dbac82067e (diff)
gentoo auto-resync : 09:07:2024 - 12:24:58
Diffstat (limited to 'dev-python/python-glanceclient')
-rw-r--r--dev-python/python-glanceclient/Manifest3
-rw-r--r--dev-python/python-glanceclient/files/python-glanceclient-4.6.0-test-py3.13.patch66
-rw-r--r--dev-python/python-glanceclient/python-glanceclient-4.6.0.ebuild6
3 files changed, 73 insertions, 2 deletions
diff --git a/dev-python/python-glanceclient/Manifest b/dev-python/python-glanceclient/Manifest
index d9d7c0c12c9a..d5737890cea4 100644
--- a/dev-python/python-glanceclient/Manifest
+++ b/dev-python/python-glanceclient/Manifest
@@ -1,4 +1,5 @@
+AUX python-glanceclient-4.6.0-test-py3.13.patch 3309 BLAKE2B 10d1b031f0cc4014cb4a7027b4d7af5f3f271cc3bf7e7dc8222a9e81cb93e2e2351e1812d3a371da9eba09ae7eac39b9492005b2ca341849cb8820591c7abc7d SHA512 cd699eacd600df4aabdb67ec7017419023d48bbdef25909326bd722c0b8a8b4291edc71090ae32b2207e8fb1f2b0a2dd2c6de46dda50ddad11e40c510d1dd87e
AUX python-glanceclient-4.6.0-test.patch 4172 BLAKE2B 3b2d7c7e132cb3a71e1be0f9a6306915ab757d83e814b88acec0a45f8bb44d0c22e428094c03dd6bdf786c12276883412cd979560fa33129039631429ae4aaa9 SHA512 75b5f8a1f85ae68f330d4c8370b06ac3be5f09285df4c608469b00f815332ec38de337075ad4053c64044bc2d2fe6e0d1ebf461aae81385888a344c24fc82bbc
DIST python-glanceclient-4.6.0.tar.gz 206480 BLAKE2B 302414b0fcf85ec9a8e53e9bf43c5801df82826524780249e9c4b46b44ca2e53c1c5d63f6e80c73dee2a59009a3e0aa1df591ecb2a4d000b74ee078b4810de2c SHA512 ed9d554d40a03134bc8871fbf712dd4bb2aab5e18854fd9c07df0d20dead1a9f3473bc4253ba4dd8c87cf7227148c637718461d45cd01bd9aaf673f7fc7ee9fc
-EBUILD python-glanceclient-4.6.0.ebuild 1632 BLAKE2B b9d8adb43d349522f0c37e31d6fd21884296453553c60a242c2f0937422f59fc68c387bfd2d963b82b2371644e5d6b4fda2cd2032e0579823a83743618a1016a SHA512 beaa52e032052131752ae7133cf65bccb06fa4dcb8b33dd2d38abe66db4260eaefdf775426fd4cd3617c9348233231c1879d4fe31766c524c1918d1a3c16d505
+EBUILD python-glanceclient-4.6.0.ebuild 1785 BLAKE2B 19c84066ca8e55d86f03b7985d7edba8baa5dabc165d937dfecceb884931794ac246886aa2f15d00c47b80eccd3a5485af37696e370478a131c462ddde489185 SHA512 0aa7dbfd4704294b5ed1bfc5b60732bfbc7438a8c5cc7b801c7641f48583f6d9852a90e769418f64d5ed1ee4da40175bad0b20549eb47d8d339f7e319d819abd
MISC metadata.xml 663 BLAKE2B 642540f3f4d577797725731f2374b5801ec2d4ad799ee4ccfaa4e29d955bd93a8ade0e6c9ec7712ee27d9f1f93186854472d301016a732020575b8f7bc1c5138 SHA512 fa9b88dce5a10824dd0d6987698587666343c95d8b6c607e466f14883c34fb0ebc846b683ae7d8bb65efe88007e6db0d2b1b41ba389c3b656a24f1839d03d9e2
diff --git a/dev-python/python-glanceclient/files/python-glanceclient-4.6.0-test-py3.13.patch b/dev-python/python-glanceclient/files/python-glanceclient-4.6.0-test-py3.13.patch
new file mode 100644
index 000000000000..b1760f8b87af
--- /dev/null
+++ b/dev-python/python-glanceclient/files/python-glanceclient-4.6.0-test-py3.13.patch
@@ -0,0 +1,66 @@
+From 6aa007080e1db0f95b04824f42a6b52cbd5ff886 Mon Sep 17 00:00:00 2001
+From: Petr Vaněk <arkamar@atlas.cz>
+Date: Mon, 08 Jul 2024 12:01:15 +0200
+Subject: [PATCH] Python 3.13 test fixes
+
+Python 3.13 newly calls close in mock_open [1], which makes two
+_cache_schemas related tests fail because they expect different amount
+of mock_calls. This fix makes the expected check results conditional
+based on python version.
+
+[1] https://github.com/python/cpython/commit/3f7c0810f6158a7ff37be432f8d7f9511427489f
+
+Change-Id: I8b019f73fe3a9f28f114c95321a1da0feadf750f
+
+Upstream-PR: https://review.opendev.org/c/openstack/python-glanceclient/+/923628
+
+diff --git a/glanceclient/tests/unit/test_shell.py b/glanceclient/tests/unit/test_shell.py
+index 4a123ab..ea835c4 100644
+--- a/glanceclient/tests/unit/test_shell.py
++++ b/glanceclient/tests/unit/test_shell.py
+@@ -786,14 +786,19 @@ class ShellCacheSchemaTest(testutils.TestCase):
+ client = self.shell._get_versioned_client('2', args)
+ self.shell._cache_schemas(args, client, home_dir=self.cache_dir)
+
+- self.assertEqual(12, open.mock_calls.__len__())
++ # see https://github.com/python/cpython/commit/3f7c0810f6158a7ff37be432f8d7f9511427489f
++ expected_count = 12 if sys.version_info < (3, 13) else 15
++ open_idx = 4 if sys.version_info < (3, 13) else 5
++ write_idx = 6 if sys.version_info < (3, 13) else 7
++
++ self.assertEqual(expected_count, open.mock_calls.__len__())
+ self.assertEqual(mock.call(self.cache_files[0], 'w'),
+ open.mock_calls[0])
+ self.assertEqual(mock.call(self.cache_files[1], 'w'),
+- open.mock_calls[4])
++ open.mock_calls[open_idx])
+ actual = json.loads(open.mock_calls[2][1][0])
+ self.assertEqual(schema_odict, actual)
+- actual = json.loads(open.mock_calls[6][1][0])
++ actual = json.loads(open.mock_calls[write_idx][1][0])
+ self.assertEqual(schema_odict, actual)
+
+ @mock.patch('builtins.open', new=mock.mock_open(), create=True)
+@@ -809,14 +814,19 @@ class ShellCacheSchemaTest(testutils.TestCase):
+ client = self.shell._get_versioned_client('2', args)
+ self.shell._cache_schemas(args, client, home_dir=self.cache_dir)
+
+- self.assertEqual(12, open.mock_calls.__len__())
++ # see https://github.com/python/cpython/commit/3f7c0810f6158a7ff37be432f8d7f9511427489f
++ expected_count = 12 if sys.version_info < (3, 13) else 15
++ open_idx = 4 if sys.version_info < (3, 13) else 5
++ write_idx = 6 if sys.version_info < (3, 13) else 7
++
++ self.assertEqual(expected_count, open.mock_calls.__len__())
+ self.assertEqual(mock.call(self.cache_files[0], 'w'),
+ open.mock_calls[0])
+ self.assertEqual(mock.call(self.cache_files[1], 'w'),
+- open.mock_calls[4])
++ open.mock_calls[open_idx])
+ actual = json.loads(open.mock_calls[2][1][0])
+ self.assertEqual(schema_odict, actual)
+- actual = json.loads(open.mock_calls[6][1][0])
++ actual = json.loads(open.mock_calls[write_idx][1][0])
+ self.assertEqual(schema_odict, actual)
+
+ @mock.patch('builtins.open', new=mock.mock_open(), create=True)
diff --git a/dev-python/python-glanceclient/python-glanceclient-4.6.0.ebuild b/dev-python/python-glanceclient/python-glanceclient-4.6.0.ebuild
index d1666fba6eca..b1ca97d43703 100644
--- a/dev-python/python-glanceclient/python-glanceclient-4.6.0.ebuild
+++ b/dev-python/python-glanceclient/python-glanceclient-4.6.0.ebuild
@@ -5,7 +5,7 @@ EAPI=8
DISTUTILS_USE_PEP517=setuptools
PYPI_NO_NORMALIZE=1
-PYTHON_COMPAT=( python3_{10..12} )
+PYTHON_COMPAT=( python3_{10..13} )
inherit distutils-r1 pypi
@@ -50,6 +50,10 @@ PATCHES=(
# https://bugs.launchpad.net/python-glanceclient/+bug/2069684
# https://bugs.launchpad.net/python-glanceclient/+bug/2069682
"${FILESDIR}/${P}-test.patch"
+
+ # py3.13 added close() to mock_open calls
+ # https://review.opendev.org/c/openstack/python-glanceclient/+/923628
+ "${FILESDIR}/${P}-test-py3.13.patch"
)
python_test() {