!11 Update package version to 1.9.3

From: @lauk001 
Reviewed-by: @xiyuanwang 
Signed-off-by: @xiyuanwang
This commit is contained in:
openeuler-ci-bot 2022-06-07 10:58:56 +00:00 committed by Gitee
commit f4e4e15082
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
5 changed files with 112 additions and 63 deletions

View File

@ -0,0 +1,29 @@
From e1f48323a1eb73018e3929eeac65b26eee7207ea Mon Sep 17 00:00:00 2001
From: Jamie Lennox <jamielennox@gmail.com>
Date: Wed, 4 Dec 2019 21:56:45 +1100
Subject: [PATCH] Use system urllib3 package
The fedora requests package uses the system urllib3 rather than the one
bundled into requests. requests-mock must therefore do the same thing.
---
requests_mock/response.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requests_mock/response.py b/requests_mock/response.py
index d081cf5..13ab2b8 100644
--- a/requests_mock/response.py
+++ b/requests_mock/response.py
@@ -16,9 +16,9 @@ from requests.adapters import HTTPAdapter
from requests.cookies import MockRequest, MockResponse
from requests.cookies import RequestsCookieJar
from requests.cookies import merge_cookies, cookiejar_from_dict
-from requests.packages.urllib3.response import HTTPResponse
from requests.utils import get_encoding_from_headers
import six
+from urllib3.response import HTTPResponse
from requests_mock import compat
from requests_mock import exceptions
--
2.21.0

View File

@ -0,0 +1,41 @@
From b1844f12934f7a1554fdfaf26cb05261d222a1da Mon Sep 17 00:00:00 2001
From: Jamie Lennox <jamielennox@gmail.com>
Date: Wed, 4 Dec 2019 22:16:16 +1100
Subject: [PATCH] Allow skipping purl tests if it is not present
Purl is not available in some packaging scenarios, like on fedora.
Easiest to just ignore this one if not present.
---
tests/test_adapter.py | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/tests/test_adapter.py b/tests/test_adapter.py
index 70d0752..b6aa845 100644
--- a/tests/test_adapter.py
+++ b/tests/test_adapter.py
@@ -13,7 +13,11 @@
import json
import re
-import purl
+try:
+ import purl
+except ImportError:
+ purl = None
+
import requests
import six
from six.moves.urllib import parse as urlparse
@@ -329,6 +333,9 @@ class SessionAdapterTests(base.TestCase):
self.assertEqual('resp', resp.text)
def test_with_purl(self):
+ if purl is None:
+ self.skipTest('purl is not present')
+
self.adapter.register_uri('GET',
purl.URL('mock://www.tester.com/a'),
text='resp')
--
2.21.0

View File

@ -1,85 +1,64 @@
%global _empty_manifest_terminate_build 0
Name: python-requests-mock
Version: 1.8.0
Release: 3
Summary: Mock out responses from the requests package
License: Apache-2
Version: 1.9.3
Release: 1
Summary: A requests mocking tool for python
License: Apache-2.0
URL: https://github.com/jamielennox/requests-mock
Source0: https://files.pythonhosted.org/packages/45/2d/12f93bd2fd08fa2a77abea6370a6dd2d2dc748fb8d8a4521a8f289bde116/requests-mock-1.8.0.tar.gz
Source0: https://files.pythonhosted.org/packages/71/1e/1680394d9ad02bf7fb34f6e161b6eff62c972f2c1e647389ce2d324b3c25/requests-mock-1.9.3.tar.gz
Patch0: 0002-Use-system-urllib3-package.patch
Patch1: 0003-Allow-skipping-purl-tests-if-it-is-not-present.patch
BuildArch: noarch
Requires: python3-requests
Requires: python3-six
Requires: python3-fixtures
Requires: python3-fixtures
Requires: python3-mock
Requires: python3-purl
Requires: python3-pytest
Requires: python3-sphinx
Requires: python3-testrepository
Requires: python3-testtools
%description
Mocked responses for the requests library
requests-mock provides a simple way to do HTTP mocking at the
python-requests layer.
%package -n python3-requests-mock
Summary: Mock out responses from the requests package
Provides: python-requests-mock
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pip
BuildRequires: python3-pbr
%description -n python3-requests-mock
Mocked responses for the requests library
%package -n python%{python3_pkgversion}-requests-mock
Summary: A requests mocking tool for python
%package help
Summary: Development documents and examples for requests-mock
Provides: python3-requests-mock-doc
%description help
Mocked responses for the requests library
Requires: python%{python3_pkgversion}-requests
Requires: python%{python3_pkgversion}-six
BuildRequires: python%{python3_pkgversion}-requests
BuildRequires: python%{python3_pkgversion}-six
BuildRequires: python%{python3_pkgversion}-urllib3
BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python%{python3_pkgversion}-pbr
BuildRequires: python%{python3_pkgversion}-setuptools
%description -n python%{python3_pkgversion}-requests-mock
requests-mock provides a simple way to do HTTP mocking at the
python-requests layer.
%prep
%autosetup -n requests-mock-1.8.0
%setup -q -n requests-mock-%{version}
%patch0 -p1
%patch1 -p1
# Remove bundled egg-info
rm -rf requests_mock.egg-info
%build
%py3_build
%install
%py3_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .
%files -n python3-requests-mock -f filelist.lst
%dir %{python3_sitelib}/*
%files help -f doclist.lst
%{_docdir}/*
%files -n python%{python3_pkgversion}-requests-mock
%license LICENSE
%doc README.rst ChangeLog
%{python3_sitelib}/requests_mock
%{python3_sitelib}/requests_mock-%{version}-py%{python3_version}.egg-info
%changelog
* Tue Jun 07 2022 liukuo <liukuo@kylinos.cn> - 1.9.3-1
- Update package version
* Wed Jan 20 2021 zhangy1317 <zhangy1317@foxmail.com>
- Add BuildRequires
* Thu Dec 31 2020 Python_Bot <Python_Bot@openeuler.org>
- Package Spec generated

Binary file not shown.

BIN
requests-mock-1.9.3.tar.gz Normal file

Binary file not shown.