diff --git a/.python-requests.metadata b/.python-requests.metadata index 126ebb6..c3f689d 100644 --- a/.python-requests.metadata +++ b/.python-requests.metadata @@ -1 +1 @@ -2c0728fc3aca17419b2b574341a0b019e117d4f5 SOURCES/requests-v2.20.0.tar.gz +7390ca5c8026ec05cbd4eb17f533f8df2c880d95 SOURCES/requests-v2.31.0.tar.gz diff --git a/SOURCES/system-certs.patch b/SOURCES/system-certs.patch new file mode 100644 index 0000000..0e323f8 --- /dev/null +++ b/SOURCES/system-certs.patch @@ -0,0 +1,58 @@ +From fbe9d1e38da72d8caac365841794b06614523ac9 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hrn=C4=8Diar?= +Date: Tue, 17 Oct 2023 10:44:42 +0200 +Subject: [PATCH] system certs + +Co-authored-by: Lumir Balhar +--- + requests/certs.py | 7 ++++++- + setup.cfg | 1 - + setup.py | 1 - + 3 files changed, 6 insertions(+), 3 deletions(-) + +diff --git a/requests/certs.py b/requests/certs.py +index 1f30a45..9224f62 100644 +--- a/requests/certs.py ++++ b/requests/certs.py +@@ -9,8 +9,13 @@ 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. ++ ++This Fedora-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 --git a/setup.cfg b/setup.cfg +index bf21c81..906c0f1 100644 +--- a/setup.cfg ++++ b/setup.cfg +@@ -4,7 +4,6 @@ provides-extra = + socks + use_chardet_on_py3 + requires-dist = +- certifi>=2017.4.17 + charset_normalizer>=2,<4 + idna>=2.5,<4 + urllib3>=1.21.1,<1.27 +diff --git a/setup.py b/setup.py +index 0123545..ec3fd1d 100755 +--- a/setup.py ++++ b/setup.py +@@ -62,7 +62,6 @@ requires = [ + "charset_normalizer>=2,<4", + "idna>=2.5,<4", + "urllib3>=1.21.1,<3", +- "certifi>=2017.4.17", + ] + test_requirements = [ + "pytest-httpbin==2.0.0", +-- +2.41.0 + diff --git a/SPECS/python-requests.spec b/SPECS/python-requests.spec index b475e64..e612a27 100644 --- a/SPECS/python-requests.spec +++ b/SPECS/python-requests.spec @@ -1,50 +1,29 @@ -%if 0%{?_module_build} -# Don't run tests on module-build for now -# See: https://bugzilla.redhat.com/show_bug.cgi?id=1450608 -%bcond_with tests -%else # When bootstrapping Python, we cannot test this yet -%bcond_without tests -%endif - +# RHEL does not include the test dependencies +%bcond tests %{undefined rhel} Name: python-requests -Version: 2.20.0 -Release: 2.1%{?dist} +Version: 2.31.0 +Release: 3%{?dist} Summary: HTTP library, written in Python, for human beings -License: ASL 2.0 +License: Apache-2.0 URL: https://pypi.io/project/requests -Source0: https://github.com/requests/requests/archive/v%{version}/requests-v%{version}.tar.gz +Source: https://github.com/requests/requests/archive/v%{version}/requests-v%{version}.tar.gz + # Explicitly use the system certificates in ca-certificates. # https://bugzilla.redhat.com/show_bug.cgi?id=904614 -Patch0: patch-requests-certs.py-to-use-the-system-CA-bundle.patch - -# https://bugzilla.redhat.com/show_bug.cgi?id=1450608 -Patch2: Remove-tests-that-use-the-tarpit.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. -Patch3: requests-2.12.4-tests_nonet.patch - -# https://bugzilla.redhat.com/show_bug.cgi?id=1567862 -Patch4: Don-t-inject-pyopenssl-into-urllib3.patch - -# Skip all tests needing httpbin -# httpbin has too many dependencies to be shipped in RHEL just for -# build-time package tests -Patch5: Skip-all-tests-needing-httpbin.patch - -# Properly handle default ports when stripping the authorization header. -# This fixes a regression introduced with fixing CVE-2018-18074. -# Fixed upstream: https://github.com/psf/requests/pull/4851 -# Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1758261 -Patch6: properly-handle-default-ports-in-auth-stripping.patch +Patch: system-certs.patch BuildArch: noarch +BuildRequires: python%{python3_pkgversion}-devel +BuildRequires: pyproject-rpm-macros +%if %{with tests} +BuildRequires: python3dist(pytest) +BuildRequires: python3dist(pytest-httpbin) +BuildRequires: python3dist(pytest-mock) +BuildRequires: python3dist(trustme) +%endif %description Most existing Python modules for sending HTTP requests are extremely verbose and @@ -52,23 +31,11 @@ cumbersome. Python’s built-in urllib2 module provides most of the HTTP capabilities you should need, but the API is thoroughly broken. This library is designed to make HTTP requests easy for developers. -%package -n python%{python3_pkgversion}-requests -Summary: HTTP library, written in Python, for human beings - -%{?python_provide:%python_provide python%{python3_pkgversion}-requests} -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-mock -%endif +%package -n python%{python3_pkgversion}-requests +Summary: %{summary} -Requires: python%{python3_pkgversion}-chardet -Requires: python%{python3_pkgversion}-urllib3 -Requires: python%{python3_pkgversion}-idna +Requires: python%{python3_pkgversion}-requests+use_chardet_on_py3 = %{version}-%{release} %description -n python%{python3_pkgversion}-requests Most existing Python modules for sending HTTP requests are extremely verbose and @@ -76,69 +43,230 @@ cumbersome. Python’s built-in urllib2 module provides most of the HTTP capabilities you should need, but the API is thoroughly broken. This library is designed to make HTTP requests easy for developers. + +%pyproject_extras_subpkg -n python%{python3_pkgversion}-requests use_chardet_on_py3 + + +%generate_buildrequires +%pyproject_buildrequires -x use_chardet_on_py3 + + %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//' pyproject.toml + +# we don't ship charset_normalizer in RDO, so we are using the extra use_chardet_on_py3 to +# pull chardet provided by BaseOS repo +sed -i '/charset_normalizer.*/d' setup.cfg +sed -i '/charset_normalizer.*/d' setup.py + + %build -%py3_build +%pyproject_wheel %install -%py3_install +%pyproject_install +%pyproject_save_files requests -%if %{with tests} %check -PYTHONPATH=%{buildroot}%{python3_sitelib} %{__python3} -m pytest -v -%endif # tests +%pyproject_check_import +%if %{with tests} +# test_use_proxy_from_environment needs pysocks +%pytest -v tests -k "not test_use_proxy_from_environment" +%endif + -%files -n python%{python3_pkgversion}-requests +%files -n python%{python3_pkgversion}-requests -f %{pyproject_files} %license LICENSE %doc README.md HISTORY.md -%{python3_sitelib}/*.egg-info -%{python3_sitelib}/requests/ %changelog -* Thu Oct 17 2019 Tomas Orsava - 2.20.0-2.1 -- Bumping to enable gating -Related: rhbz#1758261 +* Fri Jan 26 2024 Fedora Release Engineering - 2.31.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild -* Mon Oct 14 2019 Charalampos Stratakis - 2.20.0-2 -- Properly handle default ports when stripping the authorization header -Resolves: rhbz#1758261 +* Mon Jan 22 2024 Fedora Release Engineering - 2.31.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild -* Mon Oct 29 2018 Jeremy Cline - 2.20.0-1 -- Update to v2.20.0 for CVE-2018-18074. +* Mon Oct 16 2023 Tomáš Hrnčiar - 2.31.0-1 +- Update to 2.31.0 +- Fixes: rhbz#2189970 + +* Tue Oct 10 2023 Miro Hrončok - 2.28.2-7 +- Do not package requests[security] and requests[socks] on RHEL +- Make the package build even when urllib3 won't pull in pysocks + +* Tue Aug 08 2023 Karolina Surma - 2.28.2-6 +- Declare the license as an SPDX expression + +* Fri Jul 21 2023 Fedora Release Engineering - 2.28.2-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Sat Jul 01 2023 Python Maint - 2.28.2-4 +- Rebuilt for Python 3.12 + +* Tue Jun 13 2023 Python Maint - 2.28.2-3 +- Bootstrap for Python 3.12 + +* Tue May 23 2023 Miro Hrončok - 2.28.2-2 +- Security fix for CVE-2023-32681 +- https://github.com/psf/requests/security/advisories/GHSA-j8r2-6x86-q33q + +* Wed Feb 01 2023 Lumír Balhar - 2.28.2-1 +- Update to 2.28.2 (rhbz#2160527) + +* Fri Jan 20 2023 Fedora Release Engineering - 2.28.1-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild -* Wed Jul 11 2018 Petr Viktorin - 2.19.1-4 -- Remove the Python 2 subpackage - https://bugzilla.redhat.com/show_bug.cgi?id=1590396 +* Tue Sep 13 2022 Kevin Fenzi - 2.28.1-3 +- Enable all tests and drop no longer needed test patch. -* Thu Jun 21 2018 Lumír Balhar - 2.19.1-3 -- Allow build with Python 2 +* Fri Jul 22 2022 Fedora Release Engineering - 2.28.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild -* Tue Jun 19 2018 Charalampos Stratakis - 2.19.1-2 -- Remove the python-pytest-cov dependency +* Tue Jul 12 2022 Adam Williamson - 2.28.1-1 +- Update to 2.28.1, rediff patches -* Tue Jun 19 2018 Jeremy Cline - 2.19.1-1 +* Mon Jun 20 2022 Lumír Balhar - 2.27.1-5 +- Allow charset_normalizer 2.1.0 and newer up to 3.0.0 + +* Tue Jun 14 2022 Python Maint - 2.27.1-4 +- Rebuilt for Python 3.11 + +* Mon Jun 13 2022 Python Maint - 2.27.1-3 +- Bootstrap for Python 3.11 + +* Fri Jan 21 2022 Fedora Release Engineering - 2.27.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Sat Jan 08 2022 Kevin Fenzi - 2.27.1-1 +- Update to 2.27.1. Fixes rhbz#2037431 + +* Tue Jan 04 2022 Adam Williamson - 2.27.0-1 +- Update to 2.27.0 +- Re-enable test_https_warnings as it works with pytest-httpbin 1.0.0 now +- Re-enable test_pyopenssl_redirect, it seems to work too + +* Sun Jul 25 2021 Lumír Balhar - 2.26.0-1 +- Update to 2.26.0 +Resolves: rhbz#1981856 + +* Fri Jul 23 2021 Fedora Release Engineering - 2.25.1-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Fri Jun 04 2021 Python Maint - 2.25.1-3 +- Rebuilt for Python 3.10 + +* Wed Jun 02 2021 Python Maint - 2.25.1-2 +- Bootstrap for Python 3.10 + +* Tue Feb 02 2021 Kevin Fenzi - 2.25.1-1 +- Update 2.25.1. Fix is rhbz#1908487 + +* Wed Jan 27 2021 Fedora Release Engineering - 2.25.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Wed Nov 25 2020 Petr Viktorin - 2.25.0-1 +- Update to 2.25.0 + +* Fri Nov 13 2020 Miro Hrončok - 2.24.0-5 +- Don't BR pytest-cov + +* Fri Sep 18 2020 Petr Viktorin - 2.24.0-4 +- Port to pyproject macros + +* Fri Sep 18 2020 Miro Hrončok - 2.24.0-3 +- Build with pytest 6, older version is no longer required + +* Wed Jul 29 2020 Fedora Release Engineering - 2.24.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Fri Jul 10 2020 Miro Hrončok - 2.24.0-1 +- Update to 2.24.0 +- Resolves rhbz#1848104 + +* Fri Jul 10 2020 Miro Hrončok - 2.23.0-5 +- Add requests[security] and requests[socks] subpackages + +* Sat May 30 2020 Miro Hrončok - 2.23.0-4 +- Test with pytest 4, drop manual requires + +* Mon May 25 2020 Miro Hrončok - 2.23.0-3 +- Rebuilt for Python 3.9 + +* Fri May 22 2020 Miro Hrončok - 2.23.0-2 +- Bootstrap for Python 3.9 + +* Fri Feb 21 2020 Randy Barlow - 2.23.0-1 +- Update to 2.23.0 (#1804863). +- https://requests.readthedocs.io/en/latest/community/updates/ + +* Thu Jan 30 2020 Fedora Release Engineering - 2.22.0-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Tue Oct 22 2019 Charalampos Stratakis - 2.22.0-7 +- Remove the python2 subpackage (rhbz#1761787) + +* Wed Sep 18 2019 Petr Viktorin - 2.22.0-6 +- Python 2: Remove tests and test dependencies + +* Mon Aug 19 2019 Miro Hrončok - 2.22.0-5 +- Rebuilt for Python 3.8 + +* Thu Aug 15 2019 Miro Hrončok - 2.22.0-4 +- Bootstrap for Python 3.8 + +* Fri Jul 26 2019 Fedora Release Engineering - 2.22.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Tue Jun 11 2019 Yatin Karel - 2.22.0-2 +- Add minimum requirement for chardet and urllib3 + +* Thu May 23 2019 Jeremy Cline - 2.22.0-1 +- Update to v2.22.0 + +* Sat Feb 02 2019 Fedora Release Engineering - 2.21.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Thu Dec 13 2018 Jeremy Cline - 2.21.0-1 +- Update to v2.21.0 +- Don't rely on certifi being patched properly to use the system CA bundle + +* Mon Nov 26 2018 Miro Hrončok - 2.20.0-2 +- No pytest-httpbin for Python 2 + +* Mon Oct 29 2018 Jeremy Cline - 2.20.0-1 +- Update to v2.20.0 + +* Sat Jul 14 2018 Fedora Release Engineering - 2.19.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Mon Jun 18 2018 Miro Hrončok - 2.19.1-2 +- Rebuilt for Python 3.7 + +* Thu Jun 14 2018 Jeremy Cline - 2.19.1-1 - Update to v2.19.1 (rhbz 1591531) -* Tue Jun 19 2018 Jeremy Cline - 2.19.0-1 +* Thu Jun 14 2018 Miro Hrončok - 2.19.0-2 +- Bootstrap for Python 3.7 + +* Tue Jun 12 2018 Jeremy Cline - 2.19.0-1 - Update to v2.19.0 (rhbz 1590508) -* Wed Jun 13 2018 Tomas Orsava - 2.18.4-6 -- Skip all tests needing httpbin: httpbin has too many dependencies to be - shipped in RHEL just for build-time package tests +* Fri Jun 08 2018 Jeremy Cline - 2.18.4-6 +- Don't print runtime warning about urllib3 v1.23 (rhbz 1589306) -* Tue Jun 12 2018 Tomas Orsava - 2.18.4-5 -- BR idna, or the tests fail to start +* Tue Jun 05 2018 Jeremy Cline - 2.18.4-5 +- Allow urllib3 v1.23 (rhbz 1586311) * Mon Apr 16 2018 Jeremy Cline - 2.18.4-4 - Stop injecting PyOpenSSL (rhbz 1567862)