From e95384ab071ace0048639f764ede27fe3d4f51a3ecbf66e2daceb46552d3aa2b Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Mon, 13 Aug 2018 14:07:39 +0000 Subject: [PATCH] Remove dependency on unittest2 Add remove_unittest2.patch to facilitate that OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-case?expand=0&rev=4 --- python-case.changes | 6 ++++++ python-case.spec | 22 ++++++++++------------ remove_unittest2.patch | 31 +++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+), 12 deletions(-) create mode 100644 remove_unittest2.patch diff --git a/python-case.changes b/python-case.changes index 19c4578..49c68aa 100644 --- a/python-case.changes +++ b/python-case.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Aug 13 14:07:19 UTC 2018 - mcepl@suse.com + +- Remove dependency on unittest2 + Add remove_unittest2.patch to facilitate that + ------------------------------------------------------------------- Wed Mar 15 10:57:58 UTC 2017 - tbechtold@suse.com diff --git a/python-case.spec b/python-case.spec index 90ada45..e144bcb 100644 --- a/python-case.spec +++ b/python-case.spec @@ -1,7 +1,7 @@ # # spec file for package python-case # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -23,25 +23,21 @@ Release: 0 Summary: Python unittest Utilities License: BSD-3-Clause Group: Development/Languages/Python -Url: http://github.com/celery/case -Source: https://pypi.io/packages/source/c/case/case-%{version}.tar.gz +URL: http://github.com/celery/case +Source: https://files.pythonhosted.org/packages/source/c/case/case-%{version}.tar.gz +Patch: remove_unittest2.patch BuildRequires: %{python_module coverage} BuildRequires: %{python_module mock} BuildRequires: %{python_module nose} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module six} +BuildRequires: fdupes BuildRequires: python-rpm-macros -BuildRequires: python2-unittest2 Requires: python-mock >= 2.0 Requires: python-nose >= 1.3.7 Requires: python-setuptools Requires: python-six -%ifpython2 -Requires: python-unittest2 >= 0.5.1 -%endif -BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildArch: noarch - %python_subpackages %description @@ -49,19 +45,21 @@ Python unittest Utilities %prep %setup -q -n case-%{version} +%autopatch -p1 %build %python_build %install %python_install +%python_expand %fdupes %{buildroot}%{$python_sitelib} %check %python_exec setup.py test -%files %python_files -%defattr(-,root,root,-) -%doc Changelog LICENSE README.rst +%files %{python_files} +%license LICENSE +%doc Changelog README.rst %{python_sitelib}/* %changelog diff --git a/remove_unittest2.patch b/remove_unittest2.patch new file mode 100644 index 0000000..2b05939 --- /dev/null +++ b/remove_unittest2.patch @@ -0,0 +1,31 @@ +--- a/requirements/py2.txt ++++ b/requirements/py2.txt +@@ -1,2 +1 @@ + -r deps/mock.txt +-unittest2>=0.5.1 +--- a/case/case.py ++++ b/case/case.py +@@ -4,21 +4,15 @@ import re + import sys + import types + import warnings ++import unittest + + from contextlib import contextmanager + from functools import partial ++from unittest.util import safe_repr, unorderable_list_difference + from six import string_types, itervalues as values, iteritems as items + + from . import mock + +-try: +- import unittest # noqa +- unittest.skip +- from unittest.util import safe_repr, unorderable_list_difference +-except AttributeError: +- import unittest2 as unittest # noqa +- from unittest2.util import safe_repr, unorderable_list_difference # noqa +- + __all__ = ['Case'] + +