Hello community,
here is the log from the commit of package python-pep8-naming for
openSUSE:Leap:15.2 checked in at 2020-03-09 18:10:10
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Leap:15.2/python-pep8-naming (Old)
and /work/SRC/openSUSE:Leap:15.2/.python-pep8-naming.new.26092 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pep8-naming"
Mon Mar 9 18:10:10 2020 rev:6 rq:776906 version:0.9.1
Changes:
--------
--- /work/SRC/openSUSE:Leap:15.2/python-pep8-naming/python-pep8-naming.changes
2020-01-15 15:51:31.947532186 +0100
+++
/work/SRC/openSUSE:Leap:15.2/.python-pep8-naming.new.26092/python-pep8-naming.changes
2020-03-09 18:10:11.209095192 +0100
@@ -1,0 +2,14 @@
+Sat Dec 7 17:42:36 UTC 2019 - Arun Persaud <[email protected]>
+
+- update to version 0.9.1:
+ * Fix line number offsets when reporting errors involving functions
+ with decorators in Python 3.8 and later.
+
+- changes from version 0.9.0:
+ * Drop support for Python 3.3 and 3.4.
+ * Support positional-only arguments in Python 3.8.
+ * Recognize abc.ABCMeta as a metaclass base type.
+ * ignore-names now also applies to the N803 check.
+ * Handle assigning exceptions to object attributes in Python 2.
+
+-------------------------------------------------------------------
Old:
----
pep8-naming-0.8.2.tar.gz
New:
----
pep8-naming-0.9.1.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-pep8-naming.spec ++++++
--- /var/tmp/diff_new_pack.B06Jct/_old 2020-03-09 18:10:11.449095537 +0100
+++ /var/tmp/diff_new_pack.B06Jct/_new 2020-03-09 18:10:11.457095548 +0100
@@ -1,7 +1,7 @@
#
# spec file for package python-pep8-naming
#
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2019 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-pep8-naming
-Version: 0.8.2
+Version: 0.9.1
Release: 0
Summary: Flake8 plugin for checking PEP-8 naming conventions
License: MIT
++++++ pep8-naming-0.8.2.tar.gz -> pep8-naming-0.9.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pep8-naming-0.8.2/CHANGELOG.rst
new/pep8-naming-0.9.1/CHANGELOG.rst
--- old/pep8-naming-0.8.2/CHANGELOG.rst 2019-02-04 21:48:45.000000000 +0100
+++ new/pep8-naming-0.9.1/CHANGELOG.rst 2019-11-14 18:59:02.000000000 +0100
@@ -1,6 +1,25 @@
Changes
=======
+0.9.1 - 2019-11-14
+------------------
+
+* Fix line number offsets when reporting errors involving functions with
+ decorators in Python 3.8 and later.
+
+0.9.0 - 2019-11-06
+------------------
+
+* Drop support for Python 3.3 and 3.4.
+
+* Support positional-only arguments in Python 3.8.
+
+* Recognize ``abc.ABCMeta`` as a metaclass base type.
+
+* ``ignore-names`` now also applies to the N803 check.
+
+* Handle assigning exceptions to object attributes in Python 2.
+
0.8.2 - 2019-02-04
------------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pep8-naming-0.8.2/PKG-INFO
new/pep8-naming-0.9.1/PKG-INFO
--- old/pep8-naming-0.8.2/PKG-INFO 2019-02-04 21:49:41.000000000 +0100
+++ new/pep8-naming-0.9.1/PKG-INFO 2019-11-14 18:59:28.000000000 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: pep8-naming
-Version: 0.8.2
+Version: 0.9.1
Summary: Check PEP-8 naming conventions, plugin for flake8
Home-page: https://github.com/PyCQA/pep8-naming
Author: Florent Xicluna
@@ -9,10 +9,11 @@
Description: .. image::
https://travis-ci.org/PyCQA/pep8-naming.svg?branch=master
:target: https://travis-ci.org/PyCQA/pep8-naming
- PEP-8 Naming Conventions
+ PEP 8 Naming Conventions
========================
- Check the PEP-8 naming conventions.
+ Check your code against `PEP 8
<https://www.python.org/dev/peps/pep-0008/>`_
+ naming conventions.
This module provides a plugin for ``flake8``, the Python code checker.
@@ -57,7 +58,7 @@
+------+-------------------------------------------------------+
| N806 | variable in function should be lowercase |
+------+-------------------------------------------------------+
- | N807 | function name should not start or end with '__' |
+ | N807 | function name should not start and end with '__' |
+------+-------------------------------------------------------+
+------+-------------------------------------------------------+
| N811 | constant imported as non constant |
@@ -80,7 +81,7 @@
--ignore-names Ignore errors for specific variable names.
- Currently, this option can only be used
for N802, N806, N815, and N816 errors.
+ Currently, this option can only be used
for N802, N803, N806, N815, and N816 errors.
Default:
``setUp,tearDown,setUpClass,tearDownClass,setUpTestData,failureException,longMessage,maxDiff``.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pep8-naming-0.8.2/README.rst
new/pep8-naming-0.9.1/README.rst
--- old/pep8-naming-0.8.2/README.rst 2019-02-01 21:39:10.000000000 +0100
+++ new/pep8-naming-0.9.1/README.rst 2019-11-14 18:59:02.000000000 +0100
@@ -1,10 +1,11 @@
.. image:: https://travis-ci.org/PyCQA/pep8-naming.svg?branch=master
:target: https://travis-ci.org/PyCQA/pep8-naming
-PEP-8 Naming Conventions
+PEP 8 Naming Conventions
========================
-Check the PEP-8 naming conventions.
+Check your code against `PEP 8 <https://www.python.org/dev/peps/pep-0008/>`_
+naming conventions.
This module provides a plugin for ``flake8``, the Python code checker.
@@ -49,7 +50,7 @@
+------+-------------------------------------------------------+
| N806 | variable in function should be lowercase |
+------+-------------------------------------------------------+
-| N807 | function name should not start or end with '__' |
+| N807 | function name should not start and end with '__' |
+------+-------------------------------------------------------+
+------+-------------------------------------------------------+
| N811 | constant imported as non constant |
@@ -72,7 +73,7 @@
--ignore-names Ignore errors for specific variable names.
- Currently, this option can only be used for N802,
N806, N815, and N816 errors.
+ Currently, this option can only be used for N802,
N803, N806, N815, and N816 errors.
Default:
``setUp,tearDown,setUpClass,tearDownClass,setUpTestData,failureException,longMessage,maxDiff``.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pep8-naming-0.8.2/run_tests.py
new/pep8-naming-0.9.1/run_tests.py
--- old/pep8-naming-0.8.2/run_tests.py 2019-01-24 19:23:43.000000000 +0100
+++ new/pep8-naming-0.9.1/run_tests.py 2019-07-17 18:28:29.000000000 +0200
@@ -104,7 +104,7 @@
if code in found_errors: # Expected FAIL
return 0
print("ERROR: %s not in %s. found_errors: %s. Source:\n%s"
- % (code, filename, found_errors, source))
+ % (code, filename, ','.join(sorted(found_errors)), source))
return 1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pep8-naming-0.8.2/src/pep8_naming.egg-info/PKG-INFO
new/pep8-naming-0.9.1/src/pep8_naming.egg-info/PKG-INFO
--- old/pep8-naming-0.8.2/src/pep8_naming.egg-info/PKG-INFO 2019-02-04
21:49:41.000000000 +0100
+++ new/pep8-naming-0.9.1/src/pep8_naming.egg-info/PKG-INFO 2019-11-14
18:59:28.000000000 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: pep8-naming
-Version: 0.8.2
+Version: 0.9.1
Summary: Check PEP-8 naming conventions, plugin for flake8
Home-page: https://github.com/PyCQA/pep8-naming
Author: Florent Xicluna
@@ -9,10 +9,11 @@
Description: .. image::
https://travis-ci.org/PyCQA/pep8-naming.svg?branch=master
:target: https://travis-ci.org/PyCQA/pep8-naming
- PEP-8 Naming Conventions
+ PEP 8 Naming Conventions
========================
- Check the PEP-8 naming conventions.
+ Check your code against `PEP 8
<https://www.python.org/dev/peps/pep-0008/>`_
+ naming conventions.
This module provides a plugin for ``flake8``, the Python code checker.
@@ -57,7 +58,7 @@
+------+-------------------------------------------------------+
| N806 | variable in function should be lowercase |
+------+-------------------------------------------------------+
- | N807 | function name should not start or end with '__' |
+ | N807 | function name should not start and end with '__' |
+------+-------------------------------------------------------+
+------+-------------------------------------------------------+
| N811 | constant imported as non constant |
@@ -80,7 +81,7 @@
--ignore-names Ignore errors for specific variable names.
- Currently, this option can only be used
for N802, N806, N815, and N816 errors.
+ Currently, this option can only be used
for N802, N803, N806, N815, and N816 errors.
Default:
``setUp,tearDown,setUpClass,tearDownClass,setUpTestData,failureException,longMessage,maxDiff``.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/pep8-naming-0.8.2/src/pep8_naming.egg-info/SOURCES.txt
new/pep8-naming-0.9.1/src/pep8_naming.egg-info/SOURCES.txt
--- old/pep8-naming-0.8.2/src/pep8_naming.egg-info/SOURCES.txt 2019-02-04
21:49:41.000000000 +0100
+++ new/pep8-naming-0.9.1/src/pep8_naming.egg-info/SOURCES.txt 2019-11-14
18:59:28.000000000 +0100
@@ -26,6 +26,7 @@
testsuite/N804_py35.py
testsuite/N805.py
testsuite/N805_py35.py
+testsuite/N805_py38.py
testsuite/N806.py
testsuite/N806_py2.py
testsuite/N806_py3.py
@@ -33,6 +34,7 @@
testsuite/N807.py
testsuite/N807_py3.py
testsuite/N807_py35.py
+testsuite/N80x.py
testsuite/N815.py
testsuite/N816.py
testsuite/N816_py3.py
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pep8-naming-0.8.2/src/pep8ext_naming.py
new/pep8-naming-0.9.1/src/pep8ext_naming.py
--- old/pep8-naming-0.8.2/src/pep8ext_naming.py 2019-02-04 21:48:45.000000000
+0100
+++ new/pep8-naming-0.9.1/src/pep8ext_naming.py 2019-11-14 18:59:02.000000000
+0100
@@ -12,11 +12,13 @@
except ImportError:
from flake8.util import ast, iter_child_nodes
-__version__ = '0.8.2'
+__version__ = '0.9.1'
PYTHON_VERSION = sys.version_info[:3]
PY2 = PYTHON_VERSION[0] == 2
+METACLASS_BASES = frozenset(('type', 'ABCMeta'))
+
# Node types which may contain class methods
METHOD_CONTAINER_NODES = {ast.If, ast.While, ast.For, ast.With}
FUNC_NODES = (ast.FunctionDef,)
@@ -42,12 +44,14 @@
def get_arg_name_tuples(node):
return _unpack_args(node.args.args)
+elif PYTHON_VERSION < (3, 8):
+ def get_arg_name_tuples(node):
+ groups = (node.args.args, node.args.kwonlyargs)
+ return [(arg, arg.arg) for args in groups for arg in args]
else:
def get_arg_name_tuples(node):
- args = node.args
- pos_args = [(arg, arg.arg) for arg in args.args]
- kw_only = [(arg, arg.arg) for arg in args.kwonlyargs]
- return pos_args + kw_only
+ groups = (node.args.posonlyargs, node.args.args, node.args.kwonlyargs)
+ return [(arg, arg.arg) for args in groups for arg in args]
class _ASTCheckMeta(type):
@@ -61,10 +65,12 @@
def _err(self, node, code, **kwargs):
lineno, col_offset = node.lineno, node.col_offset
if isinstance(node, ast.ClassDef):
- lineno += len(node.decorator_list)
+ if PYTHON_VERSION < (3, 8):
+ lineno += len(node.decorator_list)
col_offset += 6
elif isinstance(node, FUNC_NODES):
- lineno += len(node.decorator_list)
+ if PYTHON_VERSION < (3, 8):
+ lineno += len(node.decorator_list)
col_offset += 4
code_str = getattr(self, code)
if kwargs:
@@ -204,7 +210,8 @@
cls_bases = [b for b in cls_node.bases if isinstance(b, ast.Name)]
# If this class inherits from `type`, it's a metaclass, and we'll
# consider all of it's methods to be classmethods.
- ismetaclass = any(name for name in cls_bases if name.id == 'type')
+ ismetaclass = any(
+ name for name in cls_bases if name.id in METACLASS_BASES)
self.set_function_nodes_types(
iter_child_nodes(cls_node), ismetaclass, late_decoration)
@@ -271,7 +278,7 @@
prevailing style (e.g. threading.py), to retain backwards compatibility.
"""
N802 = "function name '{name}' should be lowercase"
- N807 = "function name '{name}' should not start or end with '__'"
+ N807 = "function name '{name}' should not start and end with '__'"
def visit_functiondef(self, node, parents, ignore=None):
function_type = getattr(node, 'function_type', _FunctionType.FUNCTION)
@@ -283,7 +290,7 @@
if name.lower() != name:
yield self.err(node, 'N802', name=name)
if (function_type == _FunctionType.FUNCTION
- and '__' in (name[:2], name[-2:])):
+ and name[:2] == '__' and name[-2:] == '__'):
yield self.err(node, 'N807', name=name)
visit_asyncfunctiondef = visit_functiondef
@@ -310,6 +317,8 @@
return node, arg
for arg, name in arg_name(node.args.vararg), arg_name(node.args.kwarg):
+ if name in ignore:
+ continue
if name is not None and name.lower() != name:
yield self.err(arg, 'N803', name=name)
return
@@ -327,7 +336,7 @@
if name0 != 'cls':
yield self.err(arg0, 'N804')
for arg, name in arg_name_tuples:
- if name.lower() != name:
+ if name.lower() != name and name not in ignore:
yield self.err(arg, 'N803', name=name)
return
@@ -473,6 +482,10 @@
if isinstance(assignment_target.name, ast.Tuple):
for name in assignment_target.name.elts:
yield name.id
+ elif isinstance(assignment_target.name, ast.Attribute):
+ # Python 2 also supports assigning an exception to an attribute
+ # eg. except Exception as obj.attr
+ yield assignment_target.name.attr
else:
yield assignment_target.name.id
else:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pep8-naming-0.8.2/testsuite/N803.py
new/pep8-naming-0.9.1/testsuite/N803.py
--- old/pep8-naming-0.8.2/testsuite/N803.py 2019-01-29 16:36:12.000000000
+0100
+++ new/pep8-naming-0.9.1/testsuite/N803.py 2019-07-17 00:45:19.000000000
+0200
@@ -63,3 +63,12 @@
@classmethod
def test(cls, BAD):
pass
+#: Okay(--ignore-names=I)
+def f(I):
+ I.think_therefore_i_am
+#: Okay(--ignore-names=I)
+def f(*I):
+ I[0].think_therefore_i_am
+#: Okay(--ignore-names=I)
+def f(*I):
+ I[''].think_therefore_i_am
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pep8-naming-0.8.2/testsuite/N804.py
new/pep8-naming-0.9.1/testsuite/N804.py
--- old/pep8-naming-0.8.2/testsuite/N804.py 2018-08-14 17:57:14.000000000
+0200
+++ new/pep8-naming-0.9.1/testsuite/N804.py 2019-07-17 18:28:29.000000000
+0200
@@ -1,3 +1,5 @@
+from abc import ABCMeta
+
#: N804:7:13
class Foo(object):
@classmethod
@@ -27,6 +29,9 @@
class MetaMethod(type):
def test(cls):
pass
+class MetaMethod(ABCMeta):
+ def test(cls):
+ pass
#: Okay
class NotMeta(object):
otherclass = Foo
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pep8-naming-0.8.2/testsuite/N805.py
new/pep8-naming-0.9.1/testsuite/N805.py
--- old/pep8-naming-0.8.2/testsuite/N805.py 2018-08-14 17:57:14.000000000
+0200
+++ new/pep8-naming-0.9.1/testsuite/N805.py 2019-07-17 18:28:29.000000000
+0200
@@ -1,3 +1,5 @@
+from abc import ABCMeta
+
#: Okay
class C:
def __init__(*args, **kwargs):
@@ -45,6 +47,12 @@
def __new__(cls, name, bases, attrs):
pass
def test(cls):
+ pass
+#: Okay
+class Meta(ABCMeta):
+ def __new__(cls, name, bases, attrs):
+ pass
+ def test(cls):
pass
#: Okay(--classmethod-decorators=clazzy,cool)
class NewClassmethodDecorators(object):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pep8-naming-0.8.2/testsuite/N805_py38.py
new/pep8-naming-0.9.1/testsuite/N805_py38.py
--- old/pep8-naming-0.8.2/testsuite/N805_py38.py 1970-01-01
01:00:00.000000000 +0100
+++ new/pep8-naming-0.9.1/testsuite/N805_py38.py 2019-11-04
15:41:34.000000000 +0100
@@ -0,0 +1,9 @@
+# python_version >= '3.8'
+#: Okay
+class C:
+ def __init__(self, a, /, b=None):
+ pass
+#: N805:2:18
+class C:
+ def __init__(this, a, /, b=None):
+ pass
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pep8-naming-0.8.2/testsuite/N806_py2.py
new/pep8-naming-0.9.1/testsuite/N806_py2.py
--- old/pep8-naming-0.8.2/testsuite/N806_py2.py 2019-01-29 20:19:40.000000000
+0100
+++ new/pep8-naming-0.9.1/testsuite/N806_py2.py 2019-07-17 00:45:19.000000000
+0200
@@ -5,9 +5,27 @@
f()
except (A, B) as (a, b):
pass
+#: Okay
+def f():
+ try:
+ f()
+ except X, foo:
+ pass
#: N806
def f():
try:
f()
except (A, B) as (good, BAD):
pass
+#: Okay
+def f():
+ try:
+ f()
+ except X, foo.bar:
+ pass
+#: N806
+def f():
+ try:
+ f()
+ except mod.Timeout, mod.ConnectionError:
+ pass
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pep8-naming-0.8.2/testsuite/N807.py
new/pep8-naming-0.9.1/testsuite/N807.py
--- old/pep8-naming-0.8.2/testsuite/N807.py 2019-02-04 21:48:45.000000000
+0100
+++ new/pep8-naming-0.9.1/testsuite/N807.py 2019-02-20 16:48:05.000000000
+0100
@@ -21,20 +21,31 @@
break
except:
pass
-#: N807
+#: Okay
+def _bad():
+ pass
+#: Okay
def __bad():
pass
-#: N807:1:5
+#: Okay
+def bad_():
+ pass
+#: Okay
def bad__():
pass
#: N807
def __bad__():
pass
-#: N807
+#: Okay
class ClassName(object):
def method(self):
def __bad():
pass
+#: N807
+class ClassName(object):
+ def method(self):
+ def __bad__():
+ pass
#: Okay(--ignore-names=__bad)
def __bad():
pass
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pep8-naming-0.8.2/testsuite/N807_py3.py
new/pep8-naming-0.9.1/testsuite/N807_py3.py
--- old/pep8-naming-0.8.2/testsuite/N807_py3.py 2019-02-01 21:39:10.000000000
+0100
+++ new/pep8-naming-0.9.1/testsuite/N807_py3.py 2019-02-20 16:48:05.000000000
+0100
@@ -3,11 +3,17 @@
class C:
def γ(self):
pass
-#: N807
+#: Okay
def __β(self):
pass
+#: Okay
+def β__(self):
+ pass
+#: N807
+def __β__(self):
+ pass
#: N807
-def __β6(self):
+def __β6__(self):
pass
#: Okay
class C:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pep8-naming-0.8.2/testsuite/N807_py35.py
new/pep8-naming-0.9.1/testsuite/N807_py35.py
--- old/pep8-naming-0.8.2/testsuite/N807_py35.py 2019-02-01
21:39:10.000000000 +0100
+++ new/pep8-naming-0.9.1/testsuite/N807_py35.py 2019-02-20
16:48:05.000000000 +0100
@@ -3,6 +3,12 @@
class C:
async def γ(self):
pass
-#: N807
+#: Okay
async def __β(self):
pass
+#: Okay
+async def β__(self):
+ pass
+#: N807
+async def __β__(self):
+ pass
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pep8-naming-0.8.2/testsuite/N80x.py
new/pep8-naming-0.9.1/testsuite/N80x.py
--- old/pep8-naming-0.8.2/testsuite/N80x.py 1970-01-01 01:00:00.000000000
+0100
+++ new/pep8-naming-0.9.1/testsuite/N80x.py 2019-11-13 18:58:40.000000000
+0100
@@ -0,0 +1,8 @@
+#: N802:2:5
+@foo
+def fn_with_decorator_Error():
+ pass
+#: N801:2:7
+@foo
+class class_with_decorator_Error:
+ pass