Hello community,

here is the log from the commit of package python3-pycodestyle for 
openSUSE:Factory checked in at 2017-02-22 13:54:35
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python3-pycodestyle (Old)
 and      /work/SRC/openSUSE:Factory/.python3-pycodestyle.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python3-pycodestyle"

Changes:
--------
--- /work/SRC/openSUSE:Factory/python3-pycodestyle/python3-pycodestyle.changes  
2016-11-15 18:01:50.000000000 +0100
+++ 
/work/SRC/openSUSE:Factory/.python3-pycodestyle.new/python3-pycodestyle.changes 
    2017-02-22 13:54:36.339172047 +0100
@@ -1,0 +2,21 @@
+Mon Feb 20 20:01:00 UTC 2017 - [email protected]
+
+- specfile:
+  * update copyright year
+
+- update to version 2.3.1:
+  * Bugs:
+    + Fix regression in detection of E302 and E306; #618, #620
+
+- changes from version 2.3.0:
+  * New Checks:
+    + Add E722 warning for bare except clauses
+    + Report E704 for async function definitions (async def)
+  * Bugs:
+    + Fix another E305 false positive for variables beginning with
+      “class” or “def”
+    + Fix detection of multiple spaces betwen async and def
+    + Fix handling of variable annotations. Stop reporting E701 on
+      Python 3.6 for variable annotations.
+
+-------------------------------------------------------------------

Old:
----
  pycodestyle-2.2.0.tar.gz

New:
----
  pycodestyle-2.3.1.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python3-pycodestyle.spec ++++++
--- /var/tmp/diff_new_pack.SokDiX/_old  2017-02-22 13:54:36.767111157 +0100
+++ /var/tmp/diff_new_pack.SokDiX/_new  2017-02-22 13:54:36.767111157 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python3-pycodestyle
 #
-# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2017 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
@@ -17,7 +17,7 @@
 
 
 Name:           python3-pycodestyle
-Version:        2.2.0
+Version:        2.3.1
 Release:        0
 Url:            https://github.com/PyCQA/pycodestyle
 Summary:        Python style guide checker - formery python3-pep8

++++++ pycodestyle-2.2.0.tar.gz -> pycodestyle-2.3.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pycodestyle-2.2.0/CHANGES.txt 
new/pycodestyle-2.3.1/CHANGES.txt
--- old/pycodestyle-2.2.0/CHANGES.txt   2016-11-14 19:40:58.000000000 +0100
+++ new/pycodestyle-2.3.1/CHANGES.txt   2017-01-31 00:58:13.000000000 +0100
@@ -1,6 +1,29 @@
 Changelog
 =========
 
+2.3.1 (2017-01-31)
+------------------
+
+Bugs:
+
+* Fix regression in detection of E302 and E306; #618, #620
+
+2.3.0 (2017-01-30)
+------------------
+
+New Checks:
+
+* Add E722 warning for bare ``except`` clauses
+* Report E704 for async function definitions (``async def``)
+
+Bugs:
+
+* Fix another E305 false positive for variables beginning with "class" or
+  "def"
+* Fix detection of multiple spaces betwen ``async`` and ``def``
+* Fix handling of variable annotations. Stop reporting E701 on Python 3.6 for
+  variable annotations.
+
 2.2.0 (2016-11-14)
 ------------------
 
@@ -28,6 +51,7 @@
 * Report E741 on 'global' and 'nonlocal' statements, as well as prohibited
   single-letter variables.
 * Deprecated use of `[pep8]` section name in favor of `[pycodestyle]`; #591
+* Report E722 when bare except clause is used; #579
 
 Bugs:
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pycodestyle-2.2.0/PKG-INFO 
new/pycodestyle-2.3.1/PKG-INFO
--- old/pycodestyle-2.2.0/PKG-INFO      2016-11-14 19:41:50.000000000 +0100
+++ new/pycodestyle-2.3.1/PKG-INFO      2017-01-31 00:59:36.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: pycodestyle
-Version: 2.2.0
+Version: 2.3.1
 Summary: Python style guide checker
 Home-page: https://pycodestyle.readthedocs.io/
 Author: Ian Lee
