Hello community, here is the log from the commit of package python-pep8-naming for openSUSE:Factory checked in at 2019-03-01 16:48:09 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-pep8-naming (Old) and /work/SRC/openSUSE:Factory/.python-pep8-naming.new.28833 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pep8-naming" Fri Mar 1 16:48:09 2019 rev:5 rq:680059 version:0.8.2 Changes: -------- --- /work/SRC/openSUSE:Factory/python-pep8-naming/python-pep8-naming.changes 2019-02-02 22:24:55.242092197 +0100 +++ /work/SRC/openSUSE:Factory/.python-pep8-naming.new.28833/python-pep8-naming.changes 2019-03-01 16:48:12.977781126 +0100 @@ -1,0 +2,11 @@ +Thu Feb 28 09:13:05 UTC 2019 - Tomáš Chvátal <[email protected]> + +- Update to 0.8.2: + * Fix a problem with ignore-names option initialization. + * ignore-names now also applies to the N806, N815, and N816 checks. + * failureException, longMessage, and maxDiff have been added to the default ignore-names list. + * Allow lowercase names to be imported as just _. + * Allow function arguments to be named just _. + * Support Python 2's tuple syntax in except clauses. + +------------------------------------------------------------------- Old: ---- pep8-naming-0.8.0.tar.gz New: ---- pep8-naming-0.8.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-pep8-naming.spec ++++++ --- /var/tmp/diff_new_pack.G1bSzs/_old 2019-03-01 16:48:13.641780876 +0100 +++ /var/tmp/diff_new_pack.G1bSzs/_new 2019-03-01 16:48:13.641780876 +0100 @@ -18,7 +18,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-pep8-naming -Version: 0.8.0 +Version: 0.8.2 Release: 0 Summary: Flake8 plugin for checking PEP-8 naming conventions License: MIT ++++++ pep8-naming-0.8.0.tar.gz -> pep8-naming-0.8.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pep8-naming-0.8.0/CHANGELOG.rst new/pep8-naming-0.8.2/CHANGELOG.rst --- old/pep8-naming-0.8.0/CHANGELOG.rst 2019-01-28 16:46:14.000000000 +0100 +++ new/pep8-naming-0.8.2/CHANGELOG.rst 2019-02-04 21:48:45.000000000 +0100 @@ -1,6 +1,25 @@ Changes ======= +0.8.2 - 2019-02-04 +------------------ + +* Fix a problem with ``ignore-names`` option initialization. + +0.8.1 - 2019-02-04 +------------------ + +* ``ignore-names`` now also applies to the N806, N815, and N816 checks. + +* ``failureException``, ``longMessage``, and ``maxDiff`` have been added to + the default ``ignore-names`` list. + +* Allow lowercase names to be imported as just ``_``. + +* Allow function arguments to be named just ``_``. + +* Support Python 2's tuple syntax in ``except`` clauses. + 0.8.0 - 2019-01-28 ------------------ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pep8-naming-0.8.0/PKG-INFO new/pep8-naming-0.8.2/PKG-INFO --- old/pep8-naming-0.8.0/PKG-INFO 2019-01-28 16:49:34.000000000 +0100 +++ new/pep8-naming-0.8.2/PKG-INFO 2019-02-04 21:49:41.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: pep8-naming -Version: 0.8.0 +Version: 0.8.2 Summary: Check PEP-8 naming conventions, plugin for flake8 Home-page: https://github.com/PyCQA/pep8-naming Author: Florent Xicluna @@ -80,9 +80,9 @@ --ignore-names Ignore errors for specific variable names. - Currently, this option can only be used for N802 errors (`#43 <https://github.com/PyCQA/pep8-naming/issues/43>`_). + Currently, this option can only be used for N802, N806, N815, and N816 errors. - Default: ``setUp,tearDown,setUpClass,tearDownClass,setUpTestData``. + Default: ``setUp,tearDown,setUpClass,tearDownClass,setUpTestData,failureException,longMessage,maxDiff``. --classmethod-decorators List of method decorators pep8-naming plugin should consider class method. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pep8-naming-0.8.0/README.rst new/pep8-naming-0.8.2/README.rst --- old/pep8-naming-0.8.0/README.rst 2018-08-14 17:57:14.000000000 +0200 +++ new/pep8-naming-0.8.2/README.rst 2019-02-01 21:39:10.000000000 +0100 @@ -72,9 +72,9 @@ --ignore-names Ignore errors for specific variable names. - Currently, this option can only be used for N802 errors (`#43 <https://github.com/PyCQA/pep8-naming/issues/43>`_). + Currently, this option can only be used for N802, N806, N815, and N816 errors. - Default: ``setUp,tearDown,setUpClass,tearDownClass,setUpTestData``. + Default: ``setUp,tearDown,setUpClass,tearDownClass,setUpTestData,failureException,longMessage,maxDiff``. --classmethod-decorators List of method decorators pep8-naming plugin should consider class method. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pep8-naming-0.8.0/src/pep8_naming.egg-info/PKG-INFO new/pep8-naming-0.8.2/src/pep8_naming.egg-info/PKG-INFO --- old/pep8-naming-0.8.0/src/pep8_naming.egg-info/PKG-INFO 2019-01-28 16:49:34.000000000 +0100 +++ new/pep8-naming-0.8.2/src/pep8_naming.egg-info/PKG-INFO 2019-02-04 21:49:41.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: pep8-naming -Version: 0.8.0 +Version: 0.8.2 Summary: Check PEP-8 naming conventions, plugin for flake8 Home-page: https://github.com/PyCQA/pep8-naming Author: Florent Xicluna @@ -80,9 +80,9 @@ --ignore-names Ignore errors for specific variable names. - Currently, this option can only be used for N802 errors (`#43 <https://github.com/PyCQA/pep8-naming/issues/43>`_). + Currently, this option can only be used for N802, N806, N815, and N816 errors. - Default: ``setUp,tearDown,setUpClass,tearDownClass,setUpTestData``. + Default: ``setUp,tearDown,setUpClass,tearDownClass,setUpTestData,failureException,longMessage,maxDiff``. --classmethod-decorators List of method decorators pep8-naming plugin should consider class method. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pep8-naming-0.8.0/src/pep8_naming.egg-info/SOURCES.txt new/pep8-naming-0.8.2/src/pep8_naming.egg-info/SOURCES.txt --- old/pep8-naming-0.8.0/src/pep8_naming.egg-info/SOURCES.txt 2019-01-28 16:49:34.000000000 +0100 +++ new/pep8-naming-0.8.2/src/pep8_naming.egg-info/SOURCES.txt 2019-02-04 21:49:41.000000000 +0100 @@ -27,6 +27,7 @@ testsuite/N805.py testsuite/N805_py35.py testsuite/N806.py +testsuite/N806_py2.py testsuite/N806_py3.py testsuite/N806_py35.py testsuite/N807.py diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pep8-naming-0.8.0/src/pep8ext_naming.py new/pep8-naming-0.8.2/src/pep8ext_naming.py --- old/pep8-naming-0.8.0/src/pep8ext_naming.py 2019-01-28 16:46:14.000000000 +0100 +++ new/pep8-naming-0.8.2/src/pep8ext_naming.py 2019-02-04 21:48:45.000000000 +0100 @@ -12,7 +12,7 @@ except ImportError: from flake8.util import ast, iter_child_nodes -__version__ = '0.8.0' +__version__ = '0.8.2' PYTHON_VERSION = sys.version_info[:3] PY2 = PYTHON_VERSION[0] == 2 @@ -83,6 +83,15 @@ METHOD = 'method' +_default_ignore_names = [ + 'setUp', + 'tearDown', + 'setUpClass', + 'tearDownClass', + 'setUpTestData', + 'failureException', + 'longMessage', + 'maxDiff'] _default_classmethod_decorators = ['classmethod'] _default_staticmethod_decorators = ['staticmethod'] @@ -100,9 +109,9 @@ """Checker of PEP-8 Naming Conventions.""" name = 'naming' version = __version__ - ignore_names = ['setUp', 'tearDown', 'setUpClass', 'tearDownClass', 'setUpTestData'] decorator_to_type = _build_decorator_to_type( _default_classmethod_decorators, _default_staticmethod_decorators) + ignore_names = frozenset(_default_ignore_names) def __init__(self, tree, filename): self.visitors = BaseASTCheck._checks @@ -112,7 +121,7 @@ @classmethod def add_options(cls, parser): options.register(parser, '--ignore-names', - default=cls.ignore_names, + default=_default_ignore_names, action='store', type='string', parse_from_config=True, @@ -142,7 +151,7 @@ @classmethod def parse_options(cls, options): - cls.ignore_names = options.ignore_names + cls.ignore_names = frozenset(options.ignore_names) cls.decorator_to_type = _build_decorator_to_type( options.classmethod_decorators, options.staticmethod_decorators) @@ -271,9 +280,10 @@ return if name in ('__dir__', '__getattr__'): return - if not name.islower() and name != '_': + if name.lower() != name: yield self.err(node, 'N802', name=name) - if function_type == 'function' and '__' in (name[:2], name[-2:]): + if (function_type == _FunctionType.FUNCTION + and '__' in (name[:2], name[-2:])): yield self.err(node, 'N807', name=name) visit_asyncfunctiondef = visit_functiondef @@ -300,17 +310,15 @@ return node, arg for arg, name in arg_name(node.args.vararg), arg_name(node.args.kwarg): - if name is not None: - if not name.islower(): - yield self.err(arg, 'N803', name=name) - return - + if name is not None and name.lower() != name: + yield self.err(arg, 'N803', name=name) + return arg_name_tuples = get_arg_name_tuples(node) if not arg_name_tuples: return arg0, name0 = arg_name_tuples[0] - function_type = getattr(node, 'function_type', 'function') + function_type = getattr(node, 'function_type', _FunctionType.FUNCTION) if function_type == _FunctionType.METHOD: if name0 != 'self': @@ -319,7 +327,7 @@ if name0 != 'cls': yield self.err(arg0, 'N804') for arg, name in arg_name_tuples: - if not name.islower(): + if name.lower() != name: yield self.err(arg, 'N803', name=name) return @@ -346,7 +354,7 @@ if not asname.isupper(): yield self.err(node, 'N811', **err_kwargs) elif original_name.islower(): - if not asname.islower(): + if asname.lower() != asname: yield self.err(node, 'N812', **err_kwargs) elif asname.islower(): yield self.err(node, 'N813', **err_kwargs) @@ -358,13 +366,13 @@ class VariablesCheck(BaseASTCheck): """ - Local variables in functions should be lowercase + Class attributes and local variables in functions should be lowercase """ N806 = "variable '{name}' in function should be lowercase" N815 = "variable '{name}' in class scope should not be mixedCase" N816 = "variable '{name}' in global scope should not be mixedCase" - def _find_errors(self, assignment_target, parents): + def _find_errors(self, assignment_target, parents, ignore): for parent_func in reversed(parents): if isinstance(parent_func, ast.ClassDef): checker = self.class_variable_check @@ -375,6 +383,8 @@ else: checker = self.global_variable_check for name in _extract_names(assignment_target): + if name in ignore: + continue error_code = checker(name) if error_code: yield self.err(assignment_target, error_code, name=name) @@ -388,34 +398,36 @@ if node.value.func.id == 'namedtuple': return for target in node.targets: - for error in self._find_errors(target, parents): + for error in self._find_errors(target, parents, ignore): yield error def visit_with(self, node, parents, ignore): if PY2: - for error in self._find_errors(node.optional_vars, parents): + for error in self._find_errors( + node.optional_vars, parents, ignore): yield error return for item in node.items: - for error in self._find_errors(item.optional_vars, parents): + for error in self._find_errors( + item.optional_vars, parents, ignore): yield error visit_asyncwith = visit_with def visit_for(self, node, parents, ignore): - for error in self._find_errors(node.target, parents): + for error in self._find_errors(node.target, parents, ignore): yield error visit_asyncfor = visit_for def visit_excepthandler(self, node, parents, ignore): if node.name: - for error in self._find_errors(node, parents): + for error in self._find_errors(node, parents, ignore): yield error def visit_generatorexp(self, node, parents, ignore): for gen in node.generators: - for error in self._find_errors(gen.target, parents): + for error in self._find_errors(gen.target, parents, ignore): yield error visit_listcomp = visit_dictcomp = visit_setcomp = visit_generatorexp @@ -434,7 +446,7 @@ def function_variable_check(func, var_name): if var_name in func.global_names: return None - if var_name.islower() or var_name == '_': + if var_name.lower() == var_name: return None return 'N806' @@ -444,8 +456,7 @@ target_type = type(assignment_target) if target_type is ast.Name: yield assignment_target.id - return - if target_type in (ast.Tuple, ast.List): + elif target_type in (ast.Tuple, ast.List): for element in assignment_target.elts: element_type = type(element) if element_type is ast.Name: @@ -456,13 +467,16 @@ elif not PY2 and element_type is ast.Starred: # PEP 3132 for n in _extract_names(element.value): yield n - return - if target_type is ast.ExceptHandler: + elif target_type is ast.ExceptHandler: if PY2: - yield assignment_target.name.id + # Python 2 supports unpacking tuple exception values. + if isinstance(assignment_target.name, ast.Tuple): + for name in assignment_target.name.elts: + yield name.id + else: + yield assignment_target.name.id else: yield assignment_target.name - return def is_mixed_case(name): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pep8-naming-0.8.0/testsuite/N801.py new/pep8-naming-0.8.2/testsuite/N801.py --- old/pep8-naming-0.8.0/testsuite/N801.py 2018-08-14 17:57:14.000000000 +0200 +++ new/pep8-naming-0.8.2/testsuite/N801.py 2019-02-04 21:48:45.000000000 +0100 @@ -1,6 +1,9 @@ #: N801 class notok(object): pass +#: Okay(--ignore-names=notok) +class notok(object): + pass #: N801 class Good(object): class notok(object): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pep8-naming-0.8.0/testsuite/N802.py new/pep8-naming-0.8.2/testsuite/N802.py --- old/pep8-naming-0.8.0/testsuite/N802.py 2018-08-14 17:57:14.000000000 +0200 +++ new/pep8-naming-0.8.2/testsuite/N802.py 2019-02-04 21:48:45.000000000 +0100 @@ -19,6 +19,9 @@ #: N802:1:5 def NotOK(): pass +#: Okay(--ignore-names=NotOK) +def NotOK(): + pass #: Okay def _(): pass @@ -38,6 +41,10 @@ class ClassName(object): def notOk(self): pass +#: Okay(--ignore-names=notOk) +class ClassName(object): + def notOk(self): + pass #: Okay def setUp(): pass diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pep8-naming-0.8.0/testsuite/N803.py new/pep8-naming-0.8.2/testsuite/N803.py --- old/pep8-naming-0.8.0/testsuite/N803.py 2018-08-14 17:57:14.000000000 +0200 +++ new/pep8-naming-0.8.2/testsuite/N803.py 2019-01-29 16:36:12.000000000 +0100 @@ -40,6 +40,21 @@ #: N803:1:9 def b14(BAD): pass +#: Okay +def b15(_): + pass +#: Okay +def b16(_a): + pass +#: Okay +def b17(a, _): + pass +#: Okay +def b18(a, *_): + pass +#: Okay +def b19(a, **_): + pass #: N803:2:24 class Test(object): def __init__(self, BAD): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pep8-naming-0.8.0/testsuite/N806.py new/pep8-naming-0.8.2/testsuite/N806.py --- old/pep8-naming-0.8.0/testsuite/N806.py 2019-01-24 19:23:43.000000000 +0100 +++ new/pep8-naming-0.8.2/testsuite/N806.py 2019-02-04 21:48:45.000000000 +0100 @@ -22,6 +22,9 @@ class Foo(object): def test3(self): Bad = 3 +#: Okay(--ignore-names=Bad) +def test(): + Bad = 1 #: Okay def good(): global Bad diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pep8-naming-0.8.0/testsuite/N806_py2.py new/pep8-naming-0.8.2/testsuite/N806_py2.py --- old/pep8-naming-0.8.0/testsuite/N806_py2.py 1970-01-01 01:00:00.000000000 +0100 +++ new/pep8-naming-0.8.2/testsuite/N806_py2.py 2019-01-29 20:19:40.000000000 +0100 @@ -0,0 +1,13 @@ +# python_version < '3' +#: Okay +def f(): + try: + f() + except (A, B) as (a, b): + pass +#: N806 +def f(): + try: + f() + except (A, B) as (good, BAD): + pass diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pep8-naming-0.8.0/testsuite/N807.py new/pep8-naming-0.8.2/testsuite/N807.py --- old/pep8-naming-0.8.0/testsuite/N807.py 2018-09-07 17:05:25.000000000 +0200 +++ new/pep8-naming-0.8.2/testsuite/N807.py 2019-02-04 21:48:45.000000000 +0100 @@ -35,6 +35,9 @@ def method(self): def __bad(): pass +#: Okay(--ignore-names=__bad) +def __bad(): + pass #: Okay def __dir__(): pass diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pep8-naming-0.8.0/testsuite/N815.py new/pep8-naming-0.8.2/testsuite/N815.py --- old/pep8-naming-0.8.0/testsuite/N815.py 2018-08-14 17:57:14.000000000 +0200 +++ new/pep8-naming-0.8.2/testsuite/N815.py 2019-02-04 21:48:45.000000000 +0100 @@ -10,9 +10,15 @@ #: Okay class C: _1 = 0 +#: Okay +class C: + maxDiff = None #: N815:2:5 class C: mixedCase = 0 #: N815 class C: mixed_Case = 0 +#: Okay(--ignore-names=mixed_Case) +class C: + mixed_Case = 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pep8-naming-0.8.0/testsuite/N816.py new/pep8-naming-0.8.2/testsuite/N816.py --- old/pep8-naming-0.8.0/testsuite/N816.py 2018-08-14 17:57:14.000000000 +0200 +++ new/pep8-naming-0.8.2/testsuite/N816.py 2019-02-04 21:48:45.000000000 +0100 @@ -18,3 +18,5 @@ C6 = 0 #: Okay C_6 = 0. +#: Okay(--ignore-names=mixedCase) +mixedCase = 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pep8-naming-0.8.0/testsuite/N81x.py new/pep8-naming-0.8.2/testsuite/N81x.py --- old/pep8-naming-0.8.0/testsuite/N81x.py 2019-01-24 19:23:43.000000000 +0100 +++ new/pep8-naming-0.8.2/testsuite/N81x.py 2019-01-28 20:09:31.000000000 +0100 @@ -5,6 +5,8 @@ #: Okay import good as good #: Okay +import underscore as _ +#: Okay from mod import good as nice, NICE as GOOD, Camel as Memel #: N811:1:1 from mod import GOOD as bad
