Update to v2.22

This commit is contained in:
Jeremy Cline 2018-12-13 10:59:21 -05:00
commit f4fd5a97b9
5 changed files with 53 additions and 21 deletions

2
.gitignore vendored
View file

@ -40,3 +40,5 @@
/requests-v2.19.0.tar.gz
/requests-v2.19.1.tar.gz
/requests-v2.20.0.tar.gz
/requests-v2.21.0.tar.gz
/requests-v2.22.0.tar.gz

View file

@ -1,19 +1,19 @@
From a8ef690988f92a56226f8b688f1a3638346bca8e Mon Sep 17 00:00:00 2001
From: Jeremy Cline <jeremy@jcline.org>
Date: Mon, 19 Jun 2017 16:09:02 -0400
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 <jeremy@jcline.org>
Signed-off-by: Jeremy Cline <jcline@redhat.com>
---
requests/certs.py | 11 ++++++++++-
setup.py | 1 -
2 files changed, 10 insertions(+), 2 deletions(-)
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..7b103baf 100644
index d1a378d7..5eb2f1a9 100644
--- a/requests/certs.py
+++ b/requests/certs.py
@@ -11,8 +11,17 @@ only one — the one from the certifi package.
@@ -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.
@ -22,28 +22,25 @@ index d1a378d7..7b103baf 100644
+by the ca-certificates RPM package.
"""
-from certifi import where
+try:
+ from certifi import where
+except ImportError:
+ def where():
+ """Return the absolute path to the system CA bundle."""
+ return '/etc/pki/tls/certs/ca-bundle.crt'
+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 4e2ad936..60de5861 100755
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.8',
'urllib3>=1.21.1,<1.25',
'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.1
2.19.2

View file

@ -9,7 +9,7 @@
Name: python-requests
Version: 2.20.0
Version: 2.22.0
Release: 1%{?dist}
Summary: HTTP library, written in Python, for human beings
@ -33,6 +33,9 @@ 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
# https://github.com/kennethreitz/requests/pull/5049
Patch5: support-pytest-4.patch
BuildArch: noarch
%description
@ -139,6 +142,10 @@ PYTHONPATH=%{buildroot}%{python3_sitelib} %{__python3} -m pytest -v
%changelog
* Thu May 23 2019 Jeremy Cline <jcline@redhat.com> - 2.22.0-1
- Update to v2.22.0
- Don't rely on certifi being patched properly to use the system CA bundle
* Mon Oct 29 2018 Jeremy Cline <jeremy@jcline.org> - 2.20.0-1
- Update to v2.20.0

View file

@ -1 +1 @@
SHA512 (requests-v2.20.0.tar.gz) = 766c69d1778e7286232fcd750842e89cd9bb6637076e80fe95fb67f3ccb14049bf74a533de91ef9451ac6f397ad0a6d148eb444009f501178138cdeffc5ee7c4
SHA512 (requests-v2.22.0.tar.gz) = 1259c270e343fc860322b105904232226f26b3b363e9d102d599020fcc7b6e1d524dc6c650181ce3152caebe11d2c60045ddd9c9fc04560294caa284e209c386

26
support-pytest-4.patch Normal file
View file

@ -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."""