Sync from SUSE:SLFO:Main python-oauthlib revision e39ac4d520f740113990caf70f75f22d

This commit is contained in:
2025-03-28 16:41:04 +01:00
parent 1c258dbc9b
commit 30184471df
3 changed files with 56 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
From 6cbbd16bf7ac0ee6af68dc900cbaa734c52343c8 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'

View File

@@ -1,3 +1,14 @@
-------------------------------------------------------------------
Tue Sep 24 12:27:53 UTC 2024 - ecsos <ecsos@opensuse.org>
- Fix build error under Leap.
-------------------------------------------------------------------
Mon Sep 9 10:18:06 UTC 2024 - John Paul Adrian Glaubitz <adrian.glaubitz@suse.com>
- Cherry-pick upstream patch to make UtilsTests.test_filter_params Python 3.13+ compatible
* Make-UtilsTests.test_filter_params-Python-3.13-compatible.patch
-------------------------------------------------------------------
Mon Aug 12 08:42:35 UTC 2024 - Daniel Garcia <daniel.garcia@suse.com>

View File

@@ -26,6 +26,8 @@ License: BSD-3-Clause
Group: Development/Languages/Python
URL: https://github.com/oauthlib/oauthlib
Source: https://files.pythonhosted.org/packages/source/o/oauthlib/oauthlib-%{version}.tar.gz
# PATCH-FIX-UPSTREAM gh/oauthlib/oauthlib#866 - Make UtilsTests.test_filter_params Python 3.13+ compatible
Patch1: https://github.com/oauthlib/oauthlib/pull/866.patch#/Make-UtilsTests.test_filter_params-Python-3.13-compatible.patch
BuildRequires: %{python_module PyJWT >= 2.0.0}
BuildRequires: %{python_module blinker >= 1.4}
BuildRequires: %{python_module cryptography >= 3.0.0 }
@@ -59,12 +61,18 @@ veneer on top of OAuthLib and get OAuth support for very little effort.
%prep
%setup -q -n oauthlib-%{version}
%patch -P 1 -p1
%build
%python_build
%install
%python_install
# Fix python-bytecode-inconsistent-mtime
pushd %{buildroot}%{python_sitelib}
find . -name '*.pyc' -exec rm -f '{}' ';'
python%python_bin_suffix -m compileall *.py ';'
popd
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check