@@ -119,6 +119,29 @@
         Changelog
         =========
         
+        2.3.1 (2017-01-31)
+        ------------------
+        
+        Bugs:
+        
+        * Fix regression in detection of E302 and E306; #618, #620
+        
+        2.3.0 (2017-01-30)
+        ------------------
+        
+        New Checks:
+        
+        * Add E722 warning for bare ``except`` clauses
+        * Report E704 for async function definitions (``async def``)
+        
+        Bugs:
+        
+        * Fix another E305 false positive for variables beginning with "class" 
or
+          "def"
+        * Fix detection of multiple spaces betwen ``async`` and ``def``
+        * Fix handling of variable annotations. Stop reporting E701 on Python 
3.6 for
+          variable annotations.
+        
         2.2.0 (2016-11-14)
         ------------------
         
@@ -146,6 +169,7 @@
         * Report E741 on 'global' and 'nonlocal' statements, as well as 
prohibited
           single-letter variables.
         * Deprecated use of `[pep8]` section name in favor of `[pycodestyle]`; 
#591
+        * Report E722 when bare except clause is used; #579
         
         Bugs:
         
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pycodestyle-2.2.0/docs/intro.rst 
new/pycodestyle-2.3.1/docs/intro.rst
--- old/pycodestyle-2.2.0/docs/intro.rst        2016-11-14 19:34:56.000000000 
+0100
+++ new/pycodestyle-2.3.1/docs/intro.rst        2017-01-25 00:13:11.000000000 
+0100
@@ -361,6 +361,8 @@
 
+------------+----------------------------------------------------------------------+
 | E721 (^)   | do not compare types, use 'isinstance()'                        
     |
 
+------------+----------------------------------------------------------------------+
+| E722       | do not use bare except, specify exception instead               
     |
++------------+----------------------------------------------------------------------+
 | E731       | do not assign a lambda expression, use a def                    
     |
 
+------------+----------------------------------------------------------------------+
 | E741       | do not use variables named 'l', 'O', or 'I'                     
     |
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pycodestyle-2.2.0/pycodestyle.egg-info/PKG-INFO 
new/pycodestyle-2.3.1/pycodestyle.egg-info/PKG-INFO
--- old/pycodestyle-2.2.0/pycodestyle.egg-info/PKG-INFO 2016-11-14 
19:41:50.000000000 +0100
+++ new/pycodestyle-2.3.1/pycodestyle.egg-info/PKG-INFO 2017-01-31 
00:59:35.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: pycodestyle
-Version: 2.2.0
+Version: 2.3.1
 Summary: Python style guide checker
 Home-page: https://pycodestyle.readthedocs.io/
 Author: Ian Lee
@@ -119,6 +119,29 @@
         Changelog
         =========
         
+        2.3.1 (2017-01-31)
+        ------------------
+        
+        Bugs:
+        
+        * Fix regression in detection of E302 and E306; #618, #620
+        
+        2.3.0 (2017-01-30)
+        ------------------
+        
+        New Checks:
+        
+        * Add E722 warning for bare ``except`` clauses
+        * Report E704 for async function definitions (``async def``)
+        
+        Bugs:
+        
+        * Fix another E305 false positive for variables beginning with "class" 
or
+          "def"
+        * Fix detection of multiple spaces betwen ``async`` and ``def``
+        * Fix handling of variable annotations. Stop reporting E701 on Python 
3.6 for
+          variable annotations.
+        
         2.2.0 (2016-11-14)
         ------------------
         
@@ -146,6 +169,7 @@
         * Report E741 on 'global' and 'nonlocal' statements, as well as 
prohibited
           single-letter variables.
         * Deprecated use of `[pep8]` section name in favor of `[pycodestyle]`; 
