Hello community, here is the log from the commit of package python-scspell3k for openSUSE:Factory checked in at 2019-02-25 17:53:16 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-scspell3k (Old) and /work/SRC/openSUSE:Factory/.python-scspell3k.new.28833 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-scspell3k" Mon Feb 25 17:53:16 2019 rev:3 rq:678032 version:2.2 Changes: -------- --- /work/SRC/openSUSE:Factory/python-scspell3k/python-scspell3k.changes 2018-12-24 11:43:43.829327731 +0100 +++ /work/SRC/openSUSE:Factory/.python-scspell3k.new.28833/python-scspell3k.changes 2019-02-25 17:53:17.482531768 +0100 @@ -1,0 +2,11 @@ +Thu Feb 14 07:54:23 UTC 2019 - John Vandenberg <jay...@gmail.com> + +- Activate tests +- Update to v2.2 + * Add support for Python 3.6, and removed 3.2 and 3.3 + * Fix bugs with Windows and macOS + * Add missing Python keywords and builtins + * add Report class to optionally collect and classify unmatched subtokens + * add optional argument to specify additional extensions + +------------------------------------------------------------------- Old: ---- scspell3k-2.1.tar.gz New: ---- scspell3k-2.2.tar.gz v2.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-scspell3k.spec ++++++ --- /var/tmp/diff_new_pack.ReTz5d/_old 2019-02-25 17:53:18.198531437 +0100 +++ /var/tmp/diff_new_pack.ReTz5d/_new 2019-02-25 17:53:18.202531435 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-scspell3k # -# 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 @@ -18,18 +18,20 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-scspell3k -Version: 2.1 +Version: 2.2 Release: 0 Summary: A conservative interactive spell checker for source code License: GPL-2.0-only Group: Development/Languages/Python -Url: https://github.com/myint/scspell +URL: https://github.com/myint/scspell Source: https://files.pythonhosted.org/packages/source/s/scspell3k/scspell3k-%{version}.tar.gz +Source1: https://github.com/myint/scspell/archive/v%{version}.tar.gz +BuildRequires: %{python_module pytest} BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros +BuildRequires: python3-cram BuildArch: noarch - %python_subpackages %description @@ -70,6 +72,7 @@ %prep %setup -q -n scspell3k-%{version} +tar --wildcards --strip-components=1 -xzf %{SOURCE1} scspell-%{version}/test* %build %python_build @@ -78,6 +81,10 @@ %python_install %python_expand %fdupes %{buildroot}%{$python_sitelib} +%check +%python_exec -m pytest +python3 -m cram --indent=4 ./test.cram + %files %{python_files} %doc README.rst %license COPYING.txt ++++++ scspell3k-2.1.tar.gz -> scspell3k-2.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/scspell3k-2.1/PKG-INFO new/scspell3k-2.2/PKG-INFO --- old/scspell3k-2.1/PKG-INFO 2017-01-14 17:48:08.000000000 +0100 +++ new/scspell3k-2.2/PKG-INFO 2019-01-19 02:32:09.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: scspell3k -Version: 2.1 +Version: 2.2 Summary: A conservative interactive spell checker for source code. Home-page: https://github.com/myint/scspell Author: UNKNOWN diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/scspell3k-2.1/scspell/__init__.py new/scspell3k-2.2/scspell/__init__.py --- old/scspell3k-2.1/scspell/__init__.py 2017-01-14 17:47:01.000000000 +0100 +++ new/scspell3k-2.2/scspell/__init__.py 2019-01-19 02:31:48.000000000 +0100 @@ -56,7 +56,7 @@ raw_input = input -__version__ = '2.1' +__version__ = '2.2' # Name of scspell.conf section header CONFIG_SECTION = 'Settings' @@ -461,6 +461,42 @@ match_desc.get_ofs() + len(match_desc.get_token())) +class Report(object): + """Collect unmatched subtokens and classify into known and unknown words. + + An instance of this class can be passed to ``spell_check()`` as the + ``report_only`` argument. + """ + + def __init__(self, known_words): + """ + Constructor. + + :param known_words: known words + :type known_words: iterable + """ + self.known_words = known_words + self.found_known_words = set() + self.unknown_words = set() + + def __call__(self, match_desc, filename, unmatched_subtokens): + for subtoken in list(unmatched_subtokens): + if subtoken in self.known_words: + self.found_known_words.add(subtoken) + unmatched_subtokens.remove(subtoken) + continue + self.unknown_words |= set(unmatched_subtokens) + + if unmatched_subtokens: + # call function to report unmatched subtokens + return report_failed_check( + match_desc, filename, unmatched_subtokens) + # otherwise just make the caller of the function happy + return ( + match_desc.get_string(), + match_desc.get_ofs() + len(match_desc.get_token())) + + def spell_check_token( match_desc, filename, fq_filename, file_id_ref, dicts, ignores, report_only): @@ -490,8 +526,10 @@ if unmatched_subtokens: unmatched_subtokens = make_unique(unmatched_subtokens) if report_only: - return (report_failed_check(match_desc, filename, - unmatched_subtokens), + function = getattr( + report_only, '__call__', report_failed_check) + return (function(match_desc, filename, + unmatched_subtokens), True) else: return ( @@ -673,7 +711,8 @@ def spell_check(source_filenames, override_dictionary=None, base_dicts=[], relative_to=None, report_only=False, c_escapes=True, - test_input=False): + test_input=False, + additional_extensions=None): """Run the interactive spell checker on the set of source_filenames. If override_dictionary is provided, it shall be used as a dictionary @@ -689,6 +728,8 @@ okay = True with CorporaFile(dict_file, base_dicts, relative_to) as dicts: + for extension in (additional_extensions or []): + dicts.register_extension(*extension) ignores = set() for f in source_filenames: if not spell_check_file(f, dicts, ignores, report_only, c_escapes): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/scspell3k-2.1/scspell/_corpus.py new/scspell3k-2.2/scspell/_corpus.py --- old/scspell3k-2.1/scspell/_corpus.py 2017-01-08 17:35:04.000000000 +0100 +++ new/scspell3k-2.2/scspell/_corpus.py 2017-04-15 19:12:21.000000000 +0200 @@ -474,7 +474,7 @@ def file_id_of_rel_file(self, rel_filename): try: return self._reverse_file_id_mapping[rel_filename] - except: + except KeyError: return None def file_id_of_file(self, fq_filename): @@ -536,7 +536,7 @@ rel_filename = self._fn_to_rel(filename) try: id = self._reverse_file_id_mapping[rel_filename] - except: + except KeyError: if filename == rel_filename: report_str = filename else: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/scspell3k-2.1/scspell/_portable.py new/scspell3k-2.2/scspell/_portable.py --- old/scspell3k-2.1/scspell/_portable.py 2016-09-04 00:38:36.000000000 +0200 +++ new/scspell3k-2.2/scspell/_portable.py 2018-11-09 15:12:44.000000000 +0100 @@ -37,7 +37,7 @@ import msvcrt def msvcrt_getch(): - return msvcrt.getch() + return msvcrt.getwch() getch = msvcrt_getch except ImportError: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/scspell3k-2.1/scspell/data/dictionary.txt new/scspell3k-2.2/scspell/data/dictionary.txt --- old/scspell3k-2.1/scspell/data/dictionary.txt 2016-05-15 04:38:33.000000000 +0200 +++ new/scspell3k-2.2/scspell/data/dictionary.txt 2018-11-09 15:18:43.000000000 +0100 @@ -279,6 +279,8 @@ altseps argv bdist +bytearray +classmethod cmdclass codecs commonprefix @@ -287,12 +289,15 @@ curdir dedent defpath +delattr delitem devnull dirnames dirpath distutils +divmod dotall +dreload eexist endswith enoent @@ -313,6 +318,7 @@ extsep fileno followlinks +frozenset getatime getattr getctime @@ -327,6 +333,7 @@ getvalue getwriter hasattr +ipython isabs isdir isfile @@ -335,14 +342,17 @@ islink ismount isnan +issubclass iteritems kwarg kwargs lexists linesep listdir +memoryview metavar mkdir +nonlocal nowait onerror opendir diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/scspell3k-2.1/scspell3k.egg-info/PKG-INFO new/scspell3k-2.2/scspell3k.egg-info/PKG-INFO --- old/scspell3k-2.1/scspell3k.egg-info/PKG-INFO 2017-01-14 17:48:08.000000000 +0100 +++ new/scspell3k-2.2/scspell3k.egg-info/PKG-INFO 2019-01-19 02:32:09.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: scspell3k -Version: 2.1 +Version: 2.2 Summary: A conservative interactive spell checker for source code. Home-page: https://github.com/myint/scspell Author: UNKNOWN