From dd340cf7290bb9f89386952ab9dec21eaa9f117a7d08db804e4e8201cb8be75f Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Fri, 24 Jul 2020 02:14:24 +0000 Subject: [PATCH] Accepting request 822499 from home:sebix:branches:devel:languages:python - remove patch pr_5251-pytest5.patch, not needed anymore. - update to version 2.24.0: - pyOpenSSL TLS implementation is now only used if Python either doesn't have an `ssl` module or doesn't support SNI. Previously pyOpenSSL was unconditionally used if available. This applies even if pyOpenSSL is installed via the `requests[security]` extra (#5443) - Redirect resolution should now only occur when `allow_redirects` is True. (#5492) - No longer perform unnecessary Content-Length calculation for requests that won't use it. (#5496) OBS-URL: https://build.opensuse.org/request/show/822499 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-requests?expand=0&rev=142 --- pr_5251-pytest5.patch | 94 ----------------------------------------- python-requests.changes | 15 +++++++ python-requests.spec | 3 +- requests-2.23.0.tar.gz | 3 -- requests-2.24.0.tar.gz | 3 ++ 5 files changed, 19 insertions(+), 99 deletions(-) delete mode 100644 pr_5251-pytest5.patch delete mode 100644 requests-2.23.0.tar.gz create mode 100644 requests-2.24.0.tar.gz diff --git a/pr_5251-pytest5.patch b/pr_5251-pytest5.patch deleted file mode 100644 index 93fa30e..0000000 --- a/pr_5251-pytest5.patch +++ /dev/null @@ -1,94 +0,0 @@ -From 9da8a963868c1019fb02691c54c493ca1549e6bb Mon Sep 17 00:00:00 2001 -From: John Vandenberg -Date: Fri, 1 Nov 2019 14:04:43 +0700 -Subject: [PATCH 1/2] test_requests: Support pytest assert rewriting - -The real exception has moved to e.value, when pytest -wraps the exception, however it wasnt wrapped in one -case for pytest 3, so add backwards compatibility. ---- - tests/test_requests.py | 12 +++++++----- - 1 file changed, 7 insertions(+), 5 deletions(-) - -diff --git a/tests/test_requests.py b/tests/test_requests.py -index 7d4a4eb51..75366d10b 100644 ---- a/tests/test_requests.py -+++ b/tests/test_requests.py -@@ -1692,7 +1692,7 @@ def __iter__(self): - with pytest.raises(UnrewindableBodyError) as e: - requests.utils.rewind_body(prep) - -- assert 'Unable to rewind request body' in str(e) -+ assert 'Unable to rewind request body' in str(e.value) - - def test_rewind_body_failed_seek(self): - class BadFileObj: -@@ -1715,7 +1715,7 @@ def __iter__(self): - with pytest.raises(UnrewindableBodyError) as e: - requests.utils.rewind_body(prep) - -- assert 'error occurred when rewinding request body' in str(e) -+ assert 'error occurred when rewinding request body' in str(e.value) - - def test_rewind_body_failed_tell(self): - class BadFileObj: -@@ -1735,7 +1735,7 @@ def __iter__(self): - with pytest.raises(UnrewindableBodyError) as e: - requests.utils.rewind_body(prep) - -- assert 'Unable to rewind request body' in str(e) -+ assert 'Unable to rewind request body' in str(e.value) - - def _patch_adapter_gzipped_redirect(self, session, url): - adapter = session.get_adapter(url=url) -@@ -2155,7 +2155,7 @@ def test_stream_timeout(self, httpbin): - def test_invalid_timeout(self, httpbin, timeout, error_text): - with pytest.raises(ValueError) as e: - requests.get(httpbin('get'), timeout=timeout) -- assert error_text in str(e) -+ assert error_text in str(e.value) - - @pytest.mark.parametrize( - 'timeout', ( -@@ -2374,7 +2374,9 @@ def test_urllib3_pool_connection_closed(httpbin): - try: - s.get(httpbin('status/200')) - except ConnectionError as e: -- assert u"Pool is closed." in str(e) -+ # pytest only sometimes wraps this exception -+ real_exception = e.value if hasattr(e, 'value') else e -+ assert u"Pool is closed." in str(real_exception) - - - class TestPreparingURLs(object): - -From 119735dfef516ae33c89a9230653f91968444aa9 Mon Sep 17 00:00:00 2001 -From: John Vandenberg -Date: Fri, 1 Nov 2019 13:16:34 +0700 -Subject: [PATCH 2/2] test_conflicting_post_params: Update pytest.raises - -Move logic out of string passed to pytest.raises, into -the context of pytest.raises, as pytest no longer -supports pytest.raises execution of strings. ---- - tests/test_requests.py | 7 +++++-- - 1 file changed, 5 insertions(+), 2 deletions(-) - -diff --git a/tests/test_requests.py b/tests/test_requests.py -index 75366d10b..9554f39af 100644 ---- a/tests/test_requests.py -+++ b/tests/test_requests.py -@@ -774,8 +774,11 @@ def __len__(self): - def test_conflicting_post_params(self, httpbin): - url = httpbin('post') - with open('Pipfile') as f: -- pytest.raises(ValueError, "requests.post(url, data='[{\"some\": \"data\"}]', files={'some': f})") -- pytest.raises(ValueError, "requests.post(url, data=u('[{\"some\": \"data\"}]'), files={'some': f})") -+ with pytest.raises(ValueError): -+ requests.post(url, data='[{\"some\": \"data\"}]', files={'some': f}) -+ -+ with pytest.raises(ValueError): -+ requests.post(url, data=u('[{\"some\": \"data\"}]'), files={'some': f}) - - def test_request_ok_set(self, httpbin): - r = requests.get(httpbin('status', '404')) diff --git a/python-requests.changes b/python-requests.changes index c887038..8c00399 100644 --- a/python-requests.changes +++ b/python-requests.changes @@ -1,3 +1,18 @@ +------------------------------------------------------------------- +Thu Jul 23 18:47:44 UTC 2020 - Sebastian Wagner + +- remove patch pr_5251-pytest5.patch, not needed anymore. +- update to version 2.24.0: + - pyOpenSSL TLS implementation is now only used if Python + either doesn't have an `ssl` module or doesn't support + SNI. Previously pyOpenSSL was unconditionally used if available. + This applies even if pyOpenSSL is installed via the + `requests[security]` extra (#5443) + - Redirect resolution should now only occur when + `allow_redirects` is True. (#5492) + - No longer perform unnecessary Content-Length calculation for + requests that won't use it. (#5496) + ------------------------------------------------------------------- Mon Feb 24 15:19:16 UTC 2020 - Ondřej Súkup diff --git a/python-requests.spec b/python-requests.spec index 31dcccb..91e9517 100644 --- a/python-requests.spec +++ b/python-requests.spec @@ -26,7 +26,7 @@ %endif %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-requests%{psuffix} -Version: 2.23.0 +Version: 2.24.0 Release: 0 Summary: Python HTTP Library License: Apache-2.0 @@ -35,7 +35,6 @@ URL: http://python-requests.org/ Source: https://files.pythonhosted.org/packages/source/r/requests/requests-%{version}.tar.gz # PATCH-FIX-SUSE: do not hardcode versions in setup.py/requirements Patch0: requests-no-hardcoded-version.patch -Patch1: pr_5251-pytest5.patch BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros diff --git a/requests-2.23.0.tar.gz b/requests-2.23.0.tar.gz deleted file mode 100644 index ff73beb..0000000 --- a/requests-2.23.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b3f43d496c6daba4493e7c431722aeb7dbc6288f52a6e04e7b6023b0247817e6 -size 114327 diff --git a/requests-2.24.0.tar.gz b/requests-2.24.0.tar.gz new file mode 100644 index 0000000..ea777ba --- /dev/null +++ b/requests-2.24.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b3559a131db72c33ee969480840fff4bb6dd111de7dd27c8ee1f820f4f00231b +size 115071