diff --git a/python-geventhttpclient.changes b/python-geventhttpclient.changes index 868080b..51311d4 100644 --- a/python-geventhttpclient.changes +++ b/python-geventhttpclient.changes @@ -1,3 +1,19 @@ +------------------------------------------------------------------- +Mon Dec 14 00:36:02 UTC 2020 - Benjamin Greiner + +- Fix condition around BuildRequirement + +------------------------------------------------------------------- +Sun Dec 13 20:26:16 UTC 2020 - Matej Cepl + +- We don't need to break Python 2.7 + +------------------------------------------------------------------- +Fri Dec 11 23:08:43 UTC 2020 - Matej Cepl + +- Add remove_mock.patch to remove dependency on the external mock + package (gh#gwik/geventhttpclient#135). + ------------------------------------------------------------------- Sat Aug 1 05:08:20 UTC 2020 - John Vandenberg diff --git a/python-geventhttpclient.spec b/python-geventhttpclient.spec index 777cbf0..08d9d1b 100644 --- a/python-geventhttpclient.spec +++ b/python-geventhttpclient.spec @@ -25,14 +25,19 @@ License: MIT Group: Development/Languages/Python URL: https://github.com/gwik/geventhttpclient Source: https://files.pythonhosted.org/packages/source/g/geventhttpclient/geventhttpclient-%{version}.tar.gz +# PATCH-FIX-UPSTREAM remove_mock.patch gh#gwik/geventhttpclient#135 mcepl@suse.com +# remove dependency on the external module mock +Patch0: remove_mock.patch BuildRequires: %{python_module certifi} BuildRequires: %{python_module devel} BuildRequires: %{python_module dpkt} BuildRequires: %{python_module gevent} -BuildRequires: %{python_module mock} BuildRequires: %{python_module pytest} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module six} +%if 0%{?suse_version} <= 1500 +BuildRequires: python-mock +%endif BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-certifi @@ -52,7 +57,7 @@ generally, it is designed for pulling from REST APIs and streaming APIs like Twitter's. %prep -%setup -q -n geventhttpclient-%{version} +%autosetup -p1 -n geventhttpclient-%{version} %build %python_build diff --git a/remove_mock.patch b/remove_mock.patch new file mode 100644 index 0000000..e0e5604 --- /dev/null +++ b/remove_mock.patch @@ -0,0 +1,21 @@ +--- a/src/geventhttpclient/tests/test_ssl.py ++++ b/src/geventhttpclient/tests/test_ssl.py +@@ -1,5 +1,7 @@ +-import mock +-from mock import patch, Mock ++try: ++ import unittest.mock as mock ++except ImportError: ++ import mock + + import dpkt.ssl + import six +@@ -117,7 +119,7 @@ def _get_sni_sent_from_client(**addition + ('127.0.0.1', server_port) + ) + with mock.patch( +- 'gevent.socket.getaddrinfo', Mock(return_value=[mock_addrinfo]) ++ 'gevent.socket.getaddrinfo', mock.Mock(return_value=[mock_addrinfo]) + ): + + server_host = 'some_foo'