Hello community, here is the log from the commit of package python3-astroid for openSUSE:Factory checked in at 2016-04-22 16:23:30 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python3-astroid (Old) and /work/SRC/openSUSE:Factory/.python3-astroid.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python3-astroid" Changes: -------- --- /work/SRC/openSUSE:Factory/python3-astroid/python3-astroid.changes 2016-02-01 19:57:37.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.python3-astroid.new/python3-astroid.changes 2016-04-22 16:23:31.000000000 +0200 @@ -1,0 +2,16 @@ +Sat Mar 26 04:30:01 UTC 2016 - a...@gmx.de + +- update to version 1.4.5: + * decoratornames() does not leak InferenceError anymore. + * wildcard_imported_names() got replaced by _public_names() + Our understanding of wildcard imports through __all__ was + half baked to say at least, since we couldn't account for + modifications of the list, which results in tons of false positives. + Instead, we replaced it with _public_names(), a method which returns + all the names that are publicly available in a module, that is that + don't start with an underscore, even though this means that there + is a possibility for other names to be leaked out even though + they are not present in the __all__ variable. + The method is private in 1.4.X. + +------------------------------------------------------------------- Old: ---- astroid-1.4.4.tar.gz New: ---- astroid-1.4.5.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python3-astroid.spec ++++++ --- /var/tmp/diff_new_pack.pKZOHR/_old 2016-04-22 16:23:32.000000000 +0200 +++ /var/tmp/diff_new_pack.pKZOHR/_new 2016-04-22 16:23:32.000000000 +0200 @@ -17,7 +17,7 @@ Name: python3-astroid -Version: 1.4.4 +Version: 1.4.5 Release: 0 Url: https://github.com/pycqa/astroid Summary: Rebuild a new abstract syntax tree from Python's ast ++++++ astroid-1.4.4.tar.gz -> astroid-1.4.5.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/astroid-1.4.4/ChangeLog new/astroid-1.4.5/ChangeLog --- old/astroid-1.4.4/ChangeLog 2016-01-15 18:00:46.000000000 +0100 +++ new/astroid-1.4.5/ChangeLog 2016-03-21 19:18:08.000000000 +0100 @@ -1,6 +1,24 @@ Change log for the astroid package (used to be astng) ===================================================== +2016-03-21 -- 1.4.5 + + * decoratornames() does not leak InferenceError anymore. + + * wildcard_imported_names() got replaced by _public_names() + + Our understanding of wildcard imports through __all__ was + half baked to say at least, since we couldn't account for + modifications of the list, which results in tons of false positives. + Instead, we replaced it with _public_names(), a method which returns + all the names that are publicly available in a module, that is that + don't start with an underscore, even though this means that there + is a possibility for other names to be leaked out even though + they are not present in the __all__ variable. + + The method is private in 1.4.X. + + 2016-01-15 -- 1.4.4 * unpack_infer raises InferenceError if it can't operate diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/astroid-1.4.4/PKG-INFO new/astroid-1.4.5/PKG-INFO --- old/astroid-1.4.4/PKG-INFO 2016-01-15 18:12:28.000000000 +0100 +++ new/astroid-1.4.5/PKG-INFO 2016-03-21 19:31:24.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: astroid -Version: 1.4.4 +Version: 1.4.5 Summary: A abstract syntax tree for Python with inference support. Home-page: http://bitbucket.org/logilab/astroid Author: Logilab diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/astroid-1.4.4/astroid/__pkginfo__.py new/astroid-1.4.5/astroid/__pkginfo__.py --- old/astroid-1.4.4/astroid/__pkginfo__.py 2016-01-15 18:00:51.000000000 +0100 +++ new/astroid-1.4.5/astroid/__pkginfo__.py 2016-03-21 19:17:54.000000000 +0100 @@ -20,7 +20,7 @@ modname = 'astroid' -numversion = (1, 4, 4) +numversion = (1, 4, 5) version = '.'.join([str(num) for num in numversion]) install_requires = ['six', 'lazy_object_proxy', 'wrapt'] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/astroid-1.4.4/astroid/builder.py new/astroid-1.4.5/astroid/builder.py --- old/astroid-1.4.4/astroid/builder.py 2016-01-15 18:00:20.000000000 +0100 +++ new/astroid-1.4.5/astroid/builder.py 2016-03-21 19:05:16.000000000 +0100 @@ -202,7 +202,7 @@ imported = node.do_import_module() except exceptions.InferenceError: continue - for name in imported.wildcard_import_names(): + for name in imported._public_names(): node.parent.set_local(name, node) sort_locals(node.parent.scope()._locals[name]) else: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/astroid-1.4.4/astroid/inference.py new/astroid-1.4.5/astroid/inference.py --- old/astroid-1.4.4/astroid/inference.py 2016-01-15 18:00:20.000000000 +0100 +++ new/astroid-1.4.5/astroid/inference.py 2016-03-21 19:05:16.000000000 +0100 @@ -247,12 +247,12 @@ yield util.YES nodes.UnaryOp._infer = bases.path_wrapper(infer_unaryop) -def _infer_binop(operator, operand1, operand2, context, failures=None): +def _infer_binop(binop, operand1, operand2, context, failures=None): if operand1 is util.YES: yield operand1 return try: - for valnode in operand1.infer_binary_op(operator, operand2, context): + for valnode in operand1.infer_binary_op(binop, operand2, context): yield valnode except AttributeError: try: @@ -270,11 +270,11 @@ def infer_binop(self, context=None): failures = [] for lhs in self.left.infer(context): - for val in _infer_binop(self.op, lhs, self.right, context, failures): + for val in _infer_binop(self, lhs, self.right, context, failures): yield val for lhs in failures: for rhs in self.right.infer(context): - for val in _infer_binop(self.op, rhs, lhs, context): + for val in _infer_binop(self, rhs, lhs, context): yield val nodes.BinOp._infer = bases.path_wrapper(infer_binop) @@ -304,11 +304,11 @@ def infer_augassign(self, context=None): failures = [] for lhs in self.target.infer_lhs(context): - for val in _infer_binop(self.op, lhs, self.value, context, failures): + for val in _infer_binop(self, lhs, self.value, context, failures): yield val for lhs in failures: for rhs in self.value.infer(context): - for val in _infer_binop(self.op, rhs, lhs, context): + for val in _infer_binop(self, rhs, lhs, context): yield val nodes.AugAssign._infer = bases.path_wrapper(infer_augassign) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/astroid-1.4.4/astroid/protocols.py new/astroid-1.4.5/astroid/protocols.py --- old/astroid-1.4.4/astroid/protocols.py 2016-01-15 18:00:20.000000000 +0100 +++ new/astroid-1.4.5/astroid/protocols.py 2016-03-21 19:05:16.000000000 +0100 @@ -103,7 +103,8 @@ for key, impl in list(BIN_OP_IMPL.items()): BIN_OP_IMPL[key+'='] = impl -def const_infer_binary_op(self, operator, other, context): +def const_infer_binary_op(self, binop, other, context): + operator = binop.op for other in other.infer(context): if isinstance(other, nodes.Const): try: @@ -122,7 +123,7 @@ yield other else: try: - for val in other.infer_binary_op(operator, self, context): + for val in other.infer_binary_op(binop, self, context): yield val except AttributeError: yield util.YES @@ -130,8 +131,9 @@ -def _multiply_seq_by_int(self, other, context): +def _multiply_seq_by_int(self, binop, other, context): node = self.__class__() + node.parent = binop elts = [] for elt in self.elts: infered = util.safe_infer(elt, context) @@ -151,10 +153,12 @@ yield inferred -def tl_infer_binary_op(self, operator, other, context): +def tl_infer_binary_op(self, binop, other, context): + operator = binop.op for other in other.infer(context): if isinstance(other, self.__class__) and operator == '+': node = self.__class__() + node.parent = binop elts = list(_filter_uninferable_nodes(self.elts, context)) elts += list(_filter_uninferable_nodes(other.elts, context)) node.elts = elts @@ -163,7 +167,7 @@ if not isinstance(other.value, int): yield util.YES continue - yield _multiply_seq_by_int(self, other, context) + yield _multiply_seq_by_int(self, binop, other, context) elif isinstance(other, bases.Instance) and not isinstance(other, nodes.Const): yield util.YES # XXX else log TypeError @@ -171,14 +175,15 @@ nodes.List.infer_binary_op = bases.yes_if_nothing_inferred(tl_infer_binary_op) -def dict_infer_binary_op(self, operator, other, context): +def dict_infer_binary_op(self, binop, other, context): for other in other.infer(context): if isinstance(other, bases.Instance) and isinstance(other._proxied, nodes.ClassDef): yield util.YES # XXX else log TypeError nodes.Dict.infer_binary_op = bases.yes_if_nothing_inferred(dict_infer_binary_op) -def instance_infer_binary_op(self, operator, other, context): +def instance_infer_binary_op(self, binop, other, context): + operator = binop.op try: methods = self.getattr(BIN_OP_METHOD[operator]) except (exceptions.NotFoundError, KeyError): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/astroid-1.4.4/astroid/scoped_nodes.py new/astroid-1.4.5/astroid/scoped_nodes.py --- old/astroid-1.4.4/astroid/scoped_nodes.py 2016-01-15 18:00:20.000000000 +0100 +++ new/astroid-1.4.5/astroid/scoped_nodes.py 2016-03-21 19:05:16.000000000 +0100 @@ -568,6 +568,10 @@ inferred.append(inferred_node.value) return inferred + def _public_names(self): + """Get the list of the names which are publicly available in this module.""" + return [name for name in self.keys() if not name.startswith('_')] + def bool_value(self): return True @@ -887,8 +891,11 @@ decoratornodes += self.decorators.nodes decoratornodes += self.extra_decorators for decnode in decoratornodes: - for infnode in decnode.infer(): - result.add(infnode.qname()) + try: + for infnode in decnode.infer(): + result.add(infnode.qname()) + except exceptions.InferenceError: + continue return result def is_bound(self): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/astroid-1.4.4/astroid/tests/unittest_regrtest.py new/astroid-1.4.5/astroid/tests/unittest_regrtest.py --- old/astroid-1.4.4/astroid/tests/unittest_regrtest.py 2016-01-15 18:00:20.000000000 +0100 +++ new/astroid-1.4.5/astroid/tests/unittest_regrtest.py 2016-03-21 19:23:36.000000000 +0100 @@ -149,7 +149,7 @@ astroid = builder.string_build(data, __name__, __file__) callfunc = astroid.body[1].value.func inferred = callfunc.inferred() - self.assertEqual(len(inferred), 1) + self.assertEqual(len(inferred), 2) @require_version('3.0') def test_nameconstant(self): @@ -299,6 +299,35 @@ next(node.value.infer()).as_string() + def test_binop_generates_nodes_with_parents(self): + node = extract_node(''' + def no_op(*args): + pass + def foo(*args): + def inner(*more_args): + args + more_args #@ + return inner + ''') + inferred = next(node.infer()) + self.assertIsInstance(inferred, nodes.Tuple) + self.assertIsNotNone(inferred.parent) + self.assertIsInstance(inferred.parent, nodes.BinOp) + + def test_decorator_names_inference_error_leaking(self): + node = extract_node(''' + class Parent(object): + @property + def foo(self): + pass + + class Child(Parent): + @Parent.foo.getter + def foo(self): #@ + return super(Child, self).foo + ['oink'] + ''') + inferred = next(node.infer()) + self.assertEqual(inferred.decoratornames(), set()) + class Whatever(object): a = property(lambda x: x, lambda x: x) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/astroid-1.4.4/astroid/tests/unittest_scoped_nodes.py new/astroid-1.4.5/astroid/tests/unittest_scoped_nodes.py --- old/astroid-1.4.4/astroid/tests/unittest_scoped_nodes.py 2016-01-15 18:00:20.000000000 +0100 +++ new/astroid-1.4.5/astroid/tests/unittest_scoped_nodes.py 2016-03-21 19:05:16.000000000 +0100 @@ -111,19 +111,41 @@ res = sorted(m.wildcard_import_names()) self.assertEqual(res, ['Aaa', 'func', 'name', 'other']) + def test_public_names(self): + m = builder.parse(''' + name = 'a' + _bla = 2 + other = 'o' + class Aaa: pass + def func(): print('yo') + __all__ = 'Aaa', '_bla', 'name' + ''') + values = sorted(['Aaa', 'name', 'other', 'func']) + self.assertEqual(sorted(m._public_names()), values) + m = builder.parse(''' + name = 'a' + _bla = 2 + other = 'o' + class Aaa: pass + + def func(): return 'yo' + ''') + res = sorted(m._public_names()) + self.assertEqual(res, values) + m = builder.parse(''' from missing import tzop trop = "test" __all__ = (trop, "test1", tzop, 42) ''') - res = sorted(m.wildcard_import_names()) - self.assertEqual(res, ["test", "test1"]) + res = sorted(m._public_names()) + self.assertEqual(res, ["trop", "tzop"]) m = builder.parse(''' test = tzop = 42 __all__ = ('test', ) + ('tzop', ) ''') - res = sorted(m.wildcard_import_names()) + res = sorted(m._public_names()) self.assertEqual(res, ['test', 'tzop']) def test_module_getattr(self): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/astroid-1.4.4/astroid.egg-info/PKG-INFO new/astroid-1.4.5/astroid.egg-info/PKG-INFO --- old/astroid-1.4.4/astroid.egg-info/PKG-INFO 2016-01-15 18:12:05.000000000 +0100 +++ new/astroid-1.4.5/astroid.egg-info/PKG-INFO 2016-03-21 19:31:02.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: astroid -Version: 1.4.4 +Version: 1.4.5 Summary: A abstract syntax tree for Python with inference support. Home-page: http://bitbucket.org/logilab/astroid Author: Logilab diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/astroid-1.4.4/setup.cfg new/astroid-1.4.5/setup.cfg --- old/astroid-1.4.4/setup.cfg 2016-01-15 18:12:28.000000000 +0100 +++ new/astroid-1.4.5/setup.cfg 2016-03-21 19:31:24.000000000 +0100 @@ -2,7 +2,7 @@ universal = 1 [egg_info] -tag_build = -tag_svn_revision = 0 tag_date = 0 +tag_svn_revision = 0 +tag_build =