#591
+        * Report E722 when bare except clause is used; #579
         
         Bugs:
         
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pycodestyle-2.2.0/pycodestyle.egg-info/SOURCES.txt 
new/pycodestyle-2.3.1/pycodestyle.egg-info/SOURCES.txt
--- old/pycodestyle-2.2.0/pycodestyle.egg-info/SOURCES.txt      2016-11-14 
19:41:50.000000000 +0100
+++ new/pycodestyle-2.3.1/pycodestyle.egg-info/SOURCES.txt      2017-01-31 
00:59:36.000000000 +0100
@@ -21,6 +21,7 @@
 pycodestyle.egg-info/namespace_packages.txt
 pycodestyle.egg-info/not-zip-safe
 pycodestyle.egg-info/top_level.txt
+testsuite/.E30not.py.swp
 testsuite/E10.py
 testsuite/E11.py
 testsuite/E12.py
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pycodestyle-2.2.0/pycodestyle.py 
new/pycodestyle-2.3.1/pycodestyle.py
--- old/pycodestyle-2.2.0/pycodestyle.py        2016-11-14 19:38:29.000000000 
+0100
+++ new/pycodestyle-2.3.1/pycodestyle.py        2017-01-31 00:57:04.000000000 
+0100
@@ -66,7 +66,7 @@
 except ImportError:
     from ConfigParser import RawConfigParser
 
-__version__ = '2.2.0'
+__version__ = '2.3.1'
 
 DEFAULT_EXCLUDE = '.svn,CVS,.bzr,.hg,.git,__pycache__,.tox'
 DEFAULT_IGNORE = 'E121,E123,E126,E226,E24,E704,W503'
@@ -121,6 +121,20 @@
 OPERATOR_REGEX = re.compile(r'(?:[^,\s])(\s*)(?:[-+*/|!<=>%&^]+)(\s*)')
 LAMBDA_REGEX = re.compile(r'\blambda\b')
 HUNK_REGEX = re.compile(r'^@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@.*$')
+STARTSWITH_DEF_REGEX = re.compile(r'^(async\s+def|def)')
+STARTSWITH_TOP_LEVEL_REGEX = re.compile(r'^(async\s+def\s+|def\s+|class\s+|@)')
+STARTSWITH_INDENT_STATEMENT_REGEX = re.compile(
+    r'^\s*({0})'.format('|'.join(s.replace(' ', '\s+') for s in (
+        'def', 'async def',
+        'for', 'async for',
+        'if', 'elif', 'else',
+        'try', 'except', 'finally',
+        'with', 'async with',
+        'class',
+        'while',
+    )))
+)
+DUNDER_REGEX = re.compile(r'^__([^\s]+)__ = ')
 
 # Work around Python < 2.6 behaviour, which does not generate NL after
 # a comment which is on a line by itself.
@@ -264,6 +278,7 @@
     E303: def a():\n\n\n\n    pass
     E304: @decorator\n\ndef a():\n    pass
     E305: def a():\n    pass\na()
