Hello community,

here is the log from the commit of package python-flake8-bugbear for 
openSUSE:Factory checked in at 2019-09-17 13:36:02
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-flake8-bugbear (Old)
 and      /work/SRC/openSUSE:Factory/.python-flake8-bugbear.new.7948 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-flake8-bugbear"

Tue Sep 17 13:36:02 2019 rev:5 rq:730552 version:19.8.0

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/python-flake8-bugbear/python-flake8-bugbear.changes  
    2019-04-02 09:23:04.304740769 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-flake8-bugbear.new.7948/python-flake8-bugbear.changes
    2019-09-17 13:36:07.109855206 +0200
@@ -1,0 +2,8 @@
+Fri Sep 13 07:31:10 UTC 2019 - Tomáš Chvátal <[email protected]>
+
+- Update to 19.8.0:
+  * Fix .travis.yml syntax + add Python 3.8 + nightly tests
+  * Fix black formatting + enforce via CI
+  * Make B901 not apply to __await__ methods
+
+-------------------------------------------------------------------

Old:
----
  flake8-bugbear-19.3.0.tar.gz

New:
----
  flake8-bugbear-19.8.0.tar.gz

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

Other differences:
------------------
++++++ python-flake8-bugbear.spec ++++++
--- /var/tmp/diff_new_pack.cSzom3/_old  2019-09-17 13:36:07.625855123 +0200
+++ /var/tmp/diff_new_pack.cSzom3/_new  2019-09-17 13:36:07.625855123 +0200
@@ -19,7 +19,7 @@
 %define skip_python2 1
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:           python-flake8-bugbear
-Version:        19.3.0
+Version:        19.8.0
 Release:        0
 Summary:        A plugin for flake8 finding likely bugs and design problems in 
your program
 License:        MIT
@@ -27,8 +27,8 @@
 URL:            https://github.com/PyCQA/flake8-bugbear
 Source:         
https://files.pythonhosted.org/packages/source/f/flake8-bugbear/flake8-bugbear-%{version}.tar.gz
 BuildRequires:  %{python_module attrs}
-BuildRequires:  %{python_module base}
 BuildRequires:  %{python_module flake8 >= 3.0.0}
+BuildRequires:  %{python_module pytest}
 BuildRequires:  %{python_module setuptools}
 BuildRequires:  fdupes
 BuildRequires:  python-rpm-macros
@@ -51,7 +51,8 @@
 %python_expand %fdupes %{buildroot}%{$python_sitelib}
 
 %check
-%python_exec setup.py test
+# https://github.com/PyCQA/flake8-bugbear/issues/89
+%pytest -k 'not test_selfclean_bugbear'
 
 %files %{python_files}
 %license LICENSE

++++++ flake8-bugbear-19.3.0.tar.gz -> flake8-bugbear-19.8.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/flake8-bugbear-19.3.0/PKG-INFO 
new/flake8-bugbear-19.8.0/PKG-INFO
--- old/flake8-bugbear-19.3.0/PKG-INFO  2019-03-28 18:09:59.000000000 +0100
+++ new/flake8-bugbear-19.8.0/PKG-INFO  2019-08-12 06:20:22.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.2
 Name: flake8-bugbear
-Version: 19.3.0
+Version: 19.8.0
 Summary: A plugin for flake8 finding likely bugs and design problems in your 
program. Contains warnings that don't belong in pyflakes and pycodestyle.
 Home-page: https://github.com/PyCQA/flake8-bugbear
 Author: Łukasz Langa
@@ -14,7 +14,7 @@
             :target: https://travis-ci.org/PyCQA/flake8-bugbear
         
         .. image:: https://img.shields.io/badge/code%20style-black-000000.svg
-            :target: https://github.com/ambv/black
+            :target: https://github.com/psf/black
         
         A plugin for Flake8 finding likely bugs and design problems in your
         program.  Contains warnings that don't belong in pyflakes and
@@ -75,18 +75,19 @@
         character set to a constant if this is deliberate. Use
         ``.replace()`` or regular expressions to remove string fragments.
         
-        **B006**: Do not use mutable data structures for argument defaults.  
All
-        calls reuse one instance of that data structure, persisting changes
+        **B006**: Do not use mutable data structures for argument defaults.  
They
+        are created during function definition time. All calls to the function
+        reuse this one instance of that data structure, persisting changes
         between them.
         
         **B007**: Loop control variable not used within the loop body.  If 
