update to 2.26.0

This commit is contained in:
wangkerong 2021-12-04 16:12:51 +08:00
parent d5b854f6f7
commit c383379ef5
4 changed files with 46 additions and 31 deletions

View File

@ -1,29 +1,33 @@
diff --color -Nur requests-2.25.1.orig/requests/certs.py requests-2.25.1/requests/certs.py diff --git a/requests/certs.py b/requests/certs.py
--- requests-2.25.1.orig/requests/certs.py 2021-01-10 16:27:05.027059634 -0800 index a14a7ee..a1841ca 100644
+++ requests-2.25.1/requests/certs.py 2021-01-10 16:29:06.973238179 -0800 --- a/requests/certs.py
@@ -10,8 +10,13 @@ +++ 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 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.
+ -"""
-from certifi import where
+This OpenEuler-patched package returns "/etc/pki/tls/certs/ca-bundle.crt" provided +This OpenEuler-patched package returns "/etc/pki/tls/certs/ca-bundle.crt" provided
+by the ca-certificates RPM package. +by the ca-certificates RPM package.
""" +"""
-from certifi import where
+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 --color -Nur requests-2.25.1.orig/setup.py requests-2.25.1/setup.py diff --git a/setup.py b/setup.py
--- requests-2.25.1.orig/setup.py 2020-12-16 11:34:26.000000000 -0800 index ce5e5c8..de86a91 100755
+++ requests-2.25.1/setup.py 2021-01-10 16:29:21.570259552 -0800 --- a/setup.py
@@ -45,7 +45,6 @@ +++ b/setup.py
'chardet>=3.0.2,<5', @@ -46,7 +46,6 @@ requires = [
'idna>=2.5,<3', 'idna>=2.5,<3; python_version < "3"',
'idna>=2.5,<4; python_version >= "3"',
'urllib3>=1.21.1,<1.27', 'urllib3>=1.21.1,<1.27',
- 'certifi>=2017.4.17' - 'certifi>=2017.4.17'
] ]
test_requirements = [ test_requirements = [
--
2.27.0

View File

@ -1,17 +1,17 @@
%bcond_with tests %bcond_with tests
Name: python-requests Name: python-requests
Version: 2.25.1 Version: 2.26.0
Release: 1 Release: 1
Summary: Python HTTP Library Summary: Python HTTP Library
License: ASL 2.0 License: ASL 2.0
URL: http://python-requests.org/ URL: http://python-requests.org/
Source0: https://github.com/psf/requests/archive/v%{version}.tar.gz Source0: https://github.com/psf/requests/archive/refs/tags/v%{version}.tar.gz
Patch1: requests-2.12.4-tests_nonet.patch Patch1: requests-2.12.4-tests_nonet.patch
Patch2: requests-2.20.0-no-py2-httpbin.patch Patch2: requests-2.20.0-no-py2-httpbin.patch
Patch3: patch-requests-certs.py-to-use-the-system-CA-bundle.patch Patch3: patch-requests-certs.py-to-use-the-system-CA-bundle.patch
Patch4: Remove-tests-that-use-the-tarpit.patch Patch4: Remove-tests-that-use-the-tarpit.patch
BuildArch: noarch BuildArch: noarch
@ -41,6 +41,7 @@ BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python%{python3_pkgversion}-chardet BuildRequires: python%{python3_pkgversion}-chardet
BuildRequires: python%{python3_pkgversion}-urllib3 BuildRequires: python%{python3_pkgversion}-urllib3
BuildRequires: python%{python3_pkgversion}-idna BuildRequires: python%{python3_pkgversion}-idna
%if %{with tests} %if %{with tests}
BuildRequires: python%{python3_pkgversion}-pytest BuildRequires: python%{python3_pkgversion}-pytest
BuildRequires: python%{python3_pkgversion}-pytest-cov BuildRequires: python%{python3_pkgversion}-pytest-cov
@ -78,20 +79,22 @@ sed -i '/#!\/usr\/.*python/d' requests/certs.py
%if %{with tests} %if %{with tests}
%check %check
PYTHONPATH=%{buildroot}%{python3_sitelib} %{__python3} -m pytest -v PYTHONPATH=%{buildroot}%{python3_sitelib} %{__python3} -m pytest -v
%endif # tests %endif
%files -n python%{python3_pkgversion}-requests %files -n python%{python3_pkgversion}-requests
%defattr(-,root,root) %defattr(-,root,root)
%license LICENSE %license LICENSE
%{python3_sitelib}/*.egg-info %{python3_sitelib}/requests-2.26.0-py3.8.egg-info/*
%{python3_sitelib}/requests/ %{python3_sitelib}/requests/
%files help %files help
%defattr(-,root,root) %defattr(-,root,root)
%doc HISTORY.md README.md %doc HISTORY.md README.md
%changelog %changelog
* Sat Dec 04 2021 wangkerong <wangkerong@huawei.com> - 2.26.0-1
- update to 2.26.0
* Thu Feb 4 2021 chengguipeng <chengguipeng1@huawei.com> - 2.25.1-1 * Thu Feb 4 2021 chengguipeng <chengguipeng1@huawei.com> - 2.25.1-1
- update to 2.25.1 - update to 2.25.1

View File

@ -1,24 +1,27 @@
diff --git a/tests/conftest.py b/tests/conftest.py diff --git a/tests/conftest.py b/tests/conftest.py
index cd64a76..1d5ddbb 100644 index 099462c..a7e1cca 100644
--- a/tests/conftest.py --- a/tests/conftest.py
+++ b/tests/conftest.py +++ b/tests/conftest.py
@@ -14,11 +14,23 @@ def prepare_url(value): @@ -26,15 +26,26 @@ def prepare_url(value):
return inner return inner
-@pytest.fixture -@pytest.fixture
-def httpbin(httpbin): -def httpbin(httpbin):
- return prepare_url(httpbin) - return prepare_url(httpbin)
-
-
-@pytest.fixture
-def httpbin_secure(httpbin_secure):
- return prepare_url(httpbin_secure)
-
+import sys +import sys
+
+if sys.version_info[0] < 3: +if sys.version_info[0] < 3:
+ @pytest.fixture + @pytest.fixture
+ def httpbin(): + def httpbin():
+ pytest.skip('No httpbin for Python 2') + pytest.skip('No httpbin for Python 2')
+
-@pytest.fixture
-def httpbin_secure(httpbin_secure):
- return prepare_url(httpbin_secure)
+ @pytest.fixture + @pytest.fixture
+ def httpbin_secure(): + def httpbin_secure():
+ pytest.skip('No httpbin for Python 2') + pytest.skip('No httpbin for Python 2')
@ -32,3 +35,8 @@ index cd64a76..1d5ddbb 100644
+ @pytest.fixture + @pytest.fixture
+ def httpbin_secure(httpbin_secure): + def httpbin_secure(httpbin_secure):
+ return prepare_url(httpbin_secure) + return prepare_url(httpbin_secure)
@pytest.fixture
def nosan_server(tmp_path_factory):
--
2.27.0

Binary file not shown.