summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2024-06-10 18:41:56 +0200
committerMichał Górny <mgorny@gentoo.org>2024-06-10 19:01:02 +0200
commita7cd89d2dc686343f0dd405a6f2fedb8380767c0 (patch)
treeb5d272a9e2c08c836e74dbc4da348672540b24b1 /dev-python/oauthlib
parentdev-python/aioresponses: Enable py3.13 (diff)
downloadgentoo-a7cd89d2dc686343f0dd405a6f2fedb8380767c0.tar.gz
gentoo-a7cd89d2dc686343f0dd405a6f2fedb8380767c0.tar.bz2
gentoo-a7cd89d2dc686343f0dd405a6f2fedb8380767c0.zip
dev-python/oauthlib: Enable py3.13
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python/oauthlib')
-rw-r--r--dev-python/oauthlib/files/oauthlib-3.2.2-py313.patch37
-rw-r--r--dev-python/oauthlib/oauthlib-3.2.2.ebuild9
2 files changed, 44 insertions, 2 deletions
diff --git a/dev-python/oauthlib/files/oauthlib-3.2.2-py313.patch b/dev-python/oauthlib/files/oauthlib-3.2.2-py313.patch
new file mode 100644
index 000000000000..2d000e5e1b1b
--- /dev/null
+++ b/dev-python/oauthlib/files/oauthlib-3.2.2-py313.patch
@@ -0,0 +1,37 @@
+From fe020db74199d5284c00d7735aa7d4ddc90f5d61 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
+Date: Tue, 24 Oct 2023 15:08:10 +0200
+Subject: [PATCH] Make UtilsTests.test_filter_params Python 3.13+ compatible
+
+Since Python 3.13.0a1, docstrings are automatically dedented.
+See https://github.com/python/cpython/issues/81283
+and https://docs.python.org/3.13/whatsnew/3.13.html#other-language-changes
+
+As a result, using a docstring with leading space as a test case
+breaks the test assumption.
+
+The initial commit which introduced this test a decade ago
+(6c0c7914f3a57823834b1be492b307992f943629)
+does not specify why testing the spaces is important.
+---
+ tests/oauth1/rfc5849/test_utils.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/tests/oauth1/rfc5849/test_utils.py b/tests/oauth1/rfc5849/test_utils.py
+index 013c71a9..22128908 100644
+--- a/tests/oauth1/rfc5849/test_utils.py
++++ b/tests/oauth1/rfc5849/test_utils.py
+@@ -53,11 +53,11 @@ def test_filter_params(self):
+ # The following is an isolated test function used to test the filter_params decorator.
+ @filter_params
+ def special_test_function(params, realm=None):
+- """ I am a special test function """
++ """I am a special test function"""
+ return 'OAuth ' + ','.join(['='.join([k, v]) for k, v in params])
+
+ # check that the docstring got through
+- self.assertEqual(special_test_function.__doc__, " I am a special test function ")
++ self.assertEqual(special_test_function.__doc__, "I am a special test function")
+
+ # Check that the decorator filtering works as per design.
+ # Any param that does not start with 'oauth'
diff --git a/dev-python/oauthlib/oauthlib-3.2.2.ebuild b/dev-python/oauthlib/oauthlib-3.2.2.ebuild
index 74d6c2f9c0ab..51553f97b2fb 100644
--- a/dev-python/oauthlib/oauthlib-3.2.2.ebuild
+++ b/dev-python/oauthlib/oauthlib-3.2.2.ebuild
@@ -1,10 +1,10 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
DISTUTILS_USE_PEP517=setuptools
-PYTHON_COMPAT=( python3_{10..12} )
+PYTHON_COMPAT=( python3_{10..13} )
inherit distutils-r1 pypi
@@ -26,3 +26,8 @@ RDEPEND="
"
distutils_enable_tests unittest
+
+PATCHES=(
+ # https://github.com/oauthlib/oauthlib/commit/fe020db74199d5284c00d7735aa7d4ddc90f5d61
+ "${FILESDIR}/${P}-py313.patch"
+)