From 12e897cc24ac797473aff226350c2f9076ab4ed918d8b6c5301d8e0d6bcaccc2 Mon Sep 17 00:00:00 2001 From: Dominique Leuenberger Date: Wed, 16 Dec 2020 09:59:32 +0000 Subject: [PATCH] Accepting request 855662 from devel:languages:python OBS-URL: https://build.opensuse.org/request/show/855662 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-dulwich?expand=0&rev=35 --- python-dulwich.changes | 16 +++++++++++++++ python-dulwich.spec | 9 +++++++-- remove_mock.patch | 45 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 68 insertions(+), 2 deletions(-) create mode 100644 remove_mock.patch diff --git a/python-dulwich.changes b/python-dulwich.changes index 70e4463..b350b2e 100644 --- a/python-dulwich.changes +++ b/python-dulwich.changes @@ -1,3 +1,19 @@ +------------------------------------------------------------------- +Mon Dec 14 00:50:05 UTC 2020 - Benjamin Greiner + +- Fix condition around BuildRequirement + +------------------------------------------------------------------- +Sun Dec 13 20:31:22 UTC 2020 - Matej Cepl + +- We don't need to break Python 2.7 + +------------------------------------------------------------------- +Fri Dec 11 21:52:35 UTC 2020 - Matej Cepl + +- Add remove_mock.patch to remove dependency on the external mock + package (gh#dulwich/dulwich#820). + ------------------------------------------------------------------- Tue Nov 10 07:49:41 UTC 2020 - Dirk Mueller diff --git a/python-dulwich.spec b/python-dulwich.spec index c37d8dd..8aec337 100644 --- a/python-dulwich.spec +++ b/python-dulwich.spec @@ -27,15 +27,20 @@ License: GPL-2.0-or-later OR Apache-2.0 Group: Development/Languages/Python URL: https://www.dulwich.io Source0: https://files.pythonhosted.org/packages/source/d/dulwich/dulwich-%{version}.tar.gz +# PATCH-FIX-UPSTREAM remove_mock.patch gh#dulwich/dulwich#820 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 fastimport} BuildRequires: %{python_module geventhttpclient} BuildRequires: %{python_module gevent} BuildRequires: %{python_module gpg} -BuildRequires: %{python_module mock} BuildRequires: %{python_module setuptools >= 17.1} BuildRequires: %{python_module urllib3 >= 1.24.1} +%if 0%{?suse_version} <= 1500 +BuildRequires: python-mock +%endif BuildRequires: fdupes BuildRequires: python-rpm-macros BuildRequires: python3-Sphinx @@ -55,7 +60,7 @@ Simple Pure-Python implementation of the Git file formats and protocols. Dulwich is the place where Mr. and Mrs. Git live in one of the Monty Python sketches. %prep -%setup -q -n dulwich-%{version} +%autosetup -p1 -n dulwich-%{version} %build export CFLAGS="%{optflags}" diff --git a/remove_mock.patch b/remove_mock.patch new file mode 100644 index 0000000..c341e47 --- /dev/null +++ b/remove_mock.patch @@ -0,0 +1,45 @@ +--- a/dulwich/contrib/test_swift.py ++++ b/dulwich/contrib/test_swift.py +@@ -58,9 +58,12 @@ except ImportError: + missing_libs.append("geventhttpclient") + + try: +- from mock import patch ++ from unittest.mock import patch + except ImportError: +- missing_libs.append("mock") ++ try: ++ from mock import patch ++ except ImportError: ++ missing_libs.append("mock") + + skipmsg = "Required libraries are not installed (%r)" % missing_libs + +--- a/dulwich/tests/test_archive.py ++++ b/dulwich/tests/test_archive.py +@@ -41,9 +41,12 @@ from dulwich.tests.utils import ( + ) + + try: +- from mock import patch ++ from unittest.mock import patch + except ImportError: +- patch = None # type: ignore ++ try: ++ from mock import patch ++ except ImportError: ++ patch = None # type: ignore + + + class ArchiveTests(TestCase): +--- a/setup.py ++++ b/setup.py +@@ -62,7 +62,7 @@ tests_require = ['fastimport'] + + if '__pypy__' not in sys.modules and not sys.platform == 'win32': + tests_require.extend([ +- 'gevent', 'geventhttpclient', 'mock', 'setuptools>=17.1']) ++ 'gevent', 'geventhttpclient', 'setuptools>=17.1']) + + + ext_modules = [