diff --git a/python-requests.spec b/python-requests.spec index b82bb0a5d121782de9cc103ff27fa1f3d066aa1f..a53a0ab0247de0db0d51c429316094e98aa90d92 100644 --- a/python-requests.spec +++ b/python-requests.spec @@ -3,7 +3,7 @@ Name: python-requests -Version: 2.27.1 +Version: 2.28.1 Release: %{anolis_release}%{dist} Summary: HTTP library, written in Python, for human beings @@ -11,7 +11,14 @@ License: ASL 2.0 URL: https://pypi.io/project/requests Source0: https://github.com/requests/requests/archive/v%{version}/requests-v%{version}.tar.gz # Explicitly use the system certificates in ca-certificates. -Patch0: patch-requests-certs.py-to-use-the-system-CA-bundle.patch +Patch0: requests-2.28.1-system-certs.patch + +# Use 127.0.0.1 not localhost for socket.bind() in the Server test +# class, to fix tests in Koji's no-network environment +# This probably isn't really upstreamable, because I guess localhost +# could technically be IPv6 or something, and our no-network env is +# a pretty odd one so this is a niche requirement. +Patch1: requests-2.28.1-tests_nonet.patch BuildArch: noarch @@ -52,20 +59,24 @@ designed to make HTTP requests easy for developers. %pyproject_buildrequires %endif +%package doc +Summary: Documentation files for %{name} +Requires: python%{python3_pkgversion}-requests = %{version}-%{release} +BuildArch: noarch + +%description doc +The python%{python3_pkgversion}-requests-doc package contains documentation files for python%{python3_pkgversion}-requests. %prep %autosetup -p1 -n requests-%{version} -# Unbundle the certificate bundle from mozilla. -rm -rf requests/cacert.pem - # env shebang in nonexecutable file sed -i '/#!\/usr\/.*python/d' requests/certs.py # Some doctests use the internet and fail to pass in Koji. Since doctests don't have names, I don't # know a way to skip them. We also don't want to patch them out, because patching them out will # change the docs. Thus, we set pytest not to run doctests at all. -sed -i 's/ --doctest-modules//' pytest.ini +sed -i 's/ --doctest-modules//' pyproject.toml %build %pyproject_wheel @@ -78,15 +89,19 @@ sed -i 's/ --doctest-modules//' pytest.ini %if %{with tests} %check -%pytest -v +%pytest -v -k "not (test_connect_timeout or test_total_timeout_connect)" %endif %files -n python%{python3_pkgversion}-requests -f %{pyproject_files} %license LICENSE -%doc README.md HISTORY.md +%files doc +%doc README.md HISTORY.md %changelog +* Fri Sep 23 2022 mgb01105731 - 2.28.1-1 +- update to 2.28.1 + * Wed Apr 20 2022 Zhongling He 2.27.1-1 - Init package from upstream v2.27.1 diff --git a/patch-requests-certs.py-to-use-the-system-CA-bundle.patch b/requests-2.28.1-system-certs.patch similarity index 37% rename from patch-requests-certs.py-to-use-the-system-CA-bundle.patch rename to requests-2.28.1-system-certs.patch index 62af510ab565e4363df92ea4ae64392cc8c9a5c8..58bd6b37bf855ca0c4a5cc2fb421b3e5fd49a0d3 100644 --- a/patch-requests-certs.py-to-use-the-system-CA-bundle.patch +++ b/requests-2.28.1-system-certs.patch @@ -1,18 +1,6 @@ -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 - ---- - requests/certs.py | 7 ++++++- - setup.py | 1 - - 2 files changed, 6 insertions(+), 2 deletions(-) - -diff --git a/requests/certs.py b/requests/certs.py -index a14a7ee..b4957d1 100644 ---- a/requests/certs.py -+++ b/requests/certs.py -@@ -10,8 +10,13 @@ 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. @@ -25,20 +13,25 @@ index a14a7ee..b4957d1 100644 + """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.31.1 - + "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/requests-2.28.1-tests_nonet.patch b/requests-2.28.1-tests_nonet.patch new file mode 100644 index 0000000000000000000000000000000000000000..32e96ee8e40ace8435cfe4b8117edbe5137747b7 --- /dev/null +++ b/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/requests-v2.27.1.tar.gz b/requests-v2.28.1.tar.gz similarity index 63% rename from requests-v2.27.1.tar.gz rename to requests-v2.28.1.tar.gz index 631156ad7c8020706d929bb3283e107948ca11df..e2d367e20a3df9d3a2e025b24cad4cda32672b39 100644 Binary files a/requests-v2.27.1.tar.gz and b/requests-v2.28.1.tar.gz differ