this is
         intended, start the name with an underscore.
         
-        **B008**: Do not perform calls in argument defaults.  The call is
-        performed only once at function definition time.  All calls to your
-        function will reuse the result of that definition-time call.  If this 
is
-        intended, assign the function call to a module-level variable and use
-        that variable as a default value.
+        **B008**: Do not perform function calls in argument defaults.  The 
call is
+        performed only once at function definition time. All calls to your
+        function will reuse the result of that definition-time function call.  
If
+        this is intended, assign the function call to a module-level variable 
and
+        use that variable as a default value.
         
         **B009**: Do not call ``getattr(x, 'attr')``, instead use normal
         property access: ``x.attr``. Missing a default to ``getattr`` will 
cause
@@ -157,8 +158,8 @@
         ``return x`` usage with ``# noqa`` on the same line.
         
         **B902**: Invalid first argument used for method. Use ``self`` for
-        instance methods, and `cls` for class methods (which includes `__new__`
-        and `__init_subclass__`) or instance methods of metaclasses (detected 
as
+        instance methods, and ``cls`` for class methods (which includes 
``__new__``
+        and ``__init_subclass__``) or instance methods of metaclasses 
(detected as
         classes directly inheriting from ``type``).
         
         **B903**: Use ``collections.namedtuple`` (or ``typing.NamedTuple``) for
@@ -244,6 +245,13 @@
         Change Log
         ----------
         
+        19.8.0
+        ~~~~~~
+        
+        * Fix .travis.yml syntax + add Python 3.8 + nightly tests
+        * Fix `black` formatting + enforce via CI
+        * Make B901 not apply to __await__ methods
+        
         19.3.0
         ~~~~~~
         
@@ -402,7 +410,7 @@
         Glued together by `Łukasz Langa <mailto:[email protected]>`_. Multiple
         improvements by `Markus Unterwaditzer 
<mailto:[email protected]>`_,
         `Martijn Pieters <mailto:[email protected]>`_,
-        `Cooper Lees <mailto:[email protected]>`_, and `Ryan May 
<mailto:[email protected]>`.
+        `Cooper Lees <mailto:[email protected]>`_, and `Ryan May 
<mailto:[email protected]>`_.
         
 Keywords: flake8 bugbear bugs pyflakes pylint linter qa
 Platform: UNKNOWN
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/flake8-bugbear-19.3.0/README.rst 
new/flake8-bugbear-19.8.0/README.rst
--- old/flake8-bugbear-19.3.0/README.rst        2019-03-28 18:08:51.000000000 
+0100
+++ new/flake8-bugbear-19.8.0/README.rst        2019-08-12 06:18:59.000000000 
+0200
@@ -6,7 +6,7 @@
     :target: https://travis-ci.org/PyCQA/flake8-bugbear
 
 .. image:: https://img.shields.io/badge/code%20style-black-000000.svg
-    :target: https://github.com/ambv/black
+    :target: https://github.com/psf/black
 
 A plugin for Flake8 finding likely bugs and design problems in your
 program.  Contains warnings that don't belong in pyflakes and
@@ -67,18 +67,19 @@
 character set to a constant if this is deliberate. Use
 ``.replace()`` or regular expressions to remove string fragments.
 
-**B006**: Do not use mutable data structures for argument defaults.  All
-calls reuse one instance of that data structure, persisting changes
+**B006**: Do not use mutable data structures for argument defaults.  They
+are created during function definition time. All calls to the function
+reuse this one instance of that data structure, persisting changes
 between them.
 
 **B007**: Loop control variable not used within the loop body.  If this is
 intended, start the name with an underscore.
 
-**B008**: Do not perform calls in argument defaults.  The call is
-performed only once at function definition time.  All calls to your
-function will reuse the result of that definition-time call.  If this is
-intended, assign the function call to a module-level variable and use
-that variable as a default value.
+**B008**: Do not perform function calls in argument defaults.  The call is
+performed only once at function definition time. All calls to your
+function will reuse the result of that definition-time function call.  If
+this is intended, assign the function call to a module-level variable and
+use that variable as a default value.
 
 **B009**: Do not call ``getattr(x, 'attr')``, instead use normal
 property access: ``x.attr``. Missing a default to ``getattr`` will cause
@@ -149,8 +150,8 @@
 ``return x`` usage with ``# noqa`` on the same line.
 
 **B902**: Invalid first argument used for method. Use ``self`` for
-instance methods, and `cls` for class methods (which includes `__new__`
-and `__init_subclass__`) or instance methods of metaclasses (detected as
+instance methods, and ``cls`` for class methods (which includes ``__new__``
+and ``__init_subclass__``) or instance methods of metaclasses (detected as
 classes directly inheriting from ``type``).
 
 **B903**: Use ``collections.namedtuple`` (or ``typing.NamedTuple``) for
@@ -236,6 +237,13 @@
 Change Log
 ----------
 
+19.8.0
+~~~~~~
+
+* Fix .travis.yml syntax + add Python 3.8 + nightly tests
+* Fix `black` formatting + enforce via CI
+* Make B901 not apply to __await__ methods
+
 19.3.0
 ~~~~~~
 
@@ -394,4 +402,4 @@
 Glued together by `Łukasz Langa <mailto:[email protected]>`_. Multiple
 improvements by `Markus Unterwaditzer <mailto:[email protected]>`_,
 `Martijn Pieters <mailto:[email protected]>`_,
-`Cooper Lees <mailto:[email protected]>`_, and `Ryan May 
<mailto:[email protected]>`.
+`Cooper Lees <mailto:[email protected]>`_, and `Ryan May 
<mailto:[email protected]>`_.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/flake8-bugbear-19.3.0/bugbear.py 
new/flake8-bugbear-19.8.0/bugbear.py
--- old/flake8-bugbear-19.3.0/bugbear.py        2019-03-28 18:08:51.000000000 
+0100
+++ new/flake8-bugbear-19.8.0/bugbear.py        2019-08-12 06:18:59.000000000 
+0200
@@ -9,7 +9,7 @@
 import pycodestyle
 
 
-__version__ = "19.3.0"
+__version__ = "19.8.0"
 
 LOG = logging.getLogger("flake8.bugbear")
 
@@ -130,7 +130,7 @@
     def visit(self, node):
         self.node_stack.append(node)
         self.node_window.append(node)
-        self.node_window = self.node_window[-self.NODE_WINDOW_SIZE:]
+        self.node_window = self.node_window[-self.NODE_WINDOW_SIZE :]
         super().visit(node)
         self.node_stack.pop()
 
@@ -281,23 +281,36 @@
             self.errors.append(B011(node.lineno, node.col_offset))
 
     def check_for_b901(self, node):
-        xs = list(node.body)
+        if node.name == "__await__":
+            return
+
+        xs = [(None, x) for x in node.body]
+
         has_yield = False
         return_node = None
+
         while xs:
-            x = xs.pop()
+            parent, x = xs.pop()
             if isinstance(x, (ast.AsyncFunctionDef, ast.FunctionDef)):
+                # Do not recurse into inner functions (`def` in
+                # `def`).
                 continue
-            elif isinstance(x, (ast.Yield, ast.YieldFrom)):
+
+            # Only consider yield when it is part of an Expr statement.
+            if isinstance(parent, ast.Expr) and isinstance(
+                x, (ast.Yield, ast.YieldFrom)
+            ):
                 has_yield = True
-            elif isinstance(x, ast.Return) and x.value is not None:
+
+            if isinstance(x, ast.Return) and x.value is not None:
                 return_node = x
 
             if has_yield and return_node is not None:
                 self.errors.append(B901(return_node.lineno, 
return_node.col_offset))
                 break
 
-            xs.extend(ast.iter_child_nodes(x))
+            for x2 in ast.iter_child_nodes(x):
+                xs.append((x, x2))
 
     def check_for_b902(self, node):
         if not isinstance(self.node_stack[-2], ast.ClassDef):
@@ -460,9 +473,10 @@
 B005.valid_paths = {}
 
 B006 = Error(
-    message="B006 Do not use mutable data structures for argument defaults. "
-    "All calls reuse one instance of that data structure, persisting "
-    "changes between them."
+    message="B006 Do not use mutable data structures for argument defaults.  
They "
+    "are created during function definition time. All calls to the function "
+    "reuse this one instance of that data structure, persisting changes "
+    "between them."
 )
 B006.mutable_literals = (ast.Dict, ast.List, ast.Set)
 B006.mutable_calls = {
@@ -483,16 +497,13 @@
     "If this is intended, start the name with an underscore."
 )
 B008 = Error(
-    message="B008 Do not perform calls in argument defaults. The call is "
+    message="B008: Do not perform function calls in argument defaults.  The 
call is "
     "performed only once at function definition time. All calls to your "
-    "function will reuse the result of that definition-time call. If "
-    "this is intended, assign the function call to a module-level "
-    "variable and use that variable as a default value."
-)
-B008.immutable_calls = {
-    'tuple',
-    'frozenset',
-}
+    "function will reuse the result of that definition-time function call.  If 
"
+    "this is intended, assign the function call to a module-level variable and 
"
+    "use that variable as a default value."
+)
+B008.immutable_calls = {"tuple", "frozenset"}
 B009 = Error(
     message="B009 Do not call getattr with a constant attribute value, "
     "it is not any safer than normal property access."
@@ -503,7 +514,7 @@
 )
 B011 = Error(
     message="B011 Do not call assert False since python -O removes these 
calls. "
-            "Instead callers should raise AssertionError()."
+    "Instead callers should raise AssertionError()."
 )
 
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/flake8-bugbear-19.3.0/flake8_bugbear.egg-info/PKG-INFO 
new/flake8-bugbear-19.8.0/flake8_bugbear.egg-info/PKG-INFO
--- old/flake8-bugbear-19.3.0/flake8_bugbear.egg-info/PKG-INFO  2019-03-28 
18:09:59.000000000 +0100
+++ new/flake8-bugbear-19.8.0/flake8_bugbear.egg-info/PKG-INFO  2019-08-12 
06:20:22.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.2
 Name: flake8-bugbear
-Version: 19.3.0
+Version: 19.8.0
 Summary: A plugin for flake8 finding likely bugs and design problems in your 
program. Contains warnings that don't belong in pyflakes and pycodestyle.
 Home-page: https://github.com/PyCQA/flake8-bugbear
 Author: Łukasz Langa
@@ -14,7 +14,7 @@
             :target: https://travis-ci.org/PyCQA/flake8-bugbear
         
         .. image:: https://img.shields.io/badge/code%20style-black-000000.svg
-            :target: https://github.com/ambv/black
+            :target: https://github.com/psf/black
         
         A plugin for Flake8 finding likely bugs and design problems in your
         program.  Contains warnings that don't belong in pyflakes and
@@ -75,18 +75,19 @@
         character set to a constant if this is deliberate. Use
         ``.replace()`` or regular expressions to remove string fragments.
         
-        **B006**: Do not use mutable data structures for argument defaults.  
All
-        calls reuse one instance of that data structure, persisting changes
+        **B006**: Do not use mutable data structures for argument defaults.  
They
+        are created during function definition time. All calls to the function
+        reuse this one instance of that data structure, persisting changes
         between them.
         
         **B007**: Loop control variable not used within the loop body.  If 
this is
         intended, start the name with an underscore.
         
-        **B008**: Do not perform calls in argument defaults.  The call is
-        performed only once at function definition time.  All calls to your
-        function will reuse the result of that definition-time call.  If this 
is
-        intended, assign the function call to a module-level variable and use
-        that variable as a default value.
+        **B008**: Do not perform function calls in argument defaults.  The 
call is
+        performed only once at function definition time. All calls to your
+        function will reuse the result of that definition-time function call.  
If
+        this is intended, assign the function call to a module-level variable 
and
+        use that variable as a default value.
         
         **B009**: Do not call ``getattr(x, 'attr')``, instead use normal
         property access: ``x.attr``. Missing a default to ``getattr`` will 
cause
@@ -157,8 +158,8 @@
         ``return x`` usage with ``# noqa`` on the same line.
         
         **B902**: Invalid first argument used for method. Use ``self`` for
-        instance methods, and `cls` for class methods (which includes `__new__`
-        and `__init_subclass__`) or instance methods of metaclasses (detected 
as
+        instance methods, and ``cls`` for class methods (which includes 
``__new__``
+        and ``__init_subclass__``) or instance methods of metaclasses 
(detected as
         classes directly inheriting from ``type``).
         
         **B903**: Use ``collections.namedtuple`` (or ``typing.NamedTuple``) for
@@ -244,6 +245,13 @@
         Change Log
         ----------
         
+        19.8.0
+        ~~~~~~
+        
+        * Fix .travis.yml syntax + add Python 3.8 + nightly tests
+        * Fix `black` formatting + enforce via CI
+        * Make B901 not apply to __await__ methods
+        
         19.3.0
         ~~~~~~
         
@@ -402,7 +410,7 @@
         Glued together by `Łukasz Langa <mailto:[email protected]>`_. Multiple
         improvements by `Markus Unterwaditzer 
<mailto:[email protected]>`_,
         `Martijn Pieters <mailto:[email protected]>`_,
-        `Cooper Lees <mailto:[email protected]>`_, and `Ryan May 
<mailto:[email protected]>`.
+        `Cooper Lees <mailto:[email protected]>`_, and `Ryan May 
<mailto:[email protected]>`_.
         
 Keywords: flake8 bugbear bugs pyflakes pylint linter qa
 Platform: UNKNOWN
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/flake8-bugbear-19.3.0/tests/b006_b008.py 
new/flake8-bugbear-19.8.0/tests/b006_b008.py
--- old/flake8-bugbear-19.3.0/tests/b006_b008.py        2019-03-27 
01:53:19.000000000 +0100
+++ new/flake8-bugbear-19.8.0/tests/b006_b008.py        2019-08-05 
17:36:44.000000000 +0200
@@ -47,8 +47,10 @@
     # That makes it more obvious that this one value is reused.
     ...
 
+
 def kwonlyargs_immutable(*, value=()):
     ...
 
+
 def kwonlyargs_mutable(*, value=[]):
     ...
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/flake8-bugbear-19.3.0/tests/b901.py 
new/flake8-bugbear-19.8.0/tests/b901.py
--- old/flake8-bugbear-19.3.0/tests/b901.py     2019-03-27 01:53:19.000000000 
+0100
+++ new/flake8-bugbear-19.8.0/tests/b901.py     2019-08-05 17:36:44.000000000 
+0200
@@ -55,3 +55,29 @@
         return 2
 
     yield inner()
+
+
+def not_broken6():
+    return (yield from [])
+
+
+def not_broken7():
+    x = (yield from [])
+    return x
+
+
+def not_broken8():
+    x = None
+
+    def inner(ex):
+        nonlocal x
+        x = ex
+
+    inner((yield from []))
+    return x
+
+
+class NotBroken9(object):
+    def __await__(self):
+        yield from function()
+        return 42
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/flake8-bugbear-19.3.0/tests/b902.py 
new/flake8-bugbear-19.8.0/tests/b902.py
--- old/flake8-bugbear-19.3.0/tests/b902.py     2019-03-27 01:53:19.000000000 
+0100
+++ new/flake8-bugbear-19.8.0/tests/b902.py     2019-08-05 17:36:44.000000000 
+0200
@@ -99,4 +99,4 @@
         ...
 
     def __class_getitem__(cls, key):
-        ...
\ No newline at end of file
+        ...
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/flake8-bugbear-19.3.0/tests/test_bugbear.py 
new/flake8-bugbear-19.8.0/tests/test_bugbear.py
--- old/flake8-bugbear-19.3.0/tests/test_bugbear.py     2019-03-27 
01:53:19.000000000 +0100
+++ new/flake8-bugbear-19.8.0/tests/test_bugbear.py     2019-08-12 
06:18:59.000000000 +0200
@@ -87,7 +87,7 @@
                 B006(26, 19),
                 B006(30, 31),
                 B008(39, 38),
-                B006(53, 32),
+                B006(55, 32),
             ),
         )
 
@@ -112,12 +112,11 @@
         self.assertEqual(errors, self.errors(B009(15, 0), B010(22, 0)))
 
     def test_b011(self):
-        filename = Path(__file__).absolute().parent / 'b011.py'
+        filename = Path(__file__).absolute().parent / "b011.py"
         bbc = BugBearChecker(filename=str(filename))
         errors = list(bbc.run())
         self.assertEqual(
-            errors,
-            self.errors(B011(8, 0, vars=('i',)), B011(10, 0, vars=('k',))),
+            errors, self.errors(B011(8, 0, vars=("i",)), B011(10, 0, 
vars=("k",)))
         )
 
     def test_b301_b302_b305(self):


Reply via email to