Hello community, here is the log from the commit of package python-boolean.py for openSUSE:Factory checked in at 2020-01-24 13:12:20 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-boolean.py (Old) and /work/SRC/openSUSE:Factory/.python-boolean.py.new.26092 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-boolean.py" Fri Jan 24 13:12:20 2020 rev:3 rq:766681 version:3.7 Changes: -------- --- /work/SRC/openSUSE:Factory/python-boolean.py/python-boolean.py.changes 2019-09-11 10:33:45.671324662 +0200 +++ /work/SRC/openSUSE:Factory/.python-boolean.py.new.26092/python-boolean.py.changes 2020-01-24 13:13:14.841483291 +0100 @@ -1,0 +2,9 @@ +Thu Jan 23 17:34:52 UTC 2020 - Marketa Calabkova <[email protected]> + +- update to 3.7 + * Add new sort argument to simplify() to optionally not sort when + simplifying expressions (e.g. not applying "commutativity"). + * Add new argument to tokenizer to optionally accept extra + characters in symbol tokens. + +------------------------------------------------------------------- Old: ---- python-boolean.py-3.6.tar.gz New: ---- python-boolean.py-3.7.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-boolean.py.spec ++++++ --- /var/tmp/diff_new_pack.rBBOrK/_old 2020-01-24 13:13:16.057483779 +0100 +++ /var/tmp/diff_new_pack.rBBOrK/_new 2020-01-24 13:13:16.057483779 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-boolean.py # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,7 +18,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-boolean.py -Version: 3.6 +Version: 3.7 Release: 0 Summary: Module to define boolean algebras and create/parse boolean expressions License: BSD-2-Clause @@ -31,7 +31,6 @@ BuildRequires: fdupes BuildRequires: python-rpm-macros BuildArch: noarch - %python_subpackages %description ++++++ python-boolean.py-3.6.tar.gz -> python-boolean.py-3.7.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/boolean.py-3.6/.python-version new/boolean.py-3.7/.python-version --- old/boolean.py-3.6/.python-version 1970-01-01 01:00:00.000000000 +0100 +++ new/boolean.py-3.7/.python-version 2019-10-14 15:53:09.000000000 +0200 @@ -0,0 +1 @@ +3.6.5 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/boolean.py-3.6/CHANGELOG.rst new/boolean.py-3.7/CHANGELOG.rst --- old/boolean.py-3.6/CHANGELOG.rst 2018-08-06 09:40:35.000000000 +0200 +++ new/boolean.py-3.7/CHANGELOG.rst 2019-10-14 15:53:09.000000000 +0200 @@ -4,12 +4,59 @@ next ------------------- +---- + + +3.7 (2019-10-04) +---------------- + +* API changes + + * Add new sort argument to simplify() to optionally not sort when simplifying + expressions (e.g. not applying "commutativity"). Thank you to Steven Esser + @majurg for this + * Add new argument to tokenizer to optionally accept extra characters in symbol + tokens. Thank you to @carpie for this + + +3.6 (2018-08-06) +---------------- + +* No API changes + +* Bug fixes + + * Fix De Morgan's laws effect on double negation propositions. Thank you to Douglas Cardoso for this + * Improve error checking when parsing + +3.5 (Nov 1, 2017) +----------------- -3.3.0 (2017-02-09) +* No API changes + +* Bug fixes + + * Documentation updates and add testing for Python 3.6. Thank you to Alexander Lisianoi @alisianoi + * Improve testng and expression equivalence checks + * Improve subs() method to an expression + + + +3.4 (May 12, 2017) ------------------ +* No API changes + +* Bug fixes and improvements + + * Fix various documentation typos and improve tests . Thank you to Alexander Lisianoi @alisianoi + * Fix handling for literals vs. symbols in negations Thank you to @YaronK + + +3.3 (2017-02-09) +---------------- + * API changes * #40 and #50 Expression.subs() now takes 'default' thanks to @kronuz @@ -27,8 +74,8 @@ ------------------ * API changes - * New algebra definition. Refactored class hierarchy. Improved parsing. + * New algebra definition. Refactored class hierarchy. Improved parsing. * New features diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/boolean.py-3.6/boolean/boolean.py new/boolean.py-3.7/boolean/boolean.py --- old/boolean.py-3.6/boolean/boolean.py 2018-08-06 09:40:35.000000000 +0200 +++ new/boolean.py-3.7/boolean/boolean.py 2019-10-14 15:53:09.000000000 +0200 @@ -114,7 +114,8 @@ """ def __init__(self, TRUE_class=None, FALSE_class=None, Symbol_class=None, - NOT_class=None, AND_class=None, OR_class=None): + NOT_class=None, AND_class=None, OR_class=None, + allowed_in_token=('.', ':', '_')): """ The types for TRUE, FALSE, NOT, AND, OR and Symbol define the boolean algebra elements, operations and Symbol variable. They default to the @@ -158,6 +159,9 @@ for name, value in tf_nao.items(): setattr(obj, name, value) + # Set the set of characters allowed in tokens + self.allowed_in_token = allowed_in_token + def definition(self): """ Return a tuple of this algebra defined elements and types as: @@ -461,7 +465,7 @@ position += 1 while position < length: char = expr[position] - if char.isalnum() or char in ('.', ':', '_'): + if char.isalnum() or char in self.allowed_in_token: position += 1 tok += char else: @@ -1135,7 +1139,7 @@ if isinstance(expr, self.__class__): return all(arg in self.args for arg in expr.args) - def simplify(self): + def simplify(self, sort=True): """ Return a new simplified expression in canonical form from this expression. @@ -1254,7 +1258,8 @@ return args[0] # Commutativity: A & B = B & A, A | B = B | A - args.sort() + if sort: + args.sort() # Create new (now canonical) expression. expr = self.__class__(*args) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/boolean.py-3.6/boolean/test_boolean.py new/boolean.py-3.7/boolean/test_boolean.py --- old/boolean.py-3.6/boolean/test_boolean.py 2018-08-06 09:40:35.000000000 +0200 +++ new/boolean.py-3.7/boolean/test_boolean.py 2019-10-14 15:53:09.000000000 +0200 @@ -273,6 +273,17 @@ ) self.assertEqual(expected, expr) + def test_allowing_additional_characters_in_tokens(self): + algebra = BooleanAlgebra(allowed_in_token=('.', '_', '-', '+')) + test_expr = 'l-a AND b+c' + + expr = algebra.parse(test_expr) + expected = algebra.AND( + algebra.Symbol('l-a'), + algebra.Symbol('b+c') + ) + self.assertEqual(expected, expr) + def test_parse_raise_ParseError1(self): algebra = BooleanAlgebra() expr = 'l-a AND none' @@ -705,6 +716,17 @@ # Elimination self.assertEqual(a, ((a & ~b) | (a & b)).simplify()) + # Commutativity + Non-Commutativity + sorted_expression = (b & b & a).simplify() + unsorted_expression = (b & b & a).simplify(sort=False) + self.assertEqual(sorted_expression, unsorted_expression) + self.assertNotEqual(sorted_expression.pretty(), unsorted_expression.pretty()) + + sorted_expression = (b | b | a).simplify() + unsorted_expression = (b | b | a).simplify(sort=False) + self.assertEqual(sorted_expression, unsorted_expression) + self.assertNotEqual(sorted_expression.pretty(), unsorted_expression.pretty()) + expected = algebra1.parse('(a&b)|(b&c)|(a&c)') result = algebra1.parse('(~a&b&c) | (a&~b&c) | (a&b&~c) | (a&b&c)', simplify=True) self.assertEqual(expected, result) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/boolean.py-3.6/setup.py new/boolean.py-3.7/setup.py --- old/boolean.py-3.6/setup.py 2018-08-06 09:40:35.000000000 +0200 +++ new/boolean.py-3.7/setup.py 2019-10-14 15:53:09.000000000 +0200 @@ -21,14 +21,14 @@ Copyright (c) 2009-2017 Sebastian Kraemer, [email protected] and others -Released under revised BSD license. +Released under revised BSD license aka. BSD Simplified or BSD-2-Clause. ''' setup( name='boolean.py', - version='3.6', - license='revised BSD license', + version='3.7', + license='BSD-2-Clause', description='Define boolean algebras, create and parse boolean expressions and create custom boolean DSL.', long_description=long_desc, author='Sebastian Kraemer', @@ -41,9 +41,8 @@ test_suite='boolean.test_boolean', keywords='boolean expression, boolean algebra, logic, expression parser', classifiers=[ - 'Development Status :: 4 - Beta', + 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', - 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2.7',