+    E306: def a():\n    def b():\n        pass\n    def c():\n        pass
     """
     if line_number < 3 and not previous_logical:
         return  # Don't expect blank lines before the first line
@@ -272,7 +287,7 @@
             yield 0, "E304 blank lines found after function decorator"
     elif blank_lines > 2 or (indent_level and blank_lines == 2):
         yield 0, "E303 too many blank lines (%d)" % blank_lines
-    elif logical_line.startswith(('def ', 'async def', 'class ', '@')):
+    elif STARTSWITH_TOP_LEVEL_REGEX.match(logical_line):
         if indent_level:
             if not (blank_before or previous_indent_level < indent_level or
                     DOCSTRING_REGEX.match(previous_logical)):
@@ -813,7 +828,7 @@
     no_space = False
     prev_end = None
     annotated_func_arg = False
-    in_def = logical_line.startswith(('def', 'async def'))
+    in_def = bool(STARTSWITH_DEF_REGEX.match(logical_line))
     message = "E251 unexpected spaces around keyword / parameter equals"
     for token_type, text, start, end, line in tokens:
         if token_type == tokenize.NL:
@@ -912,8 +927,10 @@
     Okay: # this is a comment\nimport os
     Okay: '''this is a module docstring'''\nimport os
     Okay: r'''this is a module docstring'''\nimport os
-    Okay: try:\n    import x\nexcept:\n    pass\nelse:\n    pass\nimport y
-    Okay: try:\n    import x\nexcept:\n    pass\nfinally:\n    pass\nimport y
+    Okay:
+    try:\n\timport x\nexcept ImportError:\n\tpass\nelse:\n\tpass\nimport y
+    Okay:
+    try:\n\timport x\nexcept ImportError:\n\tpass\nfinally:\n\tpass\nimport y
     E402: a=1\nimport os
     E402: 'One string'\n"Two string"\nimport os
     E402: a=1\nfrom sys import x
@@ -939,6 +956,8 @@
     if line.startswith('import ') or line.startswith('from '):
         if checker_state.get('seen_non_imports', False):
             yield 0, "E402 module level import not at top of file"
+    elif re.match(DUNDER_REGEX, line):
+        return
     elif any(line.startswith(kw) for kw in allowed_try_keywords):
         # Allow try, except, else, finally keywords intermixed with imports in
         # order to support conditional importing
@@ -998,9 +1017,9 @@
                     yield 0, ("E731 do not assign a lambda expression, use a "
                               "def")
                 break
-            if line.startswith('def '):
+            if STARTSWITH_DEF_REGEX.match(line):
                 yield 0, "E704 multiple statements on one line (def)"
-            else:
+            elif STARTSWITH_INDENT_STATEMENT_REGEX.match(line):
                 yield found, "E701 multiple statements on one line (colon)"
         prev_found = found
         found = line.find(':', found + 1)
@@ -1179,6 +1198,22 @@
         yield match.start(), "E721 do not compare types, use 'isinstance()'"
 
 
+def bare_except(logical_line, noqa):
+    r"""When catching exceptions, mention specific exceptions whenever 
possible.
+
+    Okay: except Exception:
+    Okay: except BaseException:
+    E722: except:
+    """
+    if noqa:
+        return
+
+    regex = re.compile(r"except\s*:")
+    match = regex.match(logical_line)
+    if match:
+        yield match.start(), "E722 do not use bare except'"
+
+
 def ambiguous_identifier(logical_line, tokens):
     r"""Never use the characters 'l', 'O', or 'I' as variable names.
 
Binary files old/pycodestyle-2.2.0/testsuite/.E30not.py.swp and 
new/pycodestyle-2.3.1/testsuite/.E30not.py.swp differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pycodestyle-2.2.0/testsuite/E25.py 
new/pycodestyle-2.3.1/testsuite/E25.py
--- old/pycodestyle-2.2.0/testsuite/E25.py      2016-06-08 06:18:03.000000000 
+0200
+++ new/pycodestyle-2.3.1/testsuite/E25.py      2017-01-25 00:13:11.000000000 
+0100
@@ -38,3 +38,7 @@
 #: Okay
 async def add(a: int = 0, b: int = 0) -> int:
     return a + b
+# Previously E251 four times
+#: E272:1:6
+async  def add(a: int = 0, b: int = 0) -> int:
+    return a + b
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pycodestyle-2.2.0/testsuite/E30.py 
new/pycodestyle-2.3.1/testsuite/E30.py
--- old/pycodestyle-2.2.0/testsuite/E30.py      2016-08-13 20:42:06.000000000 
+0200
+++ new/pycodestyle-2.3.1/testsuite/E30.py      2017-01-25 00:13:11.000000000 
+0100
@@ -113,7 +113,7 @@
 
 try:
     a()
-except:
+except Exception:
     pass
 #: E305:5:1
 def a():
@@ -156,3 +156,10 @@
 
 if __name__ == '__main__':
     main()
+# Previously just E272:1:6 E272:4:6
+#: E302:4:1 E272:1:6 E272:4:6
+async  def x():
+    pass
+
+async  def x(y: int = 1):
+    pass
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pycodestyle-2.2.0/testsuite/E30not.py 
new/pycodestyle-2.3.1/testsuite/E30not.py
--- old/pycodestyle-2.2.0/testsuite/E30not.py   2016-06-25 23:41:24.000000000 
+0200
+++ new/pycodestyle-2.3.1/testsuite/E30not.py   2017-01-31 00:56:48.000000000 
+0100
@@ -151,3 +151,14 @@
 
 if __name__ == '__main__':
     foo()
