1
0

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
This commit is contained in:
Dominique Leuenberger 2020-12-16 09:59:32 +00:00 committed by Git OBS Bridge
parent eae3e3bf00
commit 12e897cc24
3 changed files with 68 additions and 2 deletions

View File

@ -1,3 +1,19 @@
-------------------------------------------------------------------
Mon Dec 14 00:50:05 UTC 2020 - Benjamin Greiner <code@bnavigator.de>
- Fix condition around BuildRequirement
-------------------------------------------------------------------
Sun Dec 13 20:31:22 UTC 2020 - Matej Cepl <mcepl@suse.com>
- We don't need to break Python 2.7
-------------------------------------------------------------------
Fri Dec 11 21:52:35 UTC 2020 - Matej Cepl <mcepl@suse.com>
- 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 <dmueller@suse.com>

View File

@ -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}"

45
remove_mock.patch Normal file
View File

@ -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 = [