Compare commits

...

No commits in common. 'i8c-stream-3.8' and 'c9' have entirely different histories.

2
.gitignore vendored

@ -1 +1 @@
SOURCES/requests-v2.22.0.tar.gz SOURCES/requests-v2.25.1.tar.gz

@ -1 +1 @@
a0e040fc6d83a3959c62f7657e8bcca2239cc7a5 SOURCES/requests-v2.22.0.tar.gz 804fdbaf3dbc57f49a66cef920e9d4a5ce3460eb SOURCES/requests-v2.25.1.tar.gz

@ -1,38 +0,0 @@
From 86b1fa39fdebdb7bc57131c1a198d4d18e104f95 Mon Sep 17 00:00:00 2001
From: Jeremy Cline <jeremy@jcline.org>
Date: Mon, 16 Apr 2018 10:35:35 -0400
Subject: [PATCH] Don't inject pyopenssl into urllib3
Fedora ships sufficiently new versions of Python 2 and 3 to make this
unnecessary (rhbz 1567862)
Signed-off-by: Jeremy Cline <jeremy@jcline.org>
---
requests/__init__.py | 7 -------
1 file changed, 7 deletions(-)
diff --git a/requests/__init__.py b/requests/__init__.py
index a5b3c9c3..e312d314 100644
--- a/requests/__init__.py
+++ b/requests/__init__.py
@@ -90,17 +90,6 @@ except (AssertionError, ValueError):
"version!".format(urllib3.__version__, chardet.__version__),
RequestsDependencyWarning)
-# Attempt to enable urllib3's SNI support, if possible
-try:
- from urllib3.contrib import pyopenssl
- pyopenssl.inject_into_urllib3()
-
- # Check cryptography version
- from cryptography import __version__ as cryptography_version
- _check_cryptography(cryptography_version)
-except ImportError:
- pass
-
# urllib3's DependencyWarnings should be silenced.
from urllib3.exceptions import DependencyWarning
warnings.simplefilter('ignore', DependencyWarning)
--
2.17.0

