[packages/python-responses] - updated to 0.17.0 (the last supporting python2)
qboosh
qboosh at pld-linux.org
Thu Mar 10 18:44:55 CET 2022
commit 6a52c6f75e8d480fd29b92eddfa06bdb17f628c3
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Thu Mar 10 18:46:50 2022 +0100
- updated to 0.17.0 (the last supporting python2)
python-responses-py2.patch | 12 ++++++------
python-responses.spec | 38 ++++++++++++++++++--------------------
2 files changed, 24 insertions(+), 26 deletions(-)
---
diff --git a/python-responses.spec b/python-responses.spec
index ef4e0d1..b0dab00 100644
--- a/python-responses.spec
+++ b/python-responses.spec
@@ -5,19 +5,18 @@
%bcond_without python3 # CPython 3.x module
%define module responses
-%define egg_name responses
-%define pypi_name responses
Summary: A utility for mocking out the Python Requests library
Summary(pl.UTF-8): Narzędzie do podstawiania atrap biblioteki Python Requests
-Name: python-%{pypi_name}
-Version: 0.12.1
-Release: 2
+Name: python-%{module}
+# keep 0.17.x here for python2 support
+Version: 0.17.0
+Release: 1
License: Apache v2.0
+Group: Libraries/Python
#Source0Download: https://github.com/getsentry/responses/releases
-Source0: https://github.com/getsentry/responses/archive/%{version}/%{pypi_name}-%{version}.tar.gz
-# Source0-md5: afbac75fad56fe130f7915ce6feff0db
+Source0: https://github.com/getsentry/responses/archive/%{version}/%{module}-%{version}.tar.gz
+# Source0-md5: 7b94ef2851112c11c3bf75455e4ebeff
Patch0: %{name}-py2.patch
-Group: Libraries/Python
URL: https://github.com/getsentry/responses
BuildRequires: rpm-pythonprov
BuildRequires: rpmbuild(macros) >= 1.714
@@ -63,20 +62,20 @@ A utility library for mocking out the requests Python library.
Biblioteka narzędziowa do podstawiania atrap biblioteki Pythona
requests.
-%package -n python3-%{pypi_name}
+%package -n python3-%{module}
Summary: A utility for mocking out the Python Requests library
Summary(pl.UTF-8): Narzędzie do podstawiania atrap biblioteki Python Requests
Group: Libraries/Python
-%description -n python3-%{pypi_name}
+%description -n python3-%{module}
A utility library for mocking out the requests Python library.
-%description -n python3-%{pypi_name} -l pl.UTF-8
+%description -n python3-%{module} -l pl.UTF-8
Biblioteka narzędziowa do podstawiania atrap biblioteki Pythona
requests.
%prep
-%setup -q -n %{pypi_name}-%{version}
+%setup -q -n %{module}-%{version}
%patch0 -p1
%build
@@ -86,7 +85,7 @@ requests.
%if %{with tests}
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
PYTEST_PLUGINS="pytest_localserver.plugin" \
-%{__python} -m pytest test_responses.py
+%{__python} -m pytest responses
%endif
%endif
@@ -96,7 +95,7 @@ PYTEST_PLUGINS="pytest_localserver.plugin" \
%if %{with tests}
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
PYTEST_PLUGINS="pytest_localserver.plugin" \
-%{__python3} -m pytest test_responses.py
+%{__python3} -m pytest responses
%endif
%endif
@@ -120,15 +119,14 @@ rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
%doc CHANGES README.rst
-%{py_sitescriptdir}/responses.py[co]
-%{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
+%{py_sitescriptdir}/responses
+%{py_sitescriptdir}/responses-%{version}-py*.egg-info
%endif
%if %{with python3}
-%files -n python3-%{pypi_name}
+%files -n python3-%{module}
%defattr(644,root,root,755)
%doc CHANGES README.rst
-%{py3_sitescriptdir}/responses.py
-%{py3_sitescriptdir}/__pycache__/responses.cpython-*.pyc
-%{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
+%{py3_sitescriptdir}/responses
+%{py3_sitescriptdir}/responses-%{version}-py*.egg-info
%endif
diff --git a/python-responses-py2.patch b/python-responses-py2.patch
index c4c9aec..c7e6355 100644
--- a/python-responses-py2.patch
+++ b/python-responses-py2.patch
@@ -1,18 +1,18 @@
---- responses-0.12.1/responses.py.orig 2020-11-12 07:48:06.000000000 +0100
-+++ responses-0.12.1/responses.py 2021-02-14 18:40:46.615255256 +0100
-@@ -122,14 +122,14 @@
+--- responses-0.17.0/responses/__init__.py.orig 2022-01-07 17:17:57.000000000 +0100
++++ responses-0.17.0/responses/__init__.py 2022-03-10 18:30:33.217435207 +0100
+@@ -141,14 +141,14 @@ def _ensure_str(s):
def _cookies_from_headers(headers):
- try:
+ if six.PY3: # http.cookies.SimpleCookie().load() from future fails with unicode input
- import http.cookies as cookies
+ import http.cookies as _cookies
- resp_cookie = cookies.SimpleCookie()
+ resp_cookie = _cookies.SimpleCookie()
resp_cookie.load(headers["set-cookie"])
cookies_dict = {name: v.value for name, v in resp_cookie.items()}
-- except ImportError:
+- except (ImportError, AttributeError):
+ else:
from cookies import Cookies
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/python-responses.git/commitdiff/6a52c6f75e8d480fd29b92eddfa06bdb17f628c3
More information about the pld-cvs-commit
mailing list