From 0f2cdc9456007dcf4f2c26c5d1d2fada6a1bf04ceb9c279719f0cdaaccd859a7 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Sat, 12 Dec 2020 12:12:15 +0000 Subject: [PATCH 1/3] Accepting request 855336 from home:mcepl:branches:devel:tools:scm - Add remove_mock.patch to remove dependency on the external mock package (gh#gwik/geventhttpclient#135). OBS-URL: https://build.opensuse.org/request/show/855336 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-geventhttpclient?expand=0&rev=10 --- python-geventhttpclient.changes | 6 ++++++ python-geventhttpclient.spec | 6 ++++-- remove_mock.patch | 18 ++++++++++++++++++ 3 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 remove_mock.patch diff --git a/python-geventhttpclient.changes b/python-geventhttpclient.changes index 868080b..9e4b82a 100644 --- a/python-geventhttpclient.changes +++ b/python-geventhttpclient.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +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..b65c997 100644 --- a/python-geventhttpclient.spec +++ b/python-geventhttpclient.spec @@ -25,11 +25,13 @@ 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} @@ -52,7 +54,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..0bd7a87 --- /dev/null +++ b/remove_mock.patch @@ -0,0 +1,18 @@ +--- a/src/geventhttpclient/tests/test_ssl.py ++++ b/src/geventhttpclient/tests/test_ssl.py +@@ -1,5 +1,4 @@ +-import mock +-from mock import patch, Mock ++import unittest.mock as mock + + import dpkt.ssl + import six +@@ -117,7 +116,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' From ab05b25e9f364f36b8b52add00bcfdffa548fba549a9f2ba569c40bb3536a60a Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Sun, 13 Dec 2020 21:28:49 +0000 Subject: [PATCH 2/3] Accepting request 855615 from home:mcepl:branches:devel:tools:scm - We don't need to break Python 2.7 OBS-URL: https://build.opensuse.org/request/show/855615 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-geventhttpclient?expand=0&rev=11 --- python-geventhttpclient.changes | 5 +++++ python-geventhttpclient.spec | 3 +++ remove_mock.patch | 9 ++++++--- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/python-geventhttpclient.changes b/python-geventhttpclient.changes index 9e4b82a..a067ef7 100644 --- a/python-geventhttpclient.changes +++ b/python-geventhttpclient.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +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 diff --git a/python-geventhttpclient.spec b/python-geventhttpclient.spec index b65c997..45d3484 100644 --- a/python-geventhttpclient.spec +++ b/python-geventhttpclient.spec @@ -35,6 +35,9 @@ BuildRequires: %{python_module gevent} BuildRequires: %{python_module pytest} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module six} +%ifpython2 +BuildRequires: %{python_module mock} +%endif BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-certifi diff --git a/remove_mock.patch b/remove_mock.patch index 0bd7a87..e0e5604 100644 --- a/remove_mock.patch +++ b/remove_mock.patch @@ -1,13 +1,16 @@ --- a/src/geventhttpclient/tests/test_ssl.py +++ b/src/geventhttpclient/tests/test_ssl.py -@@ -1,5 +1,4 @@ +@@ -1,5 +1,7 @@ -import mock -from mock import patch, Mock -+import unittest.mock as mock ++try: ++ import unittest.mock as mock ++except ImportError: ++ import mock import dpkt.ssl import six -@@ -117,7 +116,7 @@ def _get_sni_sent_from_client(**addition +@@ -117,7 +119,7 @@ def _get_sni_sent_from_client(**addition ('127.0.0.1', server_port) ) with mock.patch( From daf4f2c1386dd5a1cceb33310f233d316a5bfb61de2aa9f120027764845b3f40 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Mon, 14 Dec 2020 06:23:49 +0000 Subject: [PATCH 3/3] Accepting request 855632 from home:bnavigator:branches:devel:languages:python - Fix condition around BuildRequirement OBS-URL: https://build.opensuse.org/request/show/855632 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-geventhttpclient?expand=0&rev=12 --- python-geventhttpclient.changes | 5 +++++ python-geventhttpclient.spec | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/python-geventhttpclient.changes b/python-geventhttpclient.changes index a067ef7..51311d4 100644 --- a/python-geventhttpclient.changes +++ b/python-geventhttpclient.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Dec 14 00:36:02 UTC 2020 - Benjamin Greiner + +- Fix condition around BuildRequirement + ------------------------------------------------------------------- Sun Dec 13 20:26:16 UTC 2020 - Matej Cepl diff --git a/python-geventhttpclient.spec b/python-geventhttpclient.spec index 45d3484..08d9d1b 100644 --- a/python-geventhttpclient.spec +++ b/python-geventhttpclient.spec @@ -35,8 +35,8 @@ BuildRequires: %{python_module gevent} BuildRequires: %{python_module pytest} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module six} -%ifpython2 -BuildRequires: %{python_module mock} +%if 0%{?suse_version} <= 1500 +BuildRequires: python-mock %endif BuildRequires: fdupes BuildRequires: python-rpm-macros