@ -0,0 +1,13 @@
diff --git a/setup.py b/setup.py
index 065eb22..043ae42 100755
--- a/setup.py
+++ b/setup.py
@@ -100,7 +100,7 @@ setup(
cmdclass={'test': PyTest},
tests_require=test_requirements,
extras_require={
- 'security': ['pyOpenSSL >= 0.14', 'cryptography>=1.3.4'],
+ 'security': [],
'socks': ['PySocks>=1.5.6, !=1.5.7'],
'socks:sys_platform == "win32" and python_version == "2.7"': ['win_inet_pton'],
},

@ -1,4 +1,4 @@
From 524cd22fb77e69db9bb3f017bbb1d9782c37b0cd Mon Sep 17 00:00:00 2001 From bb1c91432c5e9a1f402692db5c80c65136656afb Mon Sep 17 00:00:00 2001
From: Jeremy Cline <jeremy@jcline.org> From: Jeremy Cline <jeremy@jcline.org>
Date: Tue, 13 Jun 2017 09:08:09 -0400 Date: Tue, 13 Jun 2017 09:08:09 -0400
Subject: [PATCH] Remove tests that use the tarpit Subject: [PATCH] Remove tests that use the tarpit
@ -15,10 +15,10 @@ Signed-off-by: Jeremy Cline <jeremy@jcline.org>
1 file changed, 25 deletions(-) 1 file changed, 25 deletions(-)
diff --git a/tests/test_requests.py b/tests/test_requests.py diff --git a/tests/test_requests.py b/tests/test_requests.py
index b8350cb..46b7e9e 100755 index 7d4a4eb5..8d1c55fc 100644
--- a/tests/test_requests.py --- a/tests/test_requests.py
+++ b/tests/test_requests.py +++ b/tests/test_requests.py
@@ -2049,31 +2049,6 @@ class TestTimeout: @@ -2186,31 +2186,6 @@ class TestTimeout:
except ReadTimeout: except ReadTimeout:
pass pass
@ -48,8 +48,8 @@ index b8350cb..46b7e9e 100755
- pass - pass
- -
def test_encoded_methods(self, httpbin): def test_encoded_methods(self, httpbin):
"""See: https://github.com/requests/requests/issues/2316""" """See: https://github.com/psf/requests/issues/2316"""
r = requests.request(b'GET', httpbin('get')) r = requests.request(b'GET', httpbin('get'))
-- --
2.9.4 2.24.1

@ -1,19 +1,7 @@
From d5a4f2908fab5ca16eb59db8b18eda7a94a37b04 Mon Sep 17 00:00:00 2001 diff --color -Nur requests-2.25.1.orig/requests/certs.py requests-2.25.1/requests/certs.py
From: Jeremy Cline <jcline@redhat.com> --- requests-2.25.1.orig/requests/certs.py 2021-01-10 16:27:05.027059634 -0800
Date: Thu, 13 Dec 2018 10:55:29 -0500 +++ requests-2.25.1/requests/certs.py 2021-01-10 16:29:06.973238179 -0800
Subject: [PATCH] Patch requests/certs.py to use the system CA bundle @@ -10,8 +10,13 @@
Signed-off-by: Jeremy Cline <jcline@redhat.com>
---
requests/certs.py | 8 +++++++-
setup.py | 1 -
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/requests/certs.py b/requests/certs.py
index d1a378d7..5eb2f1a9 100644
--- a/requests/certs.py
+++ b/requests/certs.py
@@ -11,8 +11,14 @@ only one — the one from the certifi package.
If you are packaging Requests, e.g., for a Linux distribution or a managed 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 environment, you can change the definition of where() to return a separately
packaged CA bundle. packaged CA bundle.
@ -25,22 +13,17 @@ index d1a378d7..5eb2f1a9 100644
+def where(): +def where():
+ """Return the absolute path to the system CA bundle.""" + """Return the absolute path to the system CA bundle."""
+ return '/etc/pki/tls/certs/ca-bundle.crt' + return '/etc/pki/tls/certs/ca-bundle.crt'
+
if __name__ == '__main__': if __name__ == '__main__':
print(where()) print(where())
diff --git a/setup.py b/setup.py diff --color -Nur requests-2.25.1.orig/setup.py requests-2.25.1/setup.py
index 10ce2c62..1f3b2bde 100755 --- requests-2.25.1.orig/setup.py 2020-12-16 11:34:26.000000000 -0800
--- a/setup.py +++ requests-2.25.1/setup.py 2021-01-10 16:29:21.570259552 -0800
+++ b/setup.py @@ -45,7 +45,6 @@
@@ -45,7 +45,6 @@ requires = [ 'chardet>=3.0.2,<5',
'chardet>=3.0.2,<3.1.0', 'idna>=2.5,<3',
'idna>=2.5,<2.9', 'urllib3>=1.21.1,<1.27',
'urllib3>=1.21.1,<1.26,!=1.25.0,!=1.25.1',
- 'certifi>=2017.4.17' - 'certifi>=2017.4.17'
] ]
test_requirements = [ test_requirements = [
--
2.19.2

@ -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)

@ -1,26 +0,0 @@
From 7a33a8e523be6aa40c7e5435d3c5d92f2cc6e9a0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
Date: Mon, 8 Apr 2019 18:04:22 +0200
Subject: [PATCH] Support pytest 4
Fixes https://github.com/kennethreitz/requests/issues/5048
See https://docs.pytest.org/en/latest/deprecations.html#marks-in-pytest-mark-parametrize
---
tests/test_utils.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletions(-)
diff --git a/tests/test_utils.py b/tests/test_utils.py
index 59b0b0efa..62c51494d 100644
--- a/tests/test_utils.py
+++ b/tests/test_utils.py
@@ -33,7 +33,8 @@ class TestSuperLen:
'stream, value', (
(StringIO.StringIO, 'Test'),
(BytesIO, b'Test'),
- pytest.mark.skipif('cStringIO is None')((cStringIO, 'Test')),
+ pytest.param(cStringIO, 'Test',
+ marks=pytest.mark.skipif('cStringIO is None')),
))
def test_io_streams(self, stream, value):
"""Ensures that we properly deal with different kinds of IO streams."""

