[packages/python3-responses] - python-responses.spec updated to 0.19.0 for python 3.7+

qboosh qboosh at pld-linux.org
Thu Mar 10 19:24:07 CET 2022


commit 26d04866f67749405f5ba18e5c9f8d415eacfd56
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Thu Mar 10 19:26:06 2022 +0100

    - python-responses.spec updated to 0.19.0 for python 3.7+

 python-responses-py2.patch |  19 -------
 python-responses.spec      | 132 ---------------------------------------------
 python3-responses.spec     |  66 +++++++++++++++++++++++
 3 files changed, 66 insertions(+), 151 deletions(-)
---
diff --git a/python-responses.spec b/python-responses.spec
deleted file mode 100644
index b0dab00..0000000
--- a/python-responses.spec
+++ /dev/null
@@ -1,132 +0,0 @@
-#
-# Conditional build:
-%bcond_without	tests	# unit tests
-%bcond_without	python2 # CPython 2.x module
-%bcond_without	python3 # CPython 3.x module
-
-%define		module		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-%{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}/%{module}-%{version}.tar.gz
-# Source0-md5:	7b94ef2851112c11c3bf75455e4ebeff
-Patch0:		%{name}-py2.patch
-URL:		https://github.com/getsentry/responses
-BuildRequires:	rpm-pythonprov
-BuildRequires:	rpmbuild(macros) >= 1.714
-%if %{with python2}
-BuildRequires:	python-modules >= 1:2.7
-BuildRequires:	python-setuptools
-%endif
-%if %{with python3}
-%if %{with tests}
-BuildRequires:	python-cookies
-BuildRequires:	python-coverage >= 3.7.1
-BuildRequires:	python-flake8
-BuildRequires:	python-mock
-BuildRequires:	python-pytest >= 4.6
-BuildRequires:	python-pytest-cov
-BuildRequires:	python-pytest-localserver
-BuildRequires:	python-requests >= 2.0
-BuildRequires:	python-urllib3 >= 1.25.10
-BuildRequires:	python-six
-%endif
-%endif
-%if %{with python3}
-BuildRequires:	python3-modules >= 1:3.5
-BuildRequires:	python3-setuptools
-%if %{with tests}
-BuildRequires:	python3-coverage >= 3.7.1
-BuildRequires:	python3-flake8
-BuildRequires:	python3-pytest >= 4.6
-BuildRequires:	python3-pytest-cov
-BuildRequires:	python3-pytest-localserver
-BuildRequires:	python3-requests >= 2.0
-BuildRequires:	python3-urllib3 >= 1.25.10
-BuildRequires:	python3-six
-%endif
-%endif
-BuildArch:	noarch
-BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
-
-%description
-A utility library for mocking out the requests Python library.
-
-%description -l pl.UTF-8
-Biblioteka narzędziowa do podstawiania atrap biblioteki Pythona
-requests.
-
-%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-%{module}
-A utility library for mocking out the requests Python library.
-
-%description -n python3-%{module} -l pl.UTF-8
-Biblioteka narzędziowa do podstawiania atrap biblioteki Pythona
-requests.
-
-%prep
-%setup -q -n %{module}-%{version}
-%patch0 -p1
-
-%build
-%if %{with python2}
-%py_build
-
-%if %{with tests}
-PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
-PYTEST_PLUGINS="pytest_localserver.plugin" \
-%{__python} -m pytest responses
-%endif
-%endif
-
-%if %{with python3}
-%py3_build
-
-%if %{with tests}
-PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
-PYTEST_PLUGINS="pytest_localserver.plugin" \
-%{__python3} -m pytest responses
-%endif
-%endif
-
-%install
-rm -rf $RPM_BUILD_ROOT
-
-%if %{with python2}
-%py_install
-
-%py_postclean
-%endif
-
-%if %{with python3}
-%py3_install
-%endif
-
-%clean
-rm -rf $RPM_BUILD_ROOT
-
-%if %{with python2}
-%files
-%defattr(644,root,root,755)
-%doc CHANGES README.rst
-%{py_sitescriptdir}/responses
-%{py_sitescriptdir}/responses-%{version}-py*.egg-info
-%endif
-
-%if %{with python3}
-%files -n python3-%{module}
-%defattr(644,root,root,755)
-%doc CHANGES README.rst
-%{py3_sitescriptdir}/responses
-%{py3_sitescriptdir}/responses-%{version}-py*.egg-info
-%endif
diff --git a/python3-responses.spec b/python3-responses.spec
new file mode 100644
index 0000000..159e030
--- /dev/null
+++ b/python3-responses.spec
@@ -0,0 +1,66 @@
+#
+# Conditional build:
+%bcond_without	tests	# unit tests
+
+%define		module		responses
+Summary:	A utility for mocking out the Python Requests library
+Summary(pl.UTF-8):	Narzędzie do podstawiania atrap biblioteki Python Requests
+Name:		python3-%{module}
+Version:	0.19.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}/%{module}-%{version}.tar.gz
+# Source0-md5:	9e70be041a4deaf4f673a8087a35975f
+URL:		https://github.com/getsentry/responses
+BuildRequires:	python3-modules >= 1:3.7
+BuildRequires:	python3-setuptools
+%if %{with tests}
+#BuildRequires:	python3-coverage >= 6.0.0
+BuildRequires:	python3-flake8
+#BuildRequires:	python3-pytest >= 7.0.0
+BuildRequires:	python3-pytest >= 6.2.0
+BuildRequires:	python3-pytest-asyncio
+#BuildRequires:	python3-pytest-cov
+BuildRequires:	python3-pytest-localserver
+BuildRequires:	python3-requests >= 2.0
+BuildRequires:	python3-urllib3 >= 1.25.10
+%endif
+BuildRequires:	rpm-pythonprov
+BuildRequires:	rpmbuild(macros) >= 1.714
+BuildArch:	noarch
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+A utility library for mocking out the requests Python library.
+
+%description -l pl.UTF-8
+Biblioteka narzędziowa do podstawiania atrap biblioteki Pythona
+requests.
+
+%prep
+%setup -q -n %{module}-%{version}
+
+%build
+%py3_build
+
+%if %{with tests}
+PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
+PYTEST_PLUGINS="pytest_asyncio.plugin,pytest_localserver.plugin" \
+%{__python3} -m pytest responses
+%endif
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%py3_install
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(644,root,root,755)
+%doc CHANGES README.rst
+%{py3_sitescriptdir}/responses
+%{py3_sitescriptdir}/responses-%{version}-py*.egg-info
diff --git a/python-responses-py2.patch b/python-responses-py2.patch
deleted file mode 100644
index c7e6355..0000000
--- a/python-responses-py2.patch
+++ /dev/null
@@ -1,19 +0,0 @@
---- 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
- 
-         resp_cookie = _cookies.SimpleCookie()
-         resp_cookie.load(headers["set-cookie"])
- 
-         cookies_dict = {name: v.value for name, v in resp_cookie.items()}
--    except (ImportError, AttributeError):
-+    else:
-         from cookies import Cookies
- 
-         resp_cookies = Cookies.from_request(_ensure_str(headers["set-cookie"]))
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python3-responses.git/commitdiff/26d04866f67749405f5ba18e5c9f8d415eacfd56



More information about the pld-cvs-commit mailing list