+#: Okay
+classification_errors = None
+#: Okay
+defined_properly = True
+#: Okay
+defaults = {}
+defaults.update({})
+#: Okay
+def foo(x):
+    classification = x
+    definitely = not classification
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pycodestyle-2.2.0/testsuite/E40.py 
new/pycodestyle-2.3.1/testsuite/E40.py
--- old/pycodestyle-2.2.0/testsuite/E40.py      2016-06-03 03:06:25.000000000 
+0200
+++ new/pycodestyle-2.3.1/testsuite/E40.py      2017-01-27 21:51:02.000000000 
+0100
@@ -11,14 +11,22 @@
 
 import myclass
 import foo.bar.yourclass
-#: E402
+#: Okay
 __all__ = ['abc']
 
 import foo
 #: Okay
+__version__ = "42"
+
+import foo
+#: Okay
+__author__ = "Simon Gomizelj"
+
+import foo
+#: Okay
 try:
     import foo
-except:
+except ImportError:
     pass
 else:
     print('imported foo')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pycodestyle-2.2.0/testsuite/E70.py 
new/pycodestyle-2.3.1/testsuite/E70.py
--- old/pycodestyle-2.2.0/testsuite/E70.py      2016-05-31 18:17:34.000000000 
+0200
+++ new/pycodestyle-2.3.1/testsuite/E70.py      2017-01-25 00:13:11.000000000 
+0100
@@ -12,6 +12,10 @@
 del a[:]; a.append(42);
 #: E704:1:1
 def f(x): return 2
+#: E704:1:1
+async def f(x): return 2
+#: E704:1:1 E272:1:6
+async  def f(x): return 2
 #: E704:1:1 E226:1:19
 def f(x): return 2*x
 #: E704:2:5 E226:2:23
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pycodestyle-2.2.0/testsuite/E72.py 
new/pycodestyle-2.3.1/testsuite/E72.py
--- old/pycodestyle-2.2.0/testsuite/E72.py      2016-05-31 18:17:34.000000000 
+0200
+++ new/pycodestyle-2.3.1/testsuite/E72.py      2017-01-25 00:13:11.000000000 
+0100
@@ -49,3 +49,31 @@
     pass
 if type(a) != type(b) or type(a) == type(ccc):
     pass
+#: E722
+try:
+    pass
+except:
+    pass
+#: E722
+try:
+    pass
+except Exception:
+    pass
+except:
+    pass
+#: E722 E203 E271
+try:
+    pass
+except  :
+    pass
+#: Okay
+fake_code = """"
+try:
+    do_something()
+except:
+    pass
+"""
+try:
+    pass
+except Exception:
+    pass
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pycodestyle-2.2.0/testsuite/E90.py 
new/pycodestyle-2.3.1/testsuite/E90.py
--- old/pycodestyle-2.2.0/testsuite/E90.py      2016-05-31 18:17:34.000000000 
+0200
+++ new/pycodestyle-2.3.1/testsuite/E90.py      2017-01-25 00:13:11.000000000 
+0100
@@ -8,7 +8,7 @@
            pass
        except:
                print 'Whoops'
-#: E122 E225 E251 E251 E701
+#: E122 E225 E251 E251
 
 # Do not crash if code is invalid
 if msg:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pycodestyle-2.2.0/testsuite/python3.py 
new/pycodestyle-2.3.1/testsuite/python3.py
--- old/pycodestyle-2.2.0/testsuite/python3.py  2016-05-31 18:17:34.000000000 
+0200
+++ new/pycodestyle-2.3.1/testsuite/python3.py  2017-01-25 00:13:11.000000000 
+0100
@@ -1,6 +1,18 @@
 #!/usr/bin/env python3
+from typing import ClassVar, List
 
 
 # Annotated function (Issue #29)
 def foo(x: int) -> int:
     return x + 1
+
+
+# Annotated variables #575
+CONST: int = 42
+
+
+class Class:
+    cls_var: ClassVar[str]
+
+    def m(self):
+        xs: List[int] = []


Reply via email to