@ -1,8 +1,11 @@
# Disable tests on RHEL9 as to not pull in the test dependencies
# Specify --with tests to run the tests e.g. on EPEL
%bcond_with tests %bcond_with tests
Name: python-requests Name: python-requests
Version: 2.22.0 Version: 2.25.1
Release: 10%{?dist} Release: 7%{?dist}
Summary: HTTP library, written in Python, for human beings Summary: HTTP library, written in Python, for human beings
License: ASL 2.0 License: ASL 2.0
@ -22,26 +25,27 @@ Patch2: Remove-tests-that-use-the-tarpit.patch
# a pretty odd one so this is a niche requirement. # a pretty odd one so this is a niche requirement.
Patch3: requests-2.12.4-tests_nonet.patch Patch3: requests-2.12.4-tests_nonet.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=1567862 # The [security] extra as present in upstream 2.25.1 is not possible,
Patch4: Don-t-inject-pyopenssl-into-urllib3.patch # because the PyOpenSSL package is not part of RHEL 9.
# We backport a pre-2.26.0 commit that makes request[security] a no-op:
# https://bugzilla.redhat.com/show_bug.cgi?id=1653223 # https://github.com/psf/requests/pull/5867
Patch5: requests-2.20.0-no-py2-httpbin.patch # """
# We initially removed default support for PyOpenSSL in Requests 2.24.0
# https://github.com/kennethreitz/requests/pull/5049 # as it is now considered less secure. Deprecation of the extras_require was
Patch6: support-pytest-4.patch # announced in Requests 2.25.0 and we're officially removing the extras_require
# functionality in Requests 2.26.0.
# Projects currently using requests[security] after this change will continue
# to operate as if performing a standard requests installation (secure by default).
# """
Patch4: Empty-security-extras.patch
# Security fix for CVE-2023-32681 # Security fix for CVE-2023-32681
# Unintended leak of Proxy-Authorization header # Unintended leak of Proxy-Authorization header
# Resolved upstream: https://github.com/psf/requests/commit/74ea7cf7a6a27a4eeb2ae24e162bcc942a6706d5 # Resolved upstream: https://github.com/psf/requests/commit/74ea7cf7a6a27a4eeb2ae24e162bcc942a6706d5
# Tracking bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2209469 # Tracking bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2209469
Patch7: CVE-2023-32681.patch Patch5: CVE-2023-32681.patch
BuildArch: noarch BuildArch: noarch
# Exclude i686 arch. Due to a modularity issue it's being added to the
# x86_64 compose of CRB, but we don't want to ship it at all.
# See: https://projects.engineering.redhat.com/browse/RCM-72605
ExcludeArch: i686
%description %description
Most existing Python modules for sending HTTP requests are extremely verbose and Most existing Python modules for sending HTTP requests are extremely verbose and
@ -55,20 +59,14 @@ Summary: HTTP library, written in Python, for human beings
%{?python_provide:%python_provide python%{python3_pkgversion}-requests} %{?python_provide:%python_provide python%{python3_pkgversion}-requests}
BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python%{python3_pkgversion}-chardet BuildRequires: pyproject-rpm-macros
BuildRequires: python%{python3_pkgversion}-urllib3
BuildRequires: python%{python3_pkgversion}-idna
BuildRequires: python%{python3_pkgversion}-rpm-macros
%if %{with tests} %if %{with tests}
BuildRequires: python%{python3_pkgversion}-pytest BuildRequires: python3dist(pytest)
BuildRequires: python%{python3_pkgversion}-pytest-cov BuildRequires: python3dist(pytest-httpbin)
BuildRequires: python%{python3_pkgversion}-pytest-httpbin BuildRequires: python3dist(pytest-mock)
BuildRequires: python%{python3_pkgversion}-pytest-mock
%endif %endif
Requires: python%{python3_pkgversion}-chardet >= 3.0.2
Requires: python%{python3_pkgversion}-urllib3 >= 1.21.1
Requires: python%{python3_pkgversion}-idna
%description -n python%{python3_pkgversion}-requests %description -n python%{python3_pkgversion}-requests
Most existing Python modules for sending HTTP requests are extremely verbose and Most existing Python modules for sending HTTP requests are extremely verbose and
@ -76,6 +74,16 @@ cumbersome. Pythons built-in urllib2 module provides most of the HTTP
capabilities you should need, but the API is thoroughly broken. This library is capabilities you should need, but the API is thoroughly broken. This library is
designed to make HTTP requests easy for developers. designed to make HTTP requests easy for developers.
%pyproject_extras_subpkg -n python%{python3_pkgversion}-requests security socks
%generate_buildrequires
%if %{with tests}
%pyproject_buildrequires -r
%else
%pyproject_buildrequires
%endif
%prep %prep
%autosetup -p1 -n requests-%{version} %autosetup -p1 -n requests-%{version}
@ -85,39 +93,98 @@ rm -rf requests/cacert.pem
# env shebang in nonexecutable file # env shebang in nonexecutable file
sed -i '/#!\/usr\/.*python/d' requests/certs.py 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
%build %build
%py3_build %pyproject_wheel
%install %install
%py3_install %pyproject_install
%pyproject_save_files requests
%if %{with tests} %if %{with tests}
%check %check
PYTHONPATH=%{buildroot}%{python3_sitelib} %{__python3} -m pytest -v # test_https_warnings: https://github.com/psf/requests/issues/5530
%endif # tests %pytest -v -k "not test_https_warnings"
%endif
%files -n python%{python3_pkgversion}-requests %files -n python%{python3_pkgversion}-requests -f %{pyproject_files}
%license LICENSE %license LICENSE
%doc README.md HISTORY.md %doc README.md HISTORY.md
%{python3_sitelib}/*.egg-info
%{python3_sitelib}/requests/
%changelog %changelog
* Tue Dec 12 2023 MSVSphere Packaging Team <packager@msvsphere-os.ru> - 2.22.0-10 * Fri Jun 16 2023 Charalampos Stratakis <cstratak@redhat.com> - 2.25.1-7
- Rebuilt for MSVSphere 8.8
* Wed Jun 21 2023 Lumír Balhar <lbalhar@redhat.com> - 2.22.0-10
- Security fix for CVE-2023-32681 - Security fix for CVE-2023-32681
Resolves: rhbz#2209469 Resolves: rhbz#2209469
* Fri Dec 13 2019 Tomas Orsava <torsava@redhat.com> - 2.22.0-9 * Tue Feb 08 2022 Tomáš Hrnčiar <thrnciar@redhat.com> - 2.25.1-6
- Exclude unsupported i686 arch - Add automatically generated Obsoletes tag with the python39- prefix
for smoother upgrade from RHEL8
- Related: rhbz#1990421
* Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 2.25.1-5
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Thu Jul 15 2021 Miro Hrončok <mhroncok@redhat.com> - 2.25.1-4
- Make requests[security] extras a no-op (backported from future 2.26.0)
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 2.25.1-3
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Mon Mar 08 2021 Charalampos Stratakis <cstratak@redhat.com> - 2.25.1-2
- Disable tests on RHEL9 to avoid pulling in the test dependencies
* Tue Feb 02 2021 Kevin Fenzi <kevin@scrye.com> - 2.25.1-1
- Update 2.25.1. Fix is rhbz#1908487
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.25.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Wed Nov 25 2020 Petr Viktorin <pviktori@redhat.com> - 2.25.0-1
- Update to 2.25.0
* Fri Nov 13 2020 Miro Hrončok <mhroncok@redhat.com> - 2.24.0-5
- Don't BR pytest-cov
* Fri Sep 18 2020 Petr Viktorin <pviktori@redhat.com> - 2.24.0-4
- Port to pyproject macros
* Fri Sep 18 2020 Miro Hrončok <mhroncok@redhat.com> - 2.24.0-3
- Build with pytest 6, older version is no longer required
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.24.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Fri Jul 10 2020 Miro Hrončok <mhroncok@redhat.com> - 2.24.0-1
- Update to 2.24.0
- Resolves rhbz#1848104
* Fri Jul 10 2020 Miro Hrončok <mhroncok@redhat.com> - 2.23.0-5
- Add requests[security] and requests[socks] subpackages
* Sat May 30 2020 Miro Hrončok <mhroncok@redhat.com> - 2.23.0-4
- Test with pytest 4, drop manual requires
* Mon May 25 2020 Miro Hrončok <mhroncok@redhat.com> - 2.23.0-3
- Rebuilt for Python 3.9
* Fri May 22 2020 Miro Hrončok <mhroncok@redhat.com> - 2.23.0-2
- Bootstrap for Python 3.9
* Fri Feb 21 2020 Randy Barlow <bowlofeggs@fedoraproject.org> - 2.23.0-1
- Update to 2.23.0 (#1804863).
- https://requests.readthedocs.io/en/latest/community/updates/
* Wed Nov 20 2019 Lumír Balhar <lbalhar@redhat.com> - 2.22.0-8 * Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.22.0-8
- Adjusted for Python 3.8 module in RHEL 8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Tue Oct 22 2019 Charalampos Stratakis <cstratak@redhat.com> - 2.22.0-7 * Tue Oct 22 2019 Charalampos Stratakis <cstratak@redhat.com> - 2.22.0-7
- Remove the python2 subpackage (rhbz#1761787) - Remove the python2 subpackage (rhbz#1761787)

Loading…
Cancel
Save