diff --git a/backport-remove-tests-that-use-the-tarpit.patch b/backport-remove-tests-that-use-the-tarpit.patch deleted file mode 100644 index 4a9ea3e7edf294e1e4e03c697ade8f8d288f7e61..0000000000000000000000000000000000000000 --- a/backport-remove-tests-that-use-the-tarpit.patch +++ /dev/null @@ -1,51 +0,0 @@ -From bb1c91432c5e9a1f402692db5c80c65136656afb Mon Sep 17 00:00:00 2001 -From: Jeremy Cline -Date: Tue, 13 Jun 2017 09:08:09 -0400 -Subject: [PATCH] Remove tests that use the tarpit - -The latest version of Mock has started using systemd containers. The -systemd-nspawn command is being run with --private-network, which -immediately kills connections to something other than localhost. These -tests depend on the connection not being killed immediately and that -they are never responded to. - -Signed-off-by: Jeremy Cline - -Reference: -https://src.fedoraproject.org/rpms/python-requests/blob/rawhide/f/Remove-tests-that-use-the-tarpit.patch ---- -diff -Naur requests-2.24.0/tests/test_requests.py requests-2/tests/test_requests.py ---- requests-2.24.0/tests/test_requests.py 2020-08-04 18:05:14.250000000 +0800 -+++ requests-2/tests/test_requests.py 2020-08-04 18:13:19.891000000 +0800 -@@ -2188,30 +2188,6 @@ - except ReadTimeout: - pass - -- @pytest.mark.parametrize( -- 'timeout', ( -- (0.1, None), -- Urllib3Timeout(connect=0.1, read=None) -- )) -- def test_connect_timeout(self, timeout): -- try: -- requests.get(TARPIT, timeout=timeout) -- pytest.fail('The connect() request should time out.') -- except ConnectTimeout as e: -- assert isinstance(e, ConnectionError) -- assert isinstance(e, Timeout) -- -- @pytest.mark.parametrize( -- 'timeout', ( -- (0.1, 0.1), -- Urllib3Timeout(connect=0.1, read=0.1) -- )) -- def test_total_timeout_connect(self, timeout): -- try: -- requests.get(TARPIT, timeout=timeout) -- pytest.fail('The connect() request should time out.') -- except ConnectTimeout: -- pass - - def test_encoded_methods(self, httpbin): - """See: https://github.com/psf/requests/issues/2316""" - diff --git a/backport-requests-2.12.4-tests_nonet.patch b/backport-requests-2.12.4-tests_nonet.patch deleted file mode 100644 index d1d5731ab5afb45cc894b00b91254e6ff24e82a1..0000000000000000000000000000000000000000 --- a/backport-requests-2.12.4-tests_nonet.patch +++ /dev/null @@ -1,13 +0,0 @@ -Reference: -https://src.fedoraproject.org/rpms/python-requests/blob/rawhide/f/requests-2.12.4-tests_nonet.patch ---- requests-2.12.4/tests/testserver/server.py 2016-12-21 11:31:56.000000000 -0800 -+++ requests-2.12.4/tests/testserver/server.py.new 2016-12-30 10:40:06.085995065 -0800 -@@ -27,7 +27,7 @@ - """Dummy server using for unit testing""" - WAIT_EVENT_TIMEOUT = 5 - -- def __init__(self, handler=None, host='localhost', port=0, requests_to_handle=1, wait_to_close_event=None): -+ def __init__(self, handler=None, host='127.0.0.1', port=0, requests_to_handle=1, wait_to_close_event=None): - super(Server, self).__init__() - - self.handler = handler or consume_socket_content diff --git a/backport-patch-requests-certs.py-to-use-the-system-CA-bundle.patch b/backport-requests-2.28.1-system-certs.patch similarity index 36% rename from backport-patch-requests-certs.py-to-use-the-system-CA-bundle.patch rename to backport-requests-2.28.1-system-certs.patch index bba7bc299b5d9f190e600b21f8d19cc2399a0e3a..22b96929d1b3bf308fd7230db327d54e1f82b50f 100644 --- a/backport-patch-requests-certs.py-to-use-the-system-CA-bundle.patch +++ b/backport-requests-2.28.1-system-certs.patch @@ -1,41 +1,37 @@ -From cc1b9954ca7dcd90a694f7e2e9990c883bf7b647 Mon Sep 17 00:00:00 2001 -From: Lumir Balhar -Date: Wed, 21 Jul 2021 12:05:53 +0200 -Subject: [PATCH] patch-requests-certs.py-to-use-the-system-CA-bundle - -Reference: -https://src.fedoraproject.org/rpms/python-requests/blob/rawhide/f/patch-requests-certs.py-to-use-the-system-CA-bundle.patch ---- -diff --git a/requests/certs.py b/requests/certs.py -index a14a7ee..a1841ca 100644 ---- a/requests/certs.py -+++ b/requests/certs.py -@@ -10,8 +10,12 @@ only one — the one from the certifi package. +--- requests-2.28.1/requests/certs.py 2022-07-12 13:55:25.378079641 -0700 ++++ requests-2.28.1/requests/certs.py.new 2022-07-12 13:57:03.834621295 -0700 +@@ -9,8 +9,13 @@ If you are packaging Requests, e.g., for a Linux distribution or a managed environment, you can change the definition of where() to return a separately packaged CA bundle. --""" --from certifi import where - ++ +This OpenEuler-patched package returns "/etc/pki/tls/certs/ca-bundle.crt" provided +by the ca-certificates RPM package. -+""" + """ +-from certifi import where +def where(): + """Return the absolute path to the system CA bundle.""" + return '/etc/pki/tls/certs/ca-bundle.crt' - if __name__ == '__main__': + + if __name__ == "__main__": print(where()) -diff --git a/setup.py b/setup.py -index ce5e5c8..de86a91 100755 ---- a/setup.py -+++ b/setup.py -@@ -46,7 +46,6 @@ requires = [ - 'idna>=2.5,<3; python_version < "3"', - 'idna>=2.5,<4; python_version >= "3"', - 'urllib3>=1.21.1,<1.27', -- 'certifi>=2017.4.17' - +--- requests-2.28.1/setup.py 2022-06-29 08:09:11.000000000 -0700 ++++ requests-2.28.1/setup.py.new 2022-07-12 13:58:33.830116402 -0700 +@@ -62,7 +62,6 @@ + "charset_normalizer>=2,<3", + "idna>=2.5,<4", + "urllib3>=1.21.1,<1.27", +- "certifi>=2017.4.17", ] test_requirements = [ --- -2.27.0 \ No newline at end of file + "pytest-httpbin==0.0.7", +--- requests-2.28.1/setup.cfg 2022-06-29 08:09:11.000000000 -0700 ++++ requests-2.28.1/setup.cfg.new 2022-07-12 13:58:19.619038220 -0700 +@@ -4,7 +4,6 @@ + socks + use_chardet_on_py3 + requires-dist = +- certifi>=2017.4.17 + charset_normalizer>=2,<3 + idna>=2.5,<4 + urllib3>=1.21.1,<1.27 diff --git a/backport-requests-2.28.1-tests_nonet.patch b/backport-requests-2.28.1-tests_nonet.patch new file mode 100644 index 0000000000000000000000000000000000000000..32e96ee8e40ace8435cfe4b8117edbe5137747b7 --- /dev/null +++ b/backport-requests-2.28.1-tests_nonet.patch @@ -0,0 +1,11 @@ +--- requests-2.28.1/tests/testserver/server.py 2022-06-29 08:09:11.000000000 -0700 ++++ requests-2.28.1/tests/testserver/server.py.new 2022-07-12 14:04:30.218077055 -0700 +@@ -29,7 +29,7 @@ + def __init__( + self, + handler=None, +- host="localhost", ++ host="127.0.0.1", + port=0, + requests_to_handle=1, + wait_to_close_event=None, diff --git a/python-requests.spec b/python-requests.spec index d4148fd06a280a69b0f6c27cd903b13187fc1a9d..a014f68ff115bee77b372c7e514f5aafdbb2a972 100644 --- a/python-requests.spec +++ b/python-requests.spec @@ -1,16 +1,15 @@ %bcond_with tests Name: python-requests -Version: 2.27.1 +Version: 2.28.1 Release: 1 Summary: Python HTTP Library License: ASL 2.0 URL: http://python-requests.org/ -Source0: https://github.com/psf/requests/archive/refs/tags/v%{version}.tar.gz +Source0: https://github.com/requests/requests/archive/v%{version}/requests-v%{version}.tar.gz -Patch6001: backport-requests-2.12.4-tests_nonet.patch -Patch6002: backport-patch-requests-certs.py-to-use-the-system-CA-bundle.patch -Patch6003: backport-remove-tests-that-use-the-tarpit.patch +Patch6001: backport-requests-2.28.1-system-certs.patch +Patch6002: backport-requests-2.28.1-tests_nonet.patch BuildArch: noarch @@ -95,6 +94,9 @@ PYTHONPATH=%{buildroot}%{python3_sitelib} %{__python3} -m pytest -v %doc HISTORY.md README.md %changelog +* Thu Jul 28 2022 fushanqing - 2.28.1-1 +- update python-requests to 2.28.1 + * Thu Jun 16 2022 zhangying - 2.27.1-1 - Upgrade version for openstack yoga diff --git a/v2.27.1.tar.gz b/requests-v2.28.1.tar.gz similarity index 63% rename from v2.27.1.tar.gz rename to requests-v2.28.1.tar.gz index 631156ad7c8020706d929bb3283e107948ca11df..e2d367e20a3df9d3a2e025b24cad4cda32672b39 100644 Binary files a/v2.27.1.tar.gz and b/requests-v2.28.1.tar.gz differ