diff --git a/Remove-tests-that-use-the-tarpit.patch b/backport-Remove-tests-that-use-the-tarpit.patch similarity index 93% rename from Remove-tests-that-use-the-tarpit.patch rename to backport-Remove-tests-that-use-the-tarpit.patch index 86b65c1da6fdadf887d3d4b4310c558ad0cea2e1..4a9ea3e7edf294e1e4e03c697ade8f8d288f7e61 100644 --- a/Remove-tests-that-use-the-tarpit.patch +++ b/backport-Remove-tests-that-use-the-tarpit.patch @@ -10,6 +10,9 @@ 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 diff --git a/patch-requests-certs.py-to-use-the-system-CA-bundle.patch b/backport-patch-requests-certs.py-to-use-the-system-CA-bundle.patch similarity index 42% rename from patch-requests-certs.py-to-use-the-system-CA-bundle.patch rename to backport-patch-requests-certs.py-to-use-the-system-CA-bundle.patch index 5568feeae55faff08b76407b3049e250bbcf927b..bba7bc299b5d9f190e600b21f8d19cc2399a0e3a 100644 --- a/patch-requests-certs.py-to-use-the-system-CA-bundle.patch +++ b/backport-patch-requests-certs.py-to-use-the-system-CA-bundle.patch @@ -1,29 +1,41 @@ -diff --color -Nur requests-2.25.1.orig/requests/certs.py requests-2.25.1/requests/certs.py ---- requests-2.25.1.orig/requests/certs.py 2021-01-10 16:27:05.027059634 -0800 -+++ requests-2.25.1/requests/certs.py 2021-01-10 16:29:06.973238179 -0800 -@@ -10,8 +10,13 @@ +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. 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__': print(where()) -diff --color -Nur requests-2.25.1.orig/setup.py requests-2.25.1/setup.py ---- requests-2.25.1.orig/setup.py 2020-12-16 11:34:26.000000000 -0800 -+++ requests-2.25.1/setup.py 2021-01-10 16:29:21.570259552 -0800 -@@ -45,7 +45,6 @@ - 'chardet>=3.0.2,<5', - 'idna>=2.5,<3', +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' - + ] test_requirements = [ +-- +2.27.0 \ No newline at end of file diff --git a/requests-2.12.4-tests_nonet.patch b/backport-requests-2.12.4-tests_nonet.patch similarity index 84% rename from requests-2.12.4-tests_nonet.patch rename to backport-requests-2.12.4-tests_nonet.patch index 5e097b1bfbb663e887bd211e473d76a378798203..d1d5731ab5afb45cc894b00b91254e6ff24e82a1 100644 --- a/requests-2.12.4-tests_nonet.patch +++ b/backport-requests-2.12.4-tests_nonet.patch @@ -1,3 +1,5 @@ +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 @@ diff --git a/python-requests.spec b/python-requests.spec index 43b0e4365118345f46bb5e60c1db81c6d9cb0026..3e643b32c6e3a3d662ce61fea27519552831036a 100644 --- a/python-requests.spec +++ b/python-requests.spec @@ -1,17 +1,16 @@ %bcond_with tests Name: python-requests -Version: 2.25.1 +Version: 2.26.0 Release: 1 Summary: Python HTTP Library License: ASL 2.0 URL: http://python-requests.org/ -Source0: https://github.com/psf/requests/archive/v%{version}.tar.gz +Source0: https://github.com/psf/requests/archive/refs/tags/v%{version}.tar.gz -Patch1: requests-2.12.4-tests_nonet.patch -Patch2: requests-2.20.0-no-py2-httpbin.patch -Patch3: patch-requests-certs.py-to-use-the-system-CA-bundle.patch -Patch4: Remove-tests-that-use-the-tarpit.patch +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 BuildArch: noarch @@ -41,6 +40,7 @@ BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-chardet BuildRequires: python%{python3_pkgversion}-urllib3 BuildRequires: python%{python3_pkgversion}-idna + %if %{with tests} BuildRequires: python%{python3_pkgversion}-pytest BuildRequires: python%{python3_pkgversion}-pytest-cov @@ -78,20 +78,22 @@ sed -i '/#!\/usr\/.*python/d' requests/certs.py %if %{with tests} %check PYTHONPATH=%{buildroot}%{python3_sitelib} %{__python3} -m pytest -v -%endif # tests +%endif -%files -n python%{python3_pkgversion}-requests +%files -n python%{python3_pkgversion}-requests %defattr(-,root,root) %license LICENSE -%{python3_sitelib}/*.egg-info +%{python3_sitelib}/*.egg-info/* %{python3_sitelib}/requests/ - %files help %defattr(-,root,root) %doc HISTORY.md README.md %changelog +* Sat Dec 04 2021 wangkerong - 2.26.0-1 +- update to 2.26.0 + * Thu Feb 4 2021 chengguipeng - 2.25.1-1 - update to 2.25.1 diff --git a/requests-2.20.0-no-py2-httpbin.patch b/requests-2.20.0-no-py2-httpbin.patch deleted file mode 100644 index c3f60b1003b0935f5eb2d834797204d6ec128c21..0000000000000000000000000000000000000000 --- a/requests-2.20.0-no-py2-httpbin.patch +++ /dev/null @@ -1,34 +0,0 @@ -diff --git a/tests/conftest.py b/tests/conftest.py -index cd64a76..1d5ddbb 100644 ---- a/tests/conftest.py -+++ b/tests/conftest.py -@@ -14,11 +14,23 @@ def prepare_url(value): - return inner - - --@pytest.fixture --def httpbin(httpbin): -- return prepare_url(httpbin) -+import sys - -+if sys.version_info[0] < 3: -+ @pytest.fixture -+ def httpbin(): -+ pytest.skip('No httpbin for Python 2') - --@pytest.fixture --def httpbin_secure(httpbin_secure): -- return prepare_url(httpbin_secure) -+ @pytest.fixture -+ def httpbin_secure(): -+ pytest.skip('No httpbin for Python 2') -+ -+else: -+ @pytest.fixture -+ def httpbin(httpbin): -+ return prepare_url(httpbin) -+ -+ -+ @pytest.fixture -+ def httpbin_secure(httpbin_secure): -+ return prepare_url(httpbin_secure) diff --git a/v2.25.1.tar.gz b/v2.26.0.tar.gz similarity index 62% rename from v2.25.1.tar.gz rename to v2.26.0.tar.gz index ab62d59efc91c4475ca724ea964607b112d9330b..8c946b36fe6b829a0ac5cef44018132e0ad3e511 100644 Binary files a/v2.25.1.tar.gz and b/v2.26.0.tar.gz differ