diff --git a/python-sure-no-mock.patch b/python-sure-no-mock.patch new file mode 100644 index 0000000..3fac1f9 --- /dev/null +++ b/python-sure-no-mock.patch @@ -0,0 +1,23 @@ +--- a/sure/core.py ++++ b/sure/core.py +@@ -21,7 +21,10 @@ + try: + from mock import _CallList + except ImportError: +- from mock.mock import _CallList ++ try: ++ from mock.mock import _CallList ++ except ImportError: ++ from unittest.mock import _CallList + + import inspect + from six import ( +@@ -40,6 +43,7 @@ class Anything(object): + def __eq__(self, _): + return True + ++ + anything = Anything() + + + diff --git a/python-sure.changes b/python-sure.changes index f506340..95d87f4 100644 --- a/python-sure.changes +++ b/python-sure.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Wed May 4 08:38:45 UTC 2022 - pgajdos@suse.com + +- do not require mock for build nor runtime +- added patches + fix https://github.com/gabrielfalcao/sure/pull/161 + + python-sure-no-mock.patch + ------------------------------------------------------------------- Sun Dec 12 16:15:50 UTC 2021 - Ben Greiner diff --git a/python-sure.spec b/python-sure.spec index dde88c7..76e6570 100644 --- a/python-sure.spec +++ b/python-sure.spec @@ -1,7 +1,7 @@ # # spec file for package python-sure # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -25,14 +25,14 @@ License: GPL-3.0-or-later Group: Development/Languages/Python URL: https://github.com/gabrielfalcao/sure Source: https://files.pythonhosted.org/packages/source/s/sure/sure-%{version}.tar.gz +# https://github.com/gabrielfalcao/sure/pull/161 +Patch0: python-sure-no-mock.patch BuildRequires: %{python_module mock >= 2.0.0} BuildRequires: %{python_module pytest} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module six >= 1.10.0} BuildRequires: fdupes BuildRequires: python-rpm-macros -# regarding mock: https://github.com/gabrielfalcao/sure/pull/161 -Requires: python-mock >= 2.0.0 Requires: python-six >= 1.10.0 Requires(post): update-alternatives Requires(postun):update-alternatives @@ -45,6 +45,7 @@ heavily inspired by should.js %prep %setup -q -n sure-%{version} +%patch0 -p1 sed -i '/^#!/d' sure/*.py sed -i 's/--cov=sure//' setup.cfg