Accepting request 901102 from devel:languages:python

- Add NullMatcherClass-hashable.patch which adds __hash__
  method to NullMatcherClass, so that it works with Sphinx4
  (gh#whoosh-community/whoosh#570).

OBS-URL: https://build.opensuse.org/request/show/901102
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-Whoosh?expand=0&rev=6
This commit is contained in:
Dominique Leuenberger 2021-06-23 15:38:07 +00:00 committed by Git OBS Bridge
commit ef39234607
3 changed files with 30 additions and 3 deletions

View File

@ -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 "<NullMatcher>"
+ def __hash__(self):
+ return hash((self.is_active(), tuple(self.all_ids())))
+
def supports_block_quality(self):
return True

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Mon Jun 21 07:55:58 UTC 2021 - Matej Cepl <mcepl@suse.com>
- 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 <tchvatal@suse.com>

View File

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