commit python-Whoosh for openSUSE:Factory
Hello community, here is the log from the commit of package python-Whoosh for openSUSE:Factory checked in at 2019-07-30 13:00:47 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-Whoosh (Old) and /work/SRC/openSUSE:Factory/.python-Whoosh.new.4126 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "python-Whoosh" Tue Jul 30 13:00:47 2019 rev:5 rq:716224 version:2.7.4 Changes: -------- --- /work/SRC/openSUSE:Factory/python-Whoosh/python-Whoosh.changes 2018-12-13 19:44:55.740974731 +0100 +++ /work/SRC/openSUSE:Factory/.python-Whoosh.new.4126/python-Whoosh.changes 2019-07-30 13:00:48.698443119 +0200 @@ -1,0 +2,10 @@ +Thu Jul 18 08:22:32 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com> + +- Add patch to fix build with pytest4+ (both in git of upstream): + * pytest4.patch + * py2encoding.patch +- Use fdupes +- Update URL +- Make sure py2 tests are run too + +------------------------------------------------------------------- New: ---- py2encoding.patch pytest4.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-Whoosh.spec ++++++ --- /var/tmp/diff_new_pack.6B1fiB/_old 2019-07-30 13:00:49.946442925 +0200 +++ /var/tmp/diff_new_pack.6B1fiB/_new 2019-07-30 13:00:49.958442923 +0200 @@ -1,7 +1,7 @@ # # spec file for package python-Whoosh # -# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 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 @@ -17,23 +17,23 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} -%bcond_without test Name: python-Whoosh Version: 2.7.4 Release: 0 Summary: Pure-Python full text indexing, search, and spell checking library License: BSD-2-Clause Group: Development/Languages/Python -URL: http://www.turbogears.org +URL: https://github.com/whoosh-community/whoosh/ Source: https://files.pythonhosted.org/packages/source/W/Whoosh/Whoosh-%{version}.tar.gz -BuildRequires: %{python_module Sphinx} +Patch0: pytest4.patch +Patch1: py2encoding.patch BuildRequires: %{python_module setuptools} +BuildRequires: fdupes BuildRequires: python-rpm-macros +BuildRequires: python3-Sphinx BuildArch: noarch # SECTION the testing dependencies -%if %{with test} BuildRequires: %{python_module pytest} -%endif # /SECTION %ifpython2 Provides: python-whoosh = %{version} @@ -62,6 +62,7 @@ %prep %setup -q -n Whoosh-%{version} +%autopatch -p1 %build %python_build @@ -69,11 +70,12 @@ %install %python_install +%python_expand %fdupes %{buildroot}%{$python_sitelib} -%if %{with test} %check -%python_exec setup.py test -%endif +export LANG=en_US.UTF8 +# test_list_corrector - depends on dict sorting thats in py3+ only +%pytest -k 'not test_list_corrector' %files %{python_files} %license LICENSE.txt ++++++ py2encoding.patch ++++++
From f5a777572fb9c91fa10be3c1ffd5f65cc9323653 Mon Sep 17 00:00:00 2001 From: fortable1999 <fortable1999@gmail.com> Date: Wed, 12 Dec 2018 11:18:50 +0900 Subject: [PATCH] Fixed test case for ListCorrector; Fixed FSA __eq__ function
--- src/whoosh/automata/fsa.py | 7 +------ tests/test_reading.py | 1 + tests/test_spelling.py | 7 ++++++- 5 files changed, 12 insertions(+), 8 deletions(-) create mode 100644 .gitignore diff --git a/src/whoosh/automata/fsa.py b/src/whoosh/automata/fsa.py index 280ddb50..54d23f2f 100644 --- a/src/whoosh/automata/fsa.py +++ b/src/whoosh/automata/fsa.py @@ -44,12 +44,7 @@ def __eq__(self, other): return False st = self.transitions ot = other.transitions - if list(st) != list(ot): - return False - for key in st: - if st[key] != ot[key]: - return False - return True + return st == ot def all_states(self): stateset = set(self.transitions) diff --git a/tests/test_reading.py b/tests/test_reading.py index e2c2b71d..9fefc41c 100644 --- a/tests/test_reading.py +++ b/tests/test_reading.py @@ -1,3 +1,4 @@ +# coding=utf-8 from __future__ import with_statement import random, threading, time diff --git a/tests/test_spelling.py b/tests/test_spelling.py index ce5284f1..440c2d02 100644 --- a/tests/test_spelling.py +++ b/tests/test_spelling.py @@ -20,7 +20,12 @@ def test_list_corrector(): corr = spelling.ListCorrector(_wordlist) typo = "reoction" sugs = list(corr.suggest(typo, maxdist=2)) - target = [w for w in _wordlist if levenshtein(typo, w) <= 2] + target = [] + for lev_dist in range(1, 3): + # sugs will return suggest first ordered by levenshtein distance + # then second order by dictionary order + target += [w for w in _wordlist + if levenshtein(typo, w) <= lev_dist and w not in target] assert sugs == target ++++++ pytest4.patch ++++++ Index: Whoosh-2.7.4/setup.cfg =================================================================== --- Whoosh-2.7.4.orig/setup.cfg +++ Whoosh-2.7.4/setup.cfg @@ -15,7 +15,7 @@ formats = zip,gztar push = sdist bdist_wheel upload pushdocs = build_sphinx upload_sphinx -[pytest] +[tool:pytest] addopts = -rs --tb=native norecursedirs = .hg .tox _build tmp* env* benchmark stress minversion = 2.0
participants (1)
-
root