Hello community, here is the log from the commit of package python-pyflakes for openSUSE:Factory checked in at 2013-07-04 10:16:15 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-pyflakes (Old) and /work/SRC/openSUSE:Factory/.python-pyflakes.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pyflakes" Changes: -------- --- /work/SRC/openSUSE:Factory/python-pyflakes/python-pyflakes.changes 2013-05-16 11:27:08.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.python-pyflakes.new/python-pyflakes.changes 2013-07-04 10:16:16.000000000 +0200 @@ -1,0 +2,10 @@ +Wed Jul 3 15:55:32 UTC 2013 - [email protected] + +- update to 0.7.3: + - Do not report undefined name for generator expression and dict or + set comprehension at class level. + - Deprecate `Checker.pushFunctionScope` and `Checker.pushClassScope`: + use `Checker.pushScope` instead. + - Remove dependency on Unittest2 for the tests. + +------------------------------------------------------------------- Old: ---- pyflakes-0.7.2.tar.gz New: ---- pyflakes-0.7.3.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-pyflakes.spec ++++++ --- /var/tmp/diff_new_pack.VwUaZf/_old 2013-07-04 10:16:17.000000000 +0200 +++ /var/tmp/diff_new_pack.VwUaZf/_new 2013-07-04 10:16:17.000000000 +0200 @@ -20,7 +20,7 @@ %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} Name: python-pyflakes -Version: 0.7.2 +Version: 0.7.3 Release: 0 Url: https://launchpad.net/pyflakes Summary: Passive checker of Python programs ++++++ pyflakes-0.7.2.tar.gz -> pyflakes-0.7.3.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyflakes-0.7.2/NEWS.txt new/pyflakes-0.7.3/NEWS.txt --- old/pyflakes-0.7.2/NEWS.txt 2013-04-24 14:26:46.000000000 +0200 +++ new/pyflakes-0.7.3/NEWS.txt 2013-07-02 17:48:09.000000000 +0200 @@ -1,3 +1,10 @@ +0.7.3 (2013-07-02): + - Do not report undefined name for generator expression and dict or + set comprehension at class level. + - Deprecate `Checker.pushFunctionScope` and `Checker.pushClassScope`: + use `Checker.pushScope` instead. + - Remove dependency on Unittest2 for the tests. + 0.7.2 (2013-04-24): - Fix computation of `DoctestSyntaxError.lineno` and `col`. - Add boolean attribute `Checker.withDoctest` to ignore doctests. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyflakes-0.7.2/PKG-INFO new/pyflakes-0.7.3/PKG-INFO --- old/pyflakes-0.7.2/PKG-INFO 2013-04-24 14:40:49.000000000 +0200 +++ new/pyflakes-0.7.3/PKG-INFO 2013-07-02 18:04:27.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: pyflakes -Version: 0.7.2 +Version: 0.7.3 Summary: passive checker of Python programs Home-page: https://launchpad.net/pyflakes Author: Florent Xicluna diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyflakes-0.7.2/pyflakes/__init__.py new/pyflakes-0.7.3/pyflakes/__init__.py --- old/pyflakes-0.7.2/pyflakes/__init__.py 2013-04-24 14:27:12.000000000 +0200 +++ new/pyflakes-0.7.3/pyflakes/__init__.py 2013-07-02 17:36:58.000000000 +0200 @@ -1,2 +1,2 @@ -__version__ = '0.7.2' +__version__ = '0.7.3' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyflakes-0.7.2/pyflakes/checker.py new/pyflakes-0.7.3/pyflakes/checker.py --- old/pyflakes-0.7.2/pyflakes/checker.py 2013-04-24 14:10:46.000000000 +0200 +++ new/pyflakes-0.7.3/pyflakes/checker.py 2013-06-19 01:34:23.000000000 +0200 @@ -192,6 +192,10 @@ yield name, binding +class GeneratorScope(Scope): + pass + + class ModuleScope(Scope): pass @@ -319,11 +323,14 @@ self.report(messages.UnusedImport, importation.source, importation.name) - def pushFunctionScope(self): - self.scopeStack.append(FunctionScope()) + def pushScope(self, scopeClass=FunctionScope): + self.scopeStack.append(scopeClass()) - def pushClassScope(self): - self.scopeStack.append(ClassScope()) + def pushFunctionScope(self): # XXX Deprecated + self.pushScope(FunctionScope) + + def pushClassScope(self): # XXX Deprecated + self.pushScope(ClassScope) def report(self, messageClass, *args, **kwargs): self.messages.append(messageClass(self.filename, *args, **kwargs)) @@ -437,12 +444,15 @@ else: return - # try enclosing function scopes + scopes = [scope for scope in self.scopeStack[:-1] + if isinstance(scope, (FunctionScope, ModuleScope))] + if isinstance(self.scope, GeneratorScope) and scopes[-1] != self.scopeStack[-2]: + scopes.append(self.scopeStack[-2]) + + # try enclosing function scopes and global scope importStarred = self.scope.importStarred - for scope in self.scopeStack[-2:0:-1]: + for scope in reversed(scopes): importStarred = importStarred or scope.importStarred - if not isinstance(scope, FunctionScope): - continue try: scope[name].used = (self.scope, node) except KeyError: @@ -450,15 +460,6 @@ else: return - # try global scope - importStarred = importStarred or self.scopeStack[0].importStarred - try: - self.scopeStack[0][name].used = (self.scope, node) - except KeyError: - pass - else: - return - # look in the built-ins if importStarred or name in self.builtIns: return @@ -570,7 +571,7 @@ # leading whitespace: ... return node_offset = self.offset or (0, 0) - self.pushFunctionScope() + self.pushScope() for example in examples: try: tree = compile(example.source, "<doctest>", "exec", ast.PyCF_ONLY_AST) @@ -632,7 +633,7 @@ self.handleNode(node.elt, node) def GENERATOREXP(self, node): - self.pushFunctionScope() + self.pushScope(GeneratorScope) # handle generators before element for gen in node.generators: self.handleNode(gen, node) @@ -642,7 +643,7 @@ SETCOMP = GENERATOREXP def DICTCOMP(self, node): - self.pushFunctionScope() + self.pushScope(GeneratorScope) for gen in node.generators: self.handleNode(gen, node) self.handleNode(node.key, node) @@ -742,7 +743,7 @@ def runFunction(): - self.pushFunctionScope() + self.pushScope() for name in args: self.addBinding(node, Argument(name, node), reportRedef=False) if isinstance(node.body, list): @@ -777,7 +778,7 @@ if not PY2: for keywordNode in node.keywords: self.handleNode(keywordNode, node) - self.pushClassScope() + self.pushScope(ClassScope) if self.withDoctest: self.deferFunction(lambda: self.handleDoctests(node)) for stmt in node.body: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyflakes-0.7.2/pyflakes/test/harness.py new/pyflakes-0.7.3/pyflakes/test/harness.py --- old/pyflakes-0.7.2/pyflakes/test/harness.py 2013-01-27 16:33:07.000000000 +0100 +++ new/pyflakes-0.7.3/pyflakes/test/harness.py 2013-06-19 15:15:15.000000000 +0200 @@ -1,18 +1,26 @@ +import sys import textwrap -import _ast - -import unittest2 +import unittest from pyflakes import checker +__all__ = ['TestCase', 'skip', 'skipIf'] + +if sys.version_info < (2, 7): + skip = lambda why: (lambda func: 'skip') # not callable + skipIf = lambda cond, why: (skip(why) if cond else lambda func: func) +else: + skip = unittest.skip + skipIf = unittest.skipIf +PyCF_ONLY_AST = 1024 + -class Test(unittest2.TestCase): +class TestCase(unittest.TestCase): def flakes(self, input, *expectedOutputs, **kw): - ast = compile(textwrap.dedent(input), "<test>", "exec", - _ast.PyCF_ONLY_AST) - w = checker.Checker(ast, **kw) + tree = compile(textwrap.dedent(input), "<test>", "exec", PyCF_ONLY_AST) + w = checker.Checker(tree, **kw) outputs = [type(o) for o in w.messages] expectedOutputs = list(expectedOutputs) outputs.sort(key=lambda t: t.__name__) @@ -21,7 +29,13 @@ for input: %s expected outputs: -%s +%r but got: -%s''' % (input, repr(expectedOutputs), '\n'.join([str(o) for o in w.messages]))) +%s''' % (input, expectedOutputs, '\n'.join([str(o) for o in w.messages]))) return w + + if sys.version_info < (2, 7): + + def assertIs(self, expr1, expr2, msg=None): + if expr1 is not expr2: + self.fail(msg or '%r is not %r' % (expr1, expr2)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyflakes-0.7.2/pyflakes/test/test_api.py new/pyflakes-0.7.3/pyflakes/test/test_api.py --- old/pyflakes-0.7.2/pyflakes/test/test_api.py 2013-04-23 07:36:53.000000000 +0200 +++ new/pyflakes-0.7.3/pyflakes/test/test_api.py 2013-06-19 13:59:49.000000000 +0200 @@ -8,8 +8,6 @@ import subprocess import tempfile -from unittest2 import skipIf, TestCase - from pyflakes.messages import UnusedImport from pyflakes.reporter import Reporter from pyflakes.api import ( @@ -17,6 +15,7 @@ checkRecursive, iterSourceCode, ) +from pyflakes.test.harness import TestCase, skipIf if sys.version_info < (3,): from cStringIO import StringIO @@ -161,7 +160,7 @@ err = StringIO() reporter = Reporter(None, err) reporter.syntaxError('foo.py', 'a problem', 3, 4, 'bad line of source') - self.assertEquals( + self.assertEqual( ("foo.py:3: a problem\n" "bad line of source\n" " ^\n"), @@ -176,7 +175,7 @@ reporter = Reporter(None, err) reporter.syntaxError('foo.py', 'a problem', 3, None, 'bad line of source') - self.assertEquals( + self.assertEqual( ("foo.py:3: a problem\n" "bad line of source\n"), err.getvalue()) @@ -195,7 +194,7 @@ reporter = Reporter(None, err) reporter.syntaxError('foo.py', 'a problem', 3, len(lines[0]) + 5, '\n'.join(lines)) - self.assertEquals( + self.assertEqual( ("foo.py:3: a problem\n" + lines[-1] + "\n" + " ^\n"), @@ -208,7 +207,7 @@ err = StringIO() reporter = Reporter(None, err) reporter.unexpectedError('source.py', 'error message') - self.assertEquals('source.py: error message\n', err.getvalue()) + self.assertEqual('source.py: error message\n', err.getvalue()) def test_flake(self): """ @@ -219,7 +218,7 @@ reporter = Reporter(out, None) message = UnusedImport('foo.py', Node(42), 'bar') reporter.flake(message) - self.assertEquals(out.getvalue(), "%s\n" % (message,)) + self.assertEqual(out.getvalue(), "%s\n" % (message,)) class CheckTests(TestCase): @@ -248,7 +247,7 @@ """ err = StringIO() count = withStderrTo(err, checkPath, path) - self.assertEquals( + self.assertEqual( (count, err.getvalue()), (len(errorList), ''.join(errorList))) def getErrors(self, path): @@ -283,8 +282,8 @@ L{checkPath} handles non-existing files. """ count, errors = self.getErrors('extremo') - self.assertEquals(count, 1) - self.assertEquals( + self.assertEqual(count, 1) + self.assertEqual( errors, [('unexpectedError', 'extremo', 'No such file or directory')]) @@ -381,16 +380,20 @@ """ The invalid escape syntax raises ValueError in Python 2 """ + ver = sys.version_info # ValueError: invalid \x escape sourcePath = self.makeTempFile(r"foo = '\xyz'") - if sys.version_info < (3,): + if ver < (3,): decoding_error = "%s: problem decoding source\n" % (sourcePath,) else: + last_line = ' ^\n' if ver >= (3, 2) else '' + # Column has been "fixed" since 3.2.4 and 3.3.1 + col = 1 if ver >= (3, 3, 1) or ((3, 2, 4) <= ver < (3, 3)) else 2 decoding_error = """\ %s:1: (unicode error) 'unicodeescape' codec can't decode bytes \ -in position 0-2: truncated \\xXX escape +in position 0-%d: truncated \\xXX escape foo = '\\xyz' -%s""" % (sourcePath, ' ^\n' if sys.version_info >= (3, 2) else '') +%s""" % (sourcePath, col, last_line) self.assertHasErrors( sourcePath, [decoding_error]) @@ -402,8 +405,8 @@ sourcePath = self.makeTempFile('') os.chmod(sourcePath, 0) count, errors = self.getErrors(sourcePath) - self.assertEquals(count, 1) - self.assertEquals( + self.assertEqual(count, 1) + self.assertEqual( errors, [('unexpectedError', sourcePath, "Permission denied")]) @@ -414,8 +417,8 @@ """ sourcePath = self.makeTempFile("import foo") count, errors = self.getErrors(sourcePath) - self.assertEquals(count, 1) - self.assertEquals( + self.assertEqual(count, 1) + self.assertEqual( errors, [('flake', str(UnusedImport(sourcePath, Node(1), 'foo')))]) @skipIf(sys.version_info >= (3,), "not relevant") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyflakes-0.7.2/pyflakes/test/test_doctests.py new/pyflakes-0.7.3/pyflakes/test/test_doctests.py --- old/pyflakes-0.7.2/pyflakes/test/test_doctests.py 2013-04-24 14:10:46.000000000 +0200 +++ new/pyflakes-0.7.3/pyflakes/test/test_doctests.py 2013-06-19 13:45:15.000000000 +0200 @@ -1,11 +1,10 @@ import textwrap -from unittest2 import skip +from pyflakes import messages as m from pyflakes.test.test_other import Test as TestOther from pyflakes.test.test_imports import Test as TestImports from pyflakes.test.test_undefined_names import Test as TestUndefinedNames - -import pyflakes.messages as m +from pyflakes.test.harness import skip class Test(TestOther, TestImports, TestUndefinedNames): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyflakes-0.7.2/pyflakes/test/test_imports.py new/pyflakes-0.7.3/pyflakes/test/test_imports.py --- old/pyflakes-0.7.2/pyflakes/test/test_imports.py 2013-04-21 17:21:00.000000000 +0200 +++ new/pyflakes-0.7.3/pyflakes/test/test_imports.py 2013-06-19 13:47:22.000000000 +0200 @@ -1,12 +1,11 @@ from sys import version_info -from unittest2 import skip, skipIf from pyflakes import messages as m -from pyflakes.test import harness +from pyflakes.test.harness import TestCase, skip, skipIf -class Test(harness.Test): +class Test(TestCase): def test_unusedImport(self): self.flakes('import fu, bar', m.UnusedImport, m.UnusedImport) @@ -652,7 +651,7 @@ ''', m.LateFutureImport) -class TestSpecialAll(harness.Test): +class TestSpecialAll(TestCase): """ Tests for suppression of unused import warnings by C{__all__}. """ @@ -768,7 +767,7 @@ ''', m.UndefinedName) -class Python26Tests(harness.Test): +class Python26Tests(TestCase): """ Tests for checking of syntax which is valid in PYthon 2.6 and newer. """ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyflakes-0.7.2/pyflakes/test/test_other.py new/pyflakes-0.7.3/pyflakes/test/test_other.py --- old/pyflakes-0.7.2/pyflakes/test/test_other.py 2013-04-21 17:21:28.000000000 +0200 +++ new/pyflakes-0.7.3/pyflakes/test/test_other.py 2013-07-02 16:41:45.000000000 +0200 @@ -3,13 +3,12 @@ """ from sys import version_info -from unittest2 import skip, skipIf from pyflakes import messages as m -from pyflakes.test import harness +from pyflakes.test.harness import TestCase, skip, skipIf -class Test(harness.Test): +class Test(TestCase): def test_duplicateArgs(self): self.flakes('def fu(bar, bar): pass', m.DuplicateArgument) @@ -466,7 +465,7 @@ ''') -class TestUnusedAssignment(harness.Test): +class TestUnusedAssignment(TestCase): """ Tests for warning about unused assignments. """ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyflakes-0.7.2/pyflakes/test/test_undefined_names.py new/pyflakes-0.7.3/pyflakes/test/test_undefined_names.py --- old/pyflakes-0.7.2/pyflakes/test/test_undefined_names.py 2013-04-21 17:29:15.000000000 +0200 +++ new/pyflakes-0.7.3/pyflakes/test/test_undefined_names.py 2013-07-02 17:39:12.000000000 +0200 @@ -2,13 +2,11 @@ from _ast import PyCF_ONLY_AST from sys import version_info -from unittest2 import skip, skipIf, TestCase - from pyflakes import messages as m, checker -from pyflakes.test import harness +from pyflakes.test.harness import TestCase, skip, skipIf -class Test(harness.Test): +class Test(TestCase): def test_undefined(self): self.flakes('bar', m.UndefinedName) @@ -364,6 +362,28 @@ socket_map = {} ''', m.UndefinedName) + def test_definedInClass(self): + """ + Defined name for generator expressions and dict/set comprehension. + """ + self.flakes(''' + class A: + T = range(10) + + Z = (x for x in T) + L = [x for x in T] + B = dict((i, str(i)) for i in T) + ''') + + if version_info >= (2, 7): + self.flakes(''' + class A: + T = range(10) + + X = {x for x in T} + Y = {x:x for x in T} + ''') + class NameTests(TestCase): """ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyflakes-0.7.2/pyflakes.egg-info/PKG-INFO new/pyflakes-0.7.3/pyflakes.egg-info/PKG-INFO --- old/pyflakes-0.7.2/pyflakes.egg-info/PKG-INFO 2013-04-24 14:40:48.000000000 +0200 +++ new/pyflakes-0.7.3/pyflakes.egg-info/PKG-INFO 2013-07-02 18:04:27.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: pyflakes -Version: 0.7.2 +Version: 0.7.3 Summary: passive checker of Python programs Home-page: https://launchpad.net/pyflakes Author: Florent Xicluna diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyflakes-0.7.2/setup.py new/pyflakes-0.7.3/setup.py --- old/pyflakes-0.7.2/setup.py 2013-04-21 12:51:56.000000000 +0200 +++ new/pyflakes-0.7.3/setup.py 2013-06-19 13:51:37.000000000 +0200 @@ -4,7 +4,6 @@ from __future__ import with_statement import os.path -import sys try: from setuptools import setup @@ -12,14 +11,11 @@ from distutils.core import setup extra = {'scripts': ["bin/pyflakes"]} else: - if sys.version_info < (3,): - extra = {'tests_require': ['unittest2'], - 'test_suite': 'unittest2.collector'} - else: - extra = {'tests_require': ['unittest2py3k'], - 'test_suite': 'unittest2.collector.collector'} - extra['entry_points'] = { - 'console_scripts': ['pyflakes = pyflakes.api:main'], + extra = { + 'test_suite': 'pyflakes.test', + 'entry_points': { + 'console_scripts': ['pyflakes = pyflakes.api:main'], + }, } -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
