diff --git a/NullMatcherClass-hashable.patch b/NullMatcherClass-hashable.patch new file mode 100644 index 0000000..791f8b2 --- /dev/null +++ b/NullMatcherClass-hashable.patch @@ -0,0 +1,16 @@ +--- + src/whoosh/matching/mcore.py | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/src/whoosh/matching/mcore.py ++++ b/src/whoosh/matching/mcore.py +@@ -379,6 +379,9 @@ class NullMatcherClass(Matcher): + def __repr__(self): + return "" + ++ def __hash__(self): ++ return hash((self.is_active(), tuple(self.all_ids()))) ++ + def supports_block_quality(self): + return True + diff --git a/python-Whoosh.changes b/python-Whoosh.changes index d4c6005..373ad45 100644 --- a/python-Whoosh.changes +++ b/python-Whoosh.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Mon Jun 21 07:55:58 UTC 2021 - Matej Cepl + +- Add NullMatcherClass-hashable.patch which adds __hash__ + method to NullMatcherClass, so that it works with Sphinx4 + (gh#whoosh-community/whoosh#570). + ------------------------------------------------------------------- Thu Jul 18 08:22:32 UTC 2019 - Tomáš Chvátal diff --git a/python-Whoosh.spec b/python-Whoosh.spec index f39429f..f622f0b 100644 --- a/python-Whoosh.spec +++ b/python-Whoosh.spec @@ -1,7 +1,7 @@ # # spec file for package python-Whoosh # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -25,8 +25,13 @@ License: BSD-2-Clause Group: Development/Languages/Python URL: https://github.com/whoosh-community/whoosh/ Source: https://files.pythonhosted.org/packages/source/W/Whoosh/Whoosh-%{version}.tar.gz +# upstream in completely unrelated https://github.com/whoosh-community/whoosh/commit/b43e5a432109 Patch0: pytest4.patch +# upstream in https://github.com/whoosh-community/whoosh/commit/f5a777572fb9 Patch1: py2encoding.patch +# PATCH-FIX-UPSTREAM NullMatcherClass-hashable.patch gh#whoosh-community/whoosh#570 mcepl@suse.com +# NullMatcherClass needs __hash__ method as well for Sphinx4 compatiblity. +Patch2: NullMatcherClass-hashable.patch BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros @@ -61,8 +66,7 @@ needs. This package contains the documentation. %prep -%setup -q -n Whoosh-%{version} -%autopatch -p1 +%autosetup -p1 -n Whoosh-%{version} %build %python_build