Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-regex for openSUSE:Factory checked in at 2021-08-04 22:28:21 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-regex (Old) and /work/SRC/openSUSE:Factory/.python-regex.new.1899 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-regex" Wed Aug 4 22:28:21 2021 rev:13 rq:909591 version:2021.7.6 Changes: -------- --- /work/SRC/openSUSE:Factory/python-regex/python-regex.changes 2021-05-12 19:31:25.215237234 +0200 +++ /work/SRC/openSUSE:Factory/.python-regex.new.1899/python-regex.changes 2021-08-04 22:28:32.597827173 +0200 @@ -1,0 +2,7 @@ +Sun Aug 1 09:30:05 UTC 2021 - Dirk M??ller <dmuel...@suse.com> + +- update to 2021.7.6: + * drop-in replacement for python re + * fix fuzzy character restrictions not applying to insertions + +------------------------------------------------------------------- Old: ---- regex-2021.4.4.tar.gz New: ---- regex-2021.7.6.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-regex.spec ++++++ --- /var/tmp/diff_new_pack.TucgdM/_old 2021-08-04 22:28:33.053826609 +0200 +++ /var/tmp/diff_new_pack.TucgdM/_new 2021-08-04 22:28:33.053826609 +0200 @@ -18,7 +18,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-regex -Version: 2021.4.4 +Version: 2021.7.6 Release: 0 Summary: Alternative regular expression module for Python License: Apache-2.0 ++++++ regex-2021.4.4.tar.gz -> regex-2021.7.6.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/regex-2021.4.4/PKG-INFO new/regex-2021.7.6/PKG-INFO --- old/regex-2021.4.4/PKG-INFO 2021-04-04 18:33:40.896448000 +0200 +++ new/regex-2021.7.6/PKG-INFO 2021-07-05 23:55:27.433473300 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: regex -Version: 2021.4.4 +Version: 2021.7.6 Summary: Alternative regular expression module, to replace re. Home-page: https://bitbucket.org/mrabarnett/mrab-regex Author: Matthew Barnett @@ -1084,6 +1084,7 @@ Classifier: Programming Language :: Python :: 3.7 Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 Classifier: Topic :: Scientific/Engineering :: Information Analysis Classifier: Topic :: Software Development :: Libraries :: Python Modules Classifier: Topic :: Text Processing diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/regex-2021.4.4/regex.egg-info/PKG-INFO new/regex-2021.7.6/regex.egg-info/PKG-INFO --- old/regex-2021.4.4/regex.egg-info/PKG-INFO 2021-04-04 18:33:40.000000000 +0200 +++ new/regex-2021.7.6/regex.egg-info/PKG-INFO 2021-07-05 23:55:27.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: regex -Version: 2021.4.4 +Version: 2021.7.6 Summary: Alternative regular expression module, to replace re. Home-page: https://bitbucket.org/mrabarnett/mrab-regex Author: Matthew Barnett @@ -1084,6 +1084,7 @@ Classifier: Programming Language :: Python :: 3.7 Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 Classifier: Topic :: Scientific/Engineering :: Information Analysis Classifier: Topic :: Software Development :: Libraries :: Python Modules Classifier: Topic :: Text Processing diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/regex-2021.4.4/regex_2/_regex.c new/regex-2021.7.6/regex_2/_regex.c --- old/regex-2021.4.4/regex_2/_regex.c 2021-04-04 16:58:22.000000000 +0200 +++ new/regex-2021.7.6/regex_2/_regex.c 2021-07-05 23:45:53.000000000 +0200 @@ -9766,6 +9766,9 @@ Py_ssize_t pos) { RE_Node* test_node; + if (!fuzzy_node) + return TRUE; + test_node = fuzzy_node->nonstring.next_2.node; if (!test_node) return TRUE; @@ -10213,7 +10216,9 @@ limit = step > 0 ? state->slice_end : state->slice_start; if (state->text_pos == limit || !insertion_permitted(state, - state->fuzzy_node, state->fuzzy_counts)) { + state->fuzzy_node, state->fuzzy_counts) || + !fuzzy_ext_match(state, curr_node->nonstring.next_2.node, + state->text_pos)) { while (count > 0) { unrecord_fuzzy(state); --state->fuzzy_counts[RE_FUZZY_INS]; @@ -10239,7 +10244,7 @@ /* bstack: step text_pos count node FUZZY_INSERT */ - if (!record_fuzzy(state, RE_FUZZY_INS, state->text_pos)) + if (!record_fuzzy(state, RE_FUZZY_INS, state->text_pos - step)) return RE_ERROR_MEMORY; ++state->fuzzy_counts[RE_FUZZY_INS]; @@ -23781,8 +23786,13 @@ /* Append the fuzzy sequence. */ add_node(args->end, start_node); add_node(start_node, subargs.start); - if (test_node) + if (test_node) { add_node(start_node, test_node); + /* The END_FUZZY node needs access to the charset, if any, in case of + fuzzy insertion at the end. + */ + end_node->nonstring.next_2.node = start_node; + } add_node(subargs.end, end_node); args->end = end_node; args->all_atomic = FALSE; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/regex-2021.4.4/regex_2/regex.py new/regex-2021.7.6/regex_2/regex.py --- old/regex-2021.4.4/regex_2/regex.py 2021-04-04 17:12:09.000000000 +0200 +++ new/regex-2021.7.6/regex_2/regex.py 2021-07-05 23:37:49.000000000 +0200 @@ -241,7 +241,7 @@ "VERSION1", "X", "VERBOSE", "W", "WORD", "error", "Regex", "__version__", "__doc__"] -__version__ = "2.5.93" +__version__ = "2.5.96" # -------------------------------------------------------------------- # Public interface. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/regex-2021.4.4/regex_2/test_regex.py new/regex-2021.7.6/regex_2/test_regex.py --- old/regex-2021.4.4/regex_2/test_regex.py 2021-04-04 17:01:29.000000000 +0200 +++ new/regex-2021.7.6/regex_2/test_regex.py 2021-07-05 23:46:27.000000000 +0200 @@ -4086,6 +4086,20 @@ self.assertEqual(bool(regex.match(r"(?:(x*)\1\1\1)*x$", "x" * 5)), True) self.assertEqual(bool(regex.match(r"(?:(x*)\1{3})*x$", "x" * 5)), True) + # Git issue 415: Fuzzy character restrictions don't apply to insertions at "right edge" + self.assertEqual(regex.match(r't(?:es){s<=1:\d}t', 'te5t').group(), + 'te5t') + self.assertEqual(regex.match(r't(?:es){s<=1:\d}t', 'tezt'), None) + self.assertEqual(regex.match(r't(?:es){i<=1:\d}t', 'tes5t').group(), + 'tes5t') + self.assertEqual(regex.match(r't(?:es){i<=1:\d}t', 'teszt'), None) + self.assertEqual(regex.match(r't(?:es){i<=1:\d}t', + 'tes5t').fuzzy_changes, ([], [3], [])) + self.assertEqual(regex.match(r't(es){i<=1,0<e<=1}t', 'tes5t').group(), + 'tes5t') + self.assertEqual(regex.match(r't(?:es){i<=1,0<e<=1:\d}t', + 'tes5t').fuzzy_changes, ([], [3], [])) + def test_fuzzy_ext(self): self.assertEqual(bool(regex.fullmatch(r'(?r)(?:a){e<=1:[a-z]}', 'e')), True) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/regex-2021.4.4/regex_3/_regex.c new/regex-2021.7.6/regex_3/_regex.c --- old/regex-2021.4.4/regex_3/_regex.c 2021-04-04 16:57:28.000000000 +0200 +++ new/regex-2021.7.6/regex_3/_regex.c 2021-07-05 23:45:27.000000000 +0200 @@ -9828,6 +9828,9 @@ Py_ssize_t pos) { RE_Node* test_node; + if (!fuzzy_node) + return TRUE; + test_node = fuzzy_node->nonstring.next_2.node; if (!test_node) return TRUE; @@ -10275,7 +10278,9 @@ limit = step > 0 ? state->slice_end : state->slice_start; if (state->text_pos == limit || !insertion_permitted(state, - state->fuzzy_node, state->fuzzy_counts)) { + state->fuzzy_node, state->fuzzy_counts) || + !fuzzy_ext_match(state, curr_node->nonstring.next_2.node, + state->text_pos)) { while (count > 0) { unrecord_fuzzy(state); --state->fuzzy_counts[RE_FUZZY_INS]; @@ -10301,7 +10306,7 @@ /* bstack: step text_pos count node FUZZY_INSERT */ - if (!record_fuzzy(state, RE_FUZZY_INS, state->text_pos)) + if (!record_fuzzy(state, RE_FUZZY_INS, state->text_pos - step)) return RE_ERROR_MEMORY; ++state->fuzzy_counts[RE_FUZZY_INS]; @@ -19756,7 +19761,7 @@ } /* MatchObject's 'regs' attribute. */ -static PyObject* match_regs(MatchObject* self) { +static PyObject* match_regs(MatchObject* self, void* unused) { PyObject* regs; PyObject* item; size_t g; @@ -20041,7 +20046,7 @@ PyDoc_STRVAR(match_doc, "Match object"); /* MatchObject's 'lastindex' attribute. */ -static PyObject* match_lastindex(PyObject* self_) { +static PyObject* match_lastindex(PyObject* self_, void* unused) { MatchObject* self; self = (MatchObject*)self_; @@ -20053,7 +20058,7 @@ } /* MatchObject's 'lastgroup' attribute. */ -static PyObject* match_lastgroup(PyObject* self_) { +static PyObject* match_lastgroup(PyObject* self_, void* unused) { MatchObject* self; self = (MatchObject*)self_; @@ -20080,7 +20085,7 @@ } /* MatchObject's 'string' attribute. */ -static PyObject* match_string(PyObject* self_) { +static PyObject* match_string(PyObject* self_, void* unused) { MatchObject* self; self = (MatchObject*)self_; @@ -20093,7 +20098,7 @@ } /* MatchObject's 'fuzzy_counts' attribute. */ -static PyObject* match_fuzzy_counts(PyObject* self_) { +static PyObject* match_fuzzy_counts(PyObject* self_, void* unused) { MatchObject* self; self = (MatchObject*)self_; @@ -20103,7 +20108,7 @@ } /* MatchObject's 'fuzzy_changes' attribute. */ -static PyObject* match_fuzzy_changes(PyObject* self_) { +static PyObject* match_fuzzy_changes(PyObject* self_, void* unused) { MatchObject* self; PyObject* sub_changes; PyObject* ins_changes; @@ -22259,6 +22264,40 @@ return make_pattern_copy(self); } +/* PatternObject's '__sizeof__' method. */ +static PyObject* pattern_sizeof(PatternObject* self, PyObject* args) { + Py_ssize_t size; + size_t i; + PyObject* result; + + size = sizeof(PatternObject); + size += self->node_count * sizeof(RE_Node); + + for (i = 0; i < self->node_count; i++) { + RE_Node* node; + + node = self->node_list[i]; + size += node->value_count * sizeof(RE_CODE); + } + + size += self->true_group_count * sizeof(RE_GroupInfo); + size += self->repeat_count * sizeof(RE_RepeatInfo); + + result = PyObject_CallMethod(self->packed_code_list, "__sizeof__", NULL); + if (!result) + return NULL; + + size += PyLong_AsSize_t(result); + Py_DECREF(result); + + size += self->call_ref_info_count * sizeof(RE_CallRefInfo); + + if (self->locale_info) + size += sizeof(RE_LocaleInfo); + + return PyLong_FromSsize_t(size); +} + /* The documentation of a PatternObject. */ PyDoc_STRVAR(pattern_match_doc, "match(string, pos=None, endpos=None, concurrent=None, timeout=None) --> MatchObject or None.\n\ @@ -22349,6 +22388,7 @@ pattern_scanner_doc}, {"__copy__", (PyCFunction)pattern_copy, METH_NOARGS}, {"__deepcopy__", (PyCFunction)pattern_deepcopy, METH_O}, + {"__sizeof__", (PyCFunction)pattern_sizeof, METH_NOARGS|METH_COEXIST}, {NULL, NULL} }; @@ -23959,8 +23999,13 @@ /* Append the fuzzy sequence. */ add_node(args->end, start_node); add_node(start_node, subargs.start); - if (test_node) + if (test_node) { add_node(start_node, test_node); + /* The END_FUZZY node needs access to the charset, if any, in case of + fuzzy insertion at the end. + */ + end_node->nonstring.next_2.node = start_node; + } add_node(subargs.end, end_node); args->end = end_node; args->all_atomic = FALSE; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/regex-2021.4.4/regex_3/regex.py new/regex-2021.7.6/regex_3/regex.py --- old/regex-2021.4.4/regex_3/regex.py 2021-04-04 17:12:09.000000000 +0200 +++ new/regex-2021.7.6/regex_3/regex.py 2021-07-05 23:37:49.000000000 +0200 @@ -241,7 +241,7 @@ "VERSION1", "X", "VERBOSE", "W", "WORD", "error", "Regex", "__version__", "__doc__"] -__version__ = "2.5.93" +__version__ = "2.5.96" # -------------------------------------------------------------------- # Public interface. @@ -723,6 +723,10 @@ Match = type(_pat.match('')) del _pat +# Make Pattern public for typing annotations. +__all__.append("Pattern") +__all__.append("Match") + # We'll define an alias for the 'compile' function so that the repr of a # pattern object is eval-able. Regex = compile diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/regex-2021.4.4/regex_3/test_regex.py new/regex-2021.7.6/regex_3/test_regex.py --- old/regex-2021.4.4/regex_3/test_regex.py 2021-04-04 17:00:51.000000000 +0200 +++ new/regex-2021.7.6/regex_3/test_regex.py 2021-07-05 23:41:57.000000000 +0200 @@ -4255,6 +4255,20 @@ self.assertEqual(bool(regex.match(r"(?:(x*)\1\1\1)*x$", "x" * 5)), True) self.assertEqual(bool(regex.match(r"(?:(x*)\1{3})*x$", "x" * 5)), True) + # Git issue 415: Fuzzy character restrictions don't apply to insertions at "right edge" + self.assertEqual(regex.match(r't(?:es){s<=1:\d}t', 'te5t').group(), + 'te5t') + self.assertEqual(regex.match(r't(?:es){s<=1:\d}t', 'tezt'), None) + self.assertEqual(regex.match(r't(?:es){i<=1:\d}t', 'tes5t').group(), + 'tes5t') + self.assertEqual(regex.match(r't(?:es){i<=1:\d}t', 'teszt'), None) + self.assertEqual(regex.match(r't(?:es){i<=1:\d}t', + 'tes5t').fuzzy_changes, ([], [3], [])) + self.assertEqual(regex.match(r't(es){i<=1,0<e<=1}t', 'tes5t').group(), + 'tes5t') + self.assertEqual(regex.match(r't(?:es){i<=1,0<e<=1:\d}t', + 'tes5t').fuzzy_changes, ([], [3], [])) + def test_fuzzy_ext(self): self.assertEqual(bool(regex.fullmatch(r'(?r)(?:a){e<=1:[a-z]}', 'e')), True) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/regex-2021.4.4/setup.py new/regex-2021.7.6/setup.py --- old/regex-2021.4.4/setup.py 2021-04-04 18:33:40.000000000 +0200 +++ new/regex-2021.7.6/setup.py 2021-07-05 23:55:26.000000000 +0200 @@ -12,7 +12,7 @@ setup( name='regex', - version='2021.4.4', + version='2021.7.6', description='Alternative regular expression module, to replace re.', long_description=long_description, author='Matthew Barnett', @@ -29,6 +29,7 @@ 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', 'Topic :: Scientific/Engineering :: Information Analysis', 'Topic :: Software Development :: Libraries :: Python Modules', 'Topic :: Text Processing',