diff options
Diffstat (limited to 'dev-python/webtest')
-rw-r--r-- | dev-python/webtest/Manifest | 5 | ||||
-rw-r--r-- | dev-python/webtest/files/webtest-3.0.0-python3.12-unittest.patch | 115 | ||||
-rw-r--r-- | dev-python/webtest/metadata.xml | 1 | ||||
-rw-r--r-- | dev-python/webtest/webtest-3.0.0-r1.ebuild | 4 |
4 files changed, 122 insertions, 3 deletions
diff --git a/dev-python/webtest/Manifest b/dev-python/webtest/Manifest index 54b3ae9470d7..b1415eb71886 100644 --- a/dev-python/webtest/Manifest +++ b/dev-python/webtest/Manifest @@ -1,4 +1,5 @@ AUX webtest-2.0.33-no-pylons-theme.patch 1556 BLAKE2B e108d05467d87aa0dcc50e8a9fcb8032eeabdf6801d5a66fa9cbe6f51b6dd4539c71b4ff1cf0ef39edfee689e51a6e67e30e473fffa8f2db9225ff23e3b4619b SHA512 6423cc275c2774b07819079d8fe8478cf2b322c16860b600dbd039480a8883252046a6c9fc2136ec4ff54a8adbfceeb3a8ee4a7e43faea17ec588f42a5eafd5e +AUX webtest-3.0.0-python3.12-unittest.patch 5174 BLAKE2B 5329bd81f6a11e27734cc4c5af42a26d32ce853f309a8da80433e35585a85403cbd93e3379deaac4dd464bfcd8dab16f025039321d4ad8fa5213d54b41e5a09d SHA512 8d79c895c10a2b3709dc59dd71d023777e93f6a8b3373af73e0b9e157069d81c8f734221b74b67067ba74d891b23b7b946238a158f3c554773971f0aad5e9076 DIST WebTest-3.0.0.tar.gz 75871 BLAKE2B e97d050c1077d74e463e3409580d021424f755933bb9d5ac5e119c70c76890d5632e565f03a02f3497e21fed95158c56b199a877fc4575968f6b4af2655db8b6 SHA512 b97a6311d7e3bf653bec93c2390fb75c991d0dea6148680d8b6ff87861c130518a5d150dd157eab9b032b278566ad12c0ac8f5fc2ddbeba31e35de1e1f06f747 -EBUILD webtest-3.0.0-r1.ebuild 1017 BLAKE2B a44dc1d01cade6970957ba22b05689a84949ff97e0a6a7220c2a9d3b92fd1a2e43a1e92c58c8ffc25e8cee65a24120c235c108bcf19657783972f5b30b79a958 SHA512 a5ffe11a8fc32242bf71423377433bd1699861ad090d048f1a21398036eec55178b8b065ca39dae2c3fdfd366cbcff0ae9fa6547f761fbe440427720aa6f6402 -MISC metadata.xml 335 BLAKE2B 423ef6b809d06fc79897080a0a1d99beb5c8ed05ea68b0bb9d93076d21407b75f332478de3462a7f267b495b7d99d0ca8b05fc04f2420ad05df7151048655b95 SHA512 c4f686825404a8be87906b4492ce190e9dd350eed9a9ddbe765f48e296e771be0db4937c608e49ff2b8a7d82c63e1d62cd84a67cfe57bfc1622e2223f8b8ee70 +EBUILD webtest-3.0.0-r1.ebuild 1131 BLAKE2B d60661b5154b091e8d62247dffac7234d21af38916a9a8f17a1eaa123cd3fdc628eb25e732bf23ab7487c75a3b5180110ee00138cf92dfb62dc4d1af2220cb5a SHA512 64054381f02a42ea263f7c6ab322dfae32f235b060e897079f9d483162d61bd65d08680f442629570d7b7fff69b9e8f3689c102562641e4281e76699f7483798 +MISC metadata.xml 389 BLAKE2B 8cce21b0f8aed22e408af586691c2bcb8cfbf36af3ecf4a08de924f973e5cc4f49fc598ff1a2f651b81605ede0fa22b41518c29866703e4601d5742b78139be4 SHA512 df2b2eb916f60a9c2bc3c0a4321c54ff579e91d11a8dd3ebdc6b4526299b9dbd77b8ec630449df29fba94a483c6ab318d914c7666cb6dcf36b220de1d2f63dbb diff --git a/dev-python/webtest/files/webtest-3.0.0-python3.12-unittest.patch b/dev-python/webtest/files/webtest-3.0.0-python3.12-unittest.patch new file mode 100644 index 000000000000..c797a8cbb0c9 --- /dev/null +++ b/dev-python/webtest/files/webtest-3.0.0-python3.12-unittest.patch @@ -0,0 +1,115 @@ +https://github.com/Pylons/webtest/pull/251 + +From d82ec5bd2cf3c7109a1d49ad9fa802ae1eae1763 Mon Sep 17 00:00:00 2001 +From: Sam James <sam@gentoo.org> +Date: Mon, 29 May 2023 15:54:28 +0100 +Subject: [PATCH] Replace deprecated unittest aliases for Python 3.12 + +See https://docs.python.org/3.12/whatsnew/3.12.html#removed. +--- a/tests/test_app.py ++++ b/tests/test_app.py +@@ -221,7 +221,7 @@ def cookie_app(environ, start_response): + ('Set-Cookie', 'foo=bar;baz'), + ]) + else: +- self.assertEquals(dict(req.cookies), ++ self.assertEqual(dict(req.cookies), + {'spam': 'eggs', 'foo': 'bar'}) + self.assertIn('foo=bar', environ['HTTP_COOKIE']) + self.assertIn('spam=eggs', environ['HTTP_COOKIE']) +@@ -258,7 +258,7 @@ def cookie_app(environ, start_response): + ('Set-Cookie', 'foo=bar;baz; secure'), + ]) + else: +- self.assertEquals(dict(req.cookies), ++ self.assertEqual(dict(req.cookies), + {'spam': 'eggs', 'foo': 'bar'}) + self.assertIn('foo=bar', environ['HTTP_COOKIE']) + self.assertIn('spam=eggs', environ['HTTP_COOKIE']) +--- a/tests/test_authorisation.py ++++ b/tests/test_authorisation.py +@@ -17,7 +17,7 @@ def test_basic_authorization(self): + app.authorization = authorization + + self.assertIn('HTTP_AUTHORIZATION', app.extra_environ) +- self.assertEquals(app.authorization, authorization) ++ self.assertEqual(app.authorization, authorization) + + resp = app.get('/') + resp.mustcontain('HTTP_AUTHORIZATION: Basic Z2F3ZWw6cGFzc3dk') +@@ -26,7 +26,7 @@ def test_basic_authorization(self): + authtype, value = header.split(' ') + auth = (authtype, + b64decode(to_bytes(value)).decode('latin1').split(':')) +- self.assertEquals(authorization, auth) ++ self.assertEqual(authorization, auth) + + app.authorization = None + self.assertNotIn('HTTP_AUTHORIZATION', app.extra_environ) +@@ -37,7 +37,7 @@ def test_bearer_authorization(self): + app.authorization = authorization + + self.assertIn('HTTP_AUTHORIZATION', app.extra_environ) +- self.assertEquals(app.authorization, authorization) ++ self.assertEqual(app.authorization, authorization) + + resp = app.get('/') + resp.mustcontain('HTTP_AUTHORIZATION: Bearer 2588409761fcfa3e378bff4fb766e2e2') +--- a/tests/test_forms.py ++++ b/tests/test_forms.py +@@ -1031,7 +1031,7 @@ def test_upload_invalid_content(self): + single_form.submit("button") + except ValueError: + e = sys.exc_info()[1] +- self.assertEquals( ++ self.assertEqual( + str(e), + u('File content must be %s not %s' % (bytes, int)) + ) +--- a/tests/test_lint.py ++++ b/tests/test_lint.py +@@ -62,15 +62,15 @@ class TestMiddleware(unittest.TestCase): + @unittest.skipIf(sys.flags.optimize > 0, "skip assert tests if optimize is enabled") + def test_lint_too_few_args(self): + linter = middleware(application) +- with self.assertRaisesRegexp(AssertionError, "Two arguments required"): ++ with self.assertRaisesRegex(AssertionError, "Two arguments required"): + linter() +- with self.assertRaisesRegexp(AssertionError, "Two arguments required"): ++ with self.assertRaisesRegex(AssertionError, "Two arguments required"): + linter({}) + + @unittest.skipIf(sys.flags.optimize > 0, "skip assert tests if optimize is enabled") + def test_lint_no_keyword_args(self): + linter = middleware(application) +- with self.assertRaisesRegexp(AssertionError, "No keyword arguments " ++ with self.assertRaisesRegex(AssertionError, "No keyword arguments " + "allowed"): + linter({}, 'foo', baz='baz') + +@@ -82,7 +82,7 @@ def test_lint_no_keyword_args(self): + def test_lint_iterator_returned(self): + linter = middleware(lambda x, y: None) # None is not an iterator + msg = "The application must return an iterator, if only an empty list" +- with self.assertRaisesRegexp(AssertionError, msg): ++ with self.assertRaisesRegex(AssertionError, msg): + linter({'wsgi.input': 'foo', 'wsgi.errors': 'foo'}, 'foo') + + +@@ -109,13 +109,13 @@ def test_close(self): + def test_iter(self): + data = to_bytes("A line\nAnother line\nA final line\n") + input_wrapper = InputWrapper(BytesIO(data)) +- self.assertEquals(to_bytes("").join(input_wrapper), data, '') ++ self.assertEqual(to_bytes("").join(input_wrapper), data, '') + + def test_seek(self): + data = to_bytes("A line\nAnother line\nA final line\n") + input_wrapper = InputWrapper(BytesIO(data)) + input_wrapper.seek(0) +- self.assertEquals(to_bytes("").join(input_wrapper), data, '') ++ self.assertEqual(to_bytes("").join(input_wrapper), data, '') + + + class TestMiddleware2(unittest.TestCase): + diff --git a/dev-python/webtest/metadata.xml b/dev-python/webtest/metadata.xml index 1ce3308ecc21..8c9667576fc0 100644 --- a/dev-python/webtest/metadata.xml +++ b/dev-python/webtest/metadata.xml @@ -8,5 +8,6 @@ <stabilize-allarches/> <upstream> <remote-id type="pypi">WebTest</remote-id> + <remote-id type="github">Pylons/webtest</remote-id> </upstream> </pkgmetadata> diff --git a/dev-python/webtest/webtest-3.0.0-r1.ebuild b/dev-python/webtest/webtest-3.0.0-r1.ebuild index 8e4a5a67c8eb..55be134cdd50 100644 --- a/dev-python/webtest/webtest-3.0.0-r1.ebuild +++ b/dev-python/webtest/webtest-3.0.0-r1.ebuild @@ -6,7 +6,8 @@ EAPI=8 DISTUTILS_USE_PEP517=setuptools PYPI_NO_NORMALIZE=1 PYPI_PN="WebTest" -PYTHON_COMPAT=( python3_{9..11} pypy3 ) +# py3.12 should pass but pyquery doesn't yet support 3.12 +PYTHON_COMPAT=( python3_{10..11} pypy3 ) inherit distutils-r1 pypi @@ -37,6 +38,7 @@ BDEPEND=" PATCHES=( "${FILESDIR}/webtest-2.0.33-no-pylons-theme.patch" + "${FILESDIR}/webtest-3.0.0-python3.12-unittest.patch" ) distutils_enable_sphinx docs |