]> git.pld-linux.org Git - packages/python-responses.git/commitdiff
- updated to 0.17.0 (the last supporting python2)
authorJakub Bogusz <qboosh@pld-linux.org>
Thu, 10 Mar 2022 17:46:50 +0000 (18:46 +0100)
committerJakub Bogusz <qboosh@pld-linux.org>
Thu, 10 Mar 2022 17:46:50 +0000 (18:46 +0100)
python-responses-py2.patch
python-responses.spec

index c4c9aecd8c7d465daa040e2f064499e36cfaa22b..c7e6355d3a78943fec6737a5e1ba0c8945e024ec 100644 (file)
@@ -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
  
index ef4e0d1849772c1e5388c22372e443610f60dbdd..b0dab006f3f221705c7e20477269a2c0214527cf 100644 (file)
@@ -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
This page took 0.063245 seconds and 4 git commands to generate.