Compare commits
10 Commits
81afba2bd8
...
bab67cac1b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bab67cac1b | ||
|
|
8b1af613bc | ||
|
|
c1f7bf198e | ||
|
|
9893d17ea9 | ||
|
|
bd963eea46 | ||
|
|
9af2b2740c | ||
|
|
069aee2844 | ||
|
|
70f0111236 | ||
|
|
5b99a2a50e | ||
|
|
254a52ea5b |
@ -1,41 +0,0 @@
|
||||
From cc1b9954ca7dcd90a694f7e2e9990c883bf7b647 Mon Sep 17 00:00:00 2001
|
||||
From: Lumir Balhar <lbalhar@redhat.com>
|
||||
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.
|
||||
+"""
|
||||
+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.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
|
||||
@ -1,51 +0,0 @@
|
||||
From bb1c91432c5e9a1f402692db5c80c65136656afb 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
|
||||
|
||||
The latest version of Mock has started using systemd containers. The
|
||||
systemd-nspawn command is being run with --private-network, which
|
||||
immediately kills connections to something other than localhost. These
|
||||
tests depend on the connection not being killed immediately and that
|
||||
they are never responded to.
|
||||
|
||||
Signed-off-by: Jeremy Cline <jeremy@jcline.org>
|
||||
|
||||
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
|
||||
+++ requests-2/tests/test_requests.py 2020-08-04 18:13:19.891000000 +0800
|
||||
@@ -2188,30 +2188,6 @@
|
||||
except ReadTimeout:
|
||||
pass
|
||||
|
||||
- @pytest.mark.parametrize(
|
||||
- 'timeout', (
|
||||
- (0.1, None),
|
||||
- Urllib3Timeout(connect=0.1, read=None)
|
||||
- ))
|
||||
- def test_connect_timeout(self, timeout):
|
||||
- try:
|
||||
- requests.get(TARPIT, timeout=timeout)
|
||||
- pytest.fail('The connect() request should time out.')
|
||||
- except ConnectTimeout as e:
|
||||
- assert isinstance(e, ConnectionError)
|
||||
- assert isinstance(e, Timeout)
|
||||
-
|
||||
- @pytest.mark.parametrize(
|
||||
- 'timeout', (
|
||||
- (0.1, 0.1),
|
||||
- Urllib3Timeout(connect=0.1, read=0.1)
|
||||
- ))
|
||||
- def test_total_timeout_connect(self, timeout):
|
||||
- try:
|
||||
- requests.get(TARPIT, timeout=timeout)
|
||||
- pytest.fail('The connect() request should time out.')
|
||||
- except ConnectTimeout:
|
||||
- pass
|
||||
|
||||
def test_encoded_methods(self, httpbin):
|
||||
"""See: https://github.com/psf/requests/issues/2316"""
|
||||
|
||||
@ -1,13 +0,0 @@
|
||||
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 @@
|
||||
"""Dummy server using for unit testing"""
|
||||
WAIT_EVENT_TIMEOUT = 5
|
||||
|
||||
- def __init__(self, handler=None, host='localhost', port=0, requests_to_handle=1, wait_to_close_event=None):
|
||||
+ def __init__(self, handler=None, host='127.0.0.1', port=0, requests_to_handle=1, wait_to_close_event=None):
|
||||
super(Server, self).__init__()
|
||||
|
||||
self.handler = handler or consume_socket_content
|
||||
58
backport-requests-2.31.0-system-certs.patch
Normal file
58
backport-requests-2.31.0-system-certs.patch
Normal file
@ -0,0 +1,58 @@
|
||||
From c8ed737d0390497b63c410a8239fea425c62a757 Mon Sep 17 00:00:00 2001
|
||||
From: lingjuer <zhangchenglin@kylinos.cn>
|
||||
Date: Wed, 26 Jul 2023 10:20:57 +0800
|
||||
Subject: [PATCH] backport-requests-2.31.0-system-certs
|
||||
|
||||
---
|
||||
requests/certs.py | 7 ++++++-
|
||||
setup.cfg | 1 -
|
||||
setup.py | 2 +-
|
||||
3 files changed, 7 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/requests/certs.py b/requests/certs.py
|
||||
index be422c3..1795e1c 100644
|
||||
--- a/requests/certs.py
|
||||
+++ b/requests/certs.py
|
||||
@@ -10,8 +10,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 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 --git a/setup.cfg b/setup.cfg
|
||||
index ea45aaf..056b065 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..a1a50a3 100755
|
||||
--- a/setup.py
|
||||
+++ b/setup.py
|
||||
@@ -62,7 +62,7 @@ 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.39.1
|
||||
|
||||
@ -1,17 +1,13 @@
|
||||
%bcond_with tests
|
||||
|
||||
Name: python-requests
|
||||
Version: 2.26.0
|
||||
Release: 3
|
||||
Version: 2.31.0
|
||||
Release: 1
|
||||
Summary: Python HTTP Library
|
||||
License: ASL 2.0
|
||||
URL: http://python-requests.org/
|
||||
Source0: https://github.com/psf/requests/archive/refs/tags/v%{version}.tar.gz
|
||||
|
||||
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
|
||||
|
||||
Source0: https://github.com/requests/requests/archive/v%{version}/requests-v%{version}.tar.gz#/requests-%{version}.tar.gz
|
||||
Patch6001: backport-requests-2.31.0-system-certs.patch
|
||||
BuildArch: noarch
|
||||
|
||||
%description
|
||||
@ -41,6 +37,7 @@ BuildRequires: python%{python3_pkgversion}-chardet
|
||||
BuildRequires: python%{python3_pkgversion}-urllib3
|
||||
BuildRequires: python%{python3_pkgversion}-idna
|
||||
|
||||
|
||||
Provides: python%{python3_pkgversion}dist(requests) = %{version}
|
||||
Provides: python%{python3_version}dist(requests) = %{version}
|
||||
|
||||
@ -95,6 +92,21 @@ PYTHONPATH=%{buildroot}%{python3_sitelib} %{__python3} -m pytest -v
|
||||
%doc HISTORY.md README.md
|
||||
|
||||
%changelog
|
||||
* Thu Jul 13 2023 zhangchenglin <zhangchenglin@kylinos.cn> - 2.31.0-1
|
||||
- Update package to version 2.31.0
|
||||
|
||||
* Wed May 31 2023 zhangpan <zhangpan103@h-partners.com> - 2.28.1-3
|
||||
- fix CVE-2023-32681
|
||||
|
||||
* Wed Jan 11 2023 yaoxin <yaoxin30@h-partners.com> - 2.28.1-2
|
||||
- Fix the publicsuffix2 build error caused by the python-charset-normalizer update.
|
||||
|
||||
* Thu Jul 28 2022 fushanqing <fushanqing@kylinos.cn> - 2.28.1-1
|
||||
- update python-requests to 2.28.1
|
||||
|
||||
* Thu Jun 16 2022 zhangying <zhangy1317@foxmail.com> - 2.27.1-1
|
||||
- Upgrade version for openstack yoga
|
||||
|
||||
* Wed Dec 22 2021 wangkerong <wangkerong@huawei.com> - 2.26.0-3
|
||||
- add python-charset-normalizer requires
|
||||
|
||||
|
||||
BIN
requests-2.31.0.tar.gz
Normal file
BIN
requests-2.31.0.tar.gz
Normal file
Binary file not shown.
BIN
v2.26.0.tar.gz
BIN
v2.26.0.tar.gz
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user