Compare commits

...

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

2
.gitignore vendored

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

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

@ -0,0 +1,38 @@
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

@ -1,13 +0,0 @@
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 bb1c91432c5e9a1f402692db5c80c65136656afb Mon Sep 17 00:00:00 2001
From 524cd22fb77e69db9bb3f017bbb1d9782c37b0cd Mon Sep 17 00:00:00 2001
From: Jeremy Cline <jeremy@jcline.org>
Date: Tue, 13 Jun 2017 09:08:09 -0400
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(-)
diff --git a/tests/test_requests.py b/tests/test_requests.py
index 7d4a4eb5..8d1c55fc 100644
index b8350cb..46b7e9e 100755
--- a/tests/test_requests.py
+++ b/tests/test_requests.py
@@ -2186,31 +2186,6 @@ class TestTimeout:
@@ -2049,31 +2049,6 @@ class TestTimeout:
except ReadTimeout:
pass
@ -48,8 +48,8 @@ index 7d4a4eb5..8d1c55fc 100644
- pass
-
def test_encoded_methods(self, httpbin):
"""See: https://github.com/psf/requests/issues/2316"""
"""See: https://github.com/requests/requests/issues/2316"""
r = requests.request(b'GET', httpbin('get'))
--
2.24.1
2.9.4

@ -1,7 +1,19 @@
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 d5a4f2908fab5ca16eb59db8b18eda7a94a37b04 Mon Sep 17 00:00:00 2001
From: Jeremy Cline <jcline@redhat.com>
Date: Thu, 13 Dec 2018 10:55:29 -0500
Subject: [PATCH] Patch requests/certs.py to use the system CA bundle
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
environment, you can change the definition of where() to return a separately
packaged CA bundle.
@ -13,17 +25,22 @@ diff --color -Nur requests-2.25.1.orig/requests/certs.py requests-2.25.1/request
+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',
'urllib3>=1.21.1,<1.27',
diff --git a/setup.py b/setup.py
index 10ce2c62..1f3b2bde 100755
--- a/setup.py
+++ b/setup.py
@@ -45,7 +45,6 @@ requires = [
'chardet>=3.0.2,<3.1.0',
'idna>=2.5,<2.9',
'urllib3>=1.21.1,<1.26,!=1.25.0,!=1.25.1',
- 'certifi>=2017.4.17'
]
test_requirements = [
--
2.19.2

@ -0,0 +1,34 @@
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)

@ -0,0 +1,26 @@
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,11 +1,8 @@
# 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
Name: python-requests
Version: 2.25.1
Release: 7%{?dist}
Version: 2.22.0
Release: 10%{?dist}
Summary: HTTP library, written in Python, for human beings
License: ASL 2.0
@ -25,27 +22,26 @@ Patch2: Remove-tests-that-use-the-tarpit.patch
# a pretty odd one so this is a niche requirement.
Patch3: requests-2.12.4-tests_nonet.patch
# The [security] extra as present in upstream 2.25.1 is not possible,
# 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://github.com/psf/requests/pull/5867
# """
# We initially removed default support for PyOpenSSL in Requests 2.24.0
# as it is now considered less secure. Deprecation of the extras_require was
# 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
# https://bugzilla.redhat.com/show_bug.cgi?id=1567862
Patch4: Don-t-inject-pyopenssl-into-urllib3.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=1653223
Patch5: requests-2.20.0-no-py2-httpbin.patch
# https://github.com/kennethreitz/requests/pull/5049
Patch6: support-pytest-4.patch
# Security fix for CVE-2023-32681
# Unintended leak of Proxy-Authorization header
# Resolved upstream: https://github.com/psf/requests/commit/74ea7cf7a6a27a4eeb2ae24e162bcc942a6706d5
# Tracking bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2209469
Patch5: CVE-2023-32681.patch
Patch7: CVE-2023-32681.patch
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
Most existing Python modules for sending HTTP requests are extremely verbose and
@ -59,14 +55,20 @@ Summary: HTTP library, written in Python, for human beings
%{?python_provide:%python_provide python%{python3_pkgversion}-requests}
BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: pyproject-rpm-macros
BuildRequires: python%{python3_pkgversion}-chardet
BuildRequires: python%{python3_pkgversion}-urllib3
BuildRequires: python%{python3_pkgversion}-idna
BuildRequires: python%{python3_pkgversion}-rpm-macros
%if %{with tests}
BuildRequires: python3dist(pytest)
BuildRequires: python3dist(pytest-httpbin)
BuildRequires: python3dist(pytest-mock)
BuildRequires: python%{python3_pkgversion}-pytest
BuildRequires: python%{python3_pkgversion}-pytest-cov
BuildRequires: python%{python3_pkgversion}-pytest-httpbin
BuildRequires: python%{python3_pkgversion}-pytest-mock
%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
Most existing Python modules for sending HTTP requests are extremely verbose and
@ -74,16 +76,6 @@ cumbersome. Pythons 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 security socks
%generate_buildrequires
%if %{with tests}
%pyproject_buildrequires -r
%else
%pyproject_buildrequires
%endif
%prep
%autosetup -p1 -n requests-%{version}
@ -93,98 +85,39 @@ 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
%build
%pyproject_wheel
%py3_build
%install
%pyproject_install
%pyproject_save_files requests
%py3_install
%if %{with tests}
%check
# test_https_warnings: https://github.com/psf/requests/issues/5530
%pytest -v -k "not test_https_warnings"
%endif
PYTHONPATH=%{buildroot}%{python3_sitelib} %{__python3} -m pytest -v
%endif # tests
%files -n python%{python3_pkgversion}-requests -f %{pyproject_files}
%files -n python%{python3_pkgversion}-requests
%license LICENSE
%doc README.md HISTORY.md
%{python3_sitelib}/*.egg-info
%{python3_sitelib}/requests/
%changelog
* Fri Jun 16 2023 Charalampos Stratakis <cstratak@redhat.com> - 2.25.1-7
* Fri May 24 2024 MSVSphere Packaging Team <packager@msvsphere-os.ru> - 2.22.0-10
- Rebuilt for MSVSphere 8.10
* Wed Jun 21 2023 Lumír Balhar <lbalhar@redhat.com> - 2.22.0-10
- Security fix for CVE-2023-32681
Resolves: rhbz#2209469
* Tue Feb 08 2022 Tomáš Hrnčiar <thrnciar@redhat.com> - 2.25.1-6
- 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/
* Fri Dec 13 2019 Tomas Orsava <torsava@redhat.com> - 2.22.0-9
- Exclude unsupported i686 arch
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.22.0-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Wed Nov 20 2019 Lumír Balhar <lbalhar@redhat.com> - 2.22.0-8
- Adjusted for Python 3.8 module in RHEL 8
* Tue Oct 22 2019 Charalampos Stratakis <cstratak@redhat.com> - 2.22.0-7
- Remove the python2 subpackage (rhbz#1761787)

Loading…
Cancel
Save