Hello community,

here is the log from the commit of package python-fissix for openSUSE:Factory 
checked in at 2020-10-25 18:08:48
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-fissix (Old)
 and      /work/SRC/openSUSE:Factory/.python-fissix.new.3463 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-fissix"

Sun Oct 25 18:08:48 2020 rev:3 rq:835550 version:20.8.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-fissix/python-fissix.changes      
2020-07-01 14:27:11.450859838 +0200
+++ /work/SRC/openSUSE:Factory/.python-fissix.new.3463/python-fissix.changes    
2020-10-25 18:08:51.163472066 +0100
@@ -1,0 +2,8 @@
+Fri Sep 18 15:33:11 UTC 2020 - John Vandenberg <jay...@gmail.com>
+
+- Activate test suite
+- Update to 20.8.0
+  *  include dict in iterating context 
+  *  Fixed reporting some unchanged files as needing modification
+
+-------------------------------------------------------------------

Old:
----
  fissix-20.5.1.tar.gz

New:
----
  fissix-20.8.0.tar.gz

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

Other differences:
------------------
++++++ python-fissix.spec ++++++
--- /var/tmp/diff_new_pack.vfgGuA/_old  2020-10-25 18:08:52.451473285 +0100
+++ /var/tmp/diff_new_pack.vfgGuA/_new  2020-10-25 18:08:52.455473289 +0100
@@ -19,7 +19,7 @@
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 %define skip_python2 1
 Name:           python-fissix
-Version:        20.5.1
+Version:        20.8.0
 Release:        0
 Summary:        Backport of lib2to3, with enhancements
 License:        Python-2.0
@@ -27,7 +27,9 @@
 Source:         
https://files.pythonhosted.org/packages/source/f/fissix/fissix-%{version}.tar.gz
 BuildRequires:  %{python_module appdirs}
 BuildRequires:  %{python_module base >= 3.6}
+BuildRequires:  %{python_module pytest >= 6.0.1}
 BuildRequires:  %{python_module setuptools}
+BuildRequires:  %{python_module testsuite}
 BuildRequires:  fdupes
 BuildRequires:  python-rpm-macros
 Requires:       python-appdirs
@@ -39,13 +41,19 @@
 
 %prep
 %setup -q -n fissix-%{version}
+sed -i '1{/^#!/d}' fissix/pgen2/token.py
 
 %build
 %python_build
 
 %install
 %python_install
-%python_expand %fdupes %{buildroot}%{$python_sitelib}
+%{python_expand rm -r %{buildroot}%{$python_sitelib}/fissix/tests/
+%fdupes %{buildroot}%{$python_sitelib}
+}
+
+%check
+%pytest
 
 %files %{python_files}
 %doc README.md

++++++ fissix-20.5.1.tar.gz -> fissix-20.8.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fissix-20.5.1/LICENSE new/fissix-20.8.0/LICENSE
--- old/fissix-20.5.1/LICENSE   2020-05-14 08:04:03.006515700 +0200
+++ new/fissix-20.8.0/LICENSE   2020-08-18 05:52:48.965715400 +0200
@@ -1,3 +1,9 @@
+Some Python files have been taken from the standard library and are therefore
+PSF licensed.  Modifications on these files are also PSF. These files are:
+
+- fissix/*
+
+
 A. HISTORY OF THE SOFTWARE
 ==========================
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fissix-20.5.1/PKG-INFO new/fissix-20.8.0/PKG-INFO
--- old/fissix-20.5.1/PKG-INFO  1970-01-01 01:00:00.000000000 +0100
+++ new/fissix-20.8.0/PKG-INFO  1970-01-01 01:00:00.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: fissix
-Version: 20.5.1
+Version: 20.8.0
 Summary: Monkeypatches to override default behavior of lib2to3.
 Home-page: https://github.com/jreese/fissix
 Author: John Reese
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fissix-20.5.1/README.md new/fissix-20.8.0/README.md
--- old/fissix-20.5.1/README.md 2020-05-14 08:04:03.006849000 +0200
+++ new/fissix-20.8.0/README.md 2020-08-18 05:52:48.966111200 +0200
@@ -17,3 +17,9 @@
 Because this is my personal repository, the license you receive to my code
 is from me and not from my employer.
 See the ``LICENSE`` file for details.
+
+Used by
+-------
+
+* https://pypi.org/project/bowler/ Safe code refactoring for modern Python 
projects
+* https://pypi.org/project/modernize/ A hack on top of fissix for modernizing 
code for hybrid codebases.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fissix-20.5.1/fissix/__init__.py 
new/fissix-20.8.0/fissix/__init__.py
--- old/fissix-20.5.1/fissix/__init__.py        2020-05-14 12:14:10.565221000 
+0200
+++ new/fissix-20.8.0/fissix/__init__.py        2020-08-18 06:00:39.197056800 
+0200
@@ -15,7 +15,7 @@
 
 from .pgen2 import driver, grammar, pgen
 
-__version__ = "20.5.1"
+__version__ = "20.8.0"
 __base_version__ = "3.9.0a6+"
 __base_revision__ = "v3.9.0a5-508-g7443d42021"
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fissix-20.5.1/fissix/fixer_util.py 
new/fissix-20.8.0/fissix/fixer_util.py
--- old/fissix-20.5.1/fissix/fixer_util.py      2020-05-14 10:48:16.388410600 
+0200
+++ new/fissix-20.8.0/fissix/fixer_util.py      2020-08-18 06:00:39.167420900 
+0200
@@ -251,7 +251,7 @@
      """
 p1 = """
 power<
-    ( 'iter' | 'list' | 'tuple' | 'sorted' | 'set' | 'sum' |
+    ( 'iter' | 'list' | 'tuple' | 'sorted' | 'set' | 'sum' | 'dict' |
       'any' | 'all' | 'enumerate' | (any* trailer< '.' 'join' >) )
     trailer< '(' node=any ')' >
     any*
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fissix-20.5.1/fissix/fixes/fix_dict.py 
new/fissix-20.8.0/fissix/fixes/fix_dict.py
--- old/fissix-20.5.1/fissix/fixes/fix_dict.py  2020-05-14 10:48:13.046781800 
+0200
+++ new/fissix-20.8.0/fissix/fixes/fix_dict.py  2020-08-18 05:52:48.966973000 
+0200
@@ -65,6 +65,8 @@
         head = [n.clone() for n in head]
         tail = [n.clone() for n in tail]
         special = not tail and self.in_special_context(node, isiter)
+        if special and not (isiter or isview):
+            return None
         args = head + [
             pytree.Node(syms.trailer, [Dot(), Name(method_name, 
prefix=method.prefix)]),
             results["parens"].clone(),
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fissix-20.5.1/fissix/fixes/fix_except.py 
new/fissix-20.8.0/fissix/fixes/fix_except.py
--- old/fissix-20.5.1/fissix/fixes/fix_except.py        2020-05-14 
10:48:13.032078000 +0200
+++ new/fissix-20.8.0/fissix/fixes/fix_except.py        2020-08-18 
05:52:48.967351400 +0200
@@ -52,10 +52,12 @@
         tail = [n.clone() for n in results["tail"]]
 
         try_cleanup = [ch.clone() for ch in results["cleanup"]]
+        changed = False
         for except_clause, e_suite in find_excepts(try_cleanup):
             if len(except_clause.children) == 4:
                 (E, comma, N) = except_clause.children[1:4]
                 comma.replace(Name("as", prefix=" "))
+                changed = True
 
                 if N.type != token.NAME:
                     # Generate a new N for the except clause
@@ -90,6 +92,9 @@
                     # not so much.
                     N.prefix = " "
 
+        if not changed:
+            return None
+
         # TODO(cwinter) fix this when children becomes a smart list
         children = [c.clone() for c in node.children[:3]] + try_cleanup + tail
         return pytree.Node(node.type, children)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fissix-20.5.1/fissix/fixes/fix_isinstance.py 
new/fissix-20.8.0/fissix/fixes/fix_isinstance.py
--- old/fissix-20.5.1/fissix/fixes/fix_isinstance.py    2020-05-14 
08:04:42.000000000 +0200
+++ new/fissix-20.8.0/fissix/fixes/fix_isinstance.py    2020-08-18 
05:52:48.968306300 +0200
@@ -32,8 +32,10 @@
         args = testlist.children
         new_args = []
         iterator = enumerate(args)
+        changed = False
         for idx, arg in iterator:
             if arg.type == token.NAME and arg.value in names_inserted:
+                changed = True
                 if idx < len(args) - 1 and args[idx + 1].type == token.COMMA:
                     next(iterator)
                     continue
@@ -42,11 +44,13 @@
                 if arg.type == token.NAME:
                     names_inserted.add(arg.value)
         if new_args and new_args[-1].type == token.COMMA:
+            changed = True
             del new_args[-1]
-        if len(new_args) == 1:
-            atom = testlist.parent
+        atom = testlist.parent
+        if len(new_args) == 1 and new_args[0].prefix != atom.prefix:
+            changed = True
             new_args[0].prefix = atom.prefix
             atom.replace(new_args[0])
-        else:
+        if changed:
             args[:] = new_args
             node.changed()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fissix-20.5.1/fissix/fixes/fix_numliterals.py 
new/fissix-20.8.0/fissix/fixes/fix_numliterals.py
--- old/fissix-20.5.1/fissix/fixes/fix_numliterals.py   2020-05-14 
10:48:13.100662500 +0200
+++ new/fissix-20.8.0/fissix/fixes/fix_numliterals.py   2020-08-18 
05:52:48.968730000 +0200
@@ -14,15 +14,25 @@
 
     _accept_type = token.NUMBER
 
+    def is_long(self, node):
+        return node.value[-1] in "Ll"
+
+    def is_octal(self, node):
+        return (
+            node.value.startswith("0")
+            and node.value.isdigit()
+            and len(set(node.value)) > 1
+        )
+
     def match(self, node):
         # Override
-        return node.value.startswith("0") or node.value[-1] in "Ll"
+        return self.is_long(node) or self.is_octal(node)
 
     def transform(self, node, results):
         val = node.value
-        if val[-1] in "Ll":
-            val = val[:-1]
-        elif val.startswith("0") and val.isdigit() and len(set(val)) > 1:
-            val = "0o" + val[1:]
+        if self.is_long(node):
+            return Number(node.value[:-1], prefix=node.prefix)
+        elif self.is_octal(node):
+            return Number("0o" + node.value[1:], prefix=node.prefix)
 
-        return Number(val, prefix=node.prefix)
+        return None
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fissix-20.5.1/fissix/fixes/fix_raise.py 
new/fissix-20.8.0/fissix/fixes/fix_raise.py
--- old/fissix-20.5.1/fissix/fixes/fix_raise.py 2020-05-14 10:48:13.189692700 
+0200
+++ new/fissix-20.8.0/fissix/fixes/fix_raise.py 2020-08-18 05:52:48.969108300 
+0200
@@ -38,6 +38,7 @@
 
     def transform(self, node, results):
         syms = self.syms
+        changed = False
 
         exc = results["exc"].clone()
         if exc.type == token.STRING:
@@ -57,8 +58,11 @@
                 # exc.children[1].children[0] is the first element of the tuple
                 exc = exc.children[1].children[0].clone()
             exc.prefix = " "
+            changed = True
 
         if "val" not in results:
+            if not changed:
+                return None
             # One-argument raise
             new = pytree.Node(syms.raise_stmt, [Name("raise"), exc])
             new.prefix = node.prefix
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fissix-20.5.1/fissix/fixes/fix_unicode.py 
new/fissix-20.8.0/fissix/fixes/fix_unicode.py
--- old/fissix-20.5.1/fissix/fixes/fix_unicode.py       2020-05-14 
10:48:13.237128000 +0200
+++ new/fissix-20.8.0/fissix/fixes/fix_unicode.py       2020-08-18 
05:52:48.969493900 +0200
@@ -39,7 +39,7 @@
             if val[0] in "uU":
                 val = val[1:]
             if val == node.value:
-                return node
+                return None
             new = node.clone()
             new.value = val
             return new
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fissix-20.5.1/fissix/fixes/fix_ws_comma.py 
new/fissix-20.8.0/fissix/fixes/fix_ws_comma.py
--- old/fissix-20.5.1/fissix/fixes/fix_ws_comma.py      2020-05-14 
10:48:13.222144600 +0200
+++ new/fissix-20.8.0/fissix/fixes/fix_ws_comma.py      2020-08-18 
05:52:48.969998600 +0200
@@ -25,16 +25,19 @@
     def transform(self, node, results):
         new = node.clone()
         comma = False
+        changed = False
         for child in new.children:
             if child in self.SEPS:
                 prefix = child.prefix
                 if prefix.isspace() and "\n" not in prefix:
                     child.prefix = ""
+                    changed = True
                 comma = True
             else:
                 if comma:
                     prefix = child.prefix
                     if not prefix:
                         child.prefix = " "
+                    changed = True
                 comma = False
-        return new
+        return new if changed else None
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fissix-20.5.1/fissix/tests/__init__.py 
new/fissix-20.8.0/fissix/tests/__init__.py
--- old/fissix-20.5.1/fissix/tests/__init__.py  2020-05-14 10:48:13.413215200 
+0200
+++ new/fissix-20.8.0/fissix/tests/__init__.py  2020-08-18 05:52:48.970229600 
+0200
@@ -1,9 +0,0 @@
-# Author: Collin Winter
-
-import os
-
-from test.support import load_package_tests
-
-
-def load_tests(*args):
-    return load_package_tests(os.path.dirname(__file__), *args)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fissix-20.5.1/fissix/tests/test_fixers.py 
new/fissix-20.8.0/fissix/tests/test_fixers.py
--- old/fissix-20.5.1/fissix/tests/test_fixers.py       2020-05-14 
10:48:16.376124000 +0200
+++ new/fissix-20.8.0/fissix/tests/test_fixers.py       2020-08-18 
05:52:48.971548600 +0200
@@ -47,7 +47,8 @@
         self.warns(before, before, message, unchanged=True)
 
     def unchanged(self, before, ignore_warnings=False):
-        self._check(before, before)
+        tree = self._check(before, before)
+        self.assertFalse(tree.was_changed)
         if not ignore_warnings:
             self.assertEqual(self.fixer_log, [])
 
@@ -965,6 +966,10 @@
         a = """raise E1(V)"""
         self.check(b, a)
 
+    def test_unchanged(self):
+        a = """raise E1(V)"""
+        self.unchanged(a)
+
     # These should produce a warning
 
     def test_string_exc(self):
@@ -2845,10 +2850,14 @@
     def test_unchanged_int(self):
         s = """5"""
         self.unchanged(s)
+        s = """000"""
+        self.unchanged(s)
 
     def test_unchanged_float(self):
         s = """5.0"""
         self.unchanged(s)
+        s = """0.1"""
+        self.unchanged(s)
 
     def test_unchanged_octal(self):
         s = """0o755"""
@@ -2991,18 +3000,15 @@
         a = r"""'\\\\u20ac\\U0001d121\\u20ac'"""
         self.check(b, a)
 
-        b = r"""r'\\\u20ac\U0001d121\\u20ac'"""
         a = r"""r'\\\u20ac\U0001d121\\u20ac'"""
-        self.check(b, a)
+        self.unchanged(a)
 
     def test_bytes_literal_escape_u(self):
-        b = r"""b'\\\u20ac\U0001d121\\u20ac'"""
         a = r"""b'\\\u20ac\U0001d121\\u20ac'"""
-        self.check(b, a)
+        self.unchanged(a)
 
-        b = r"""br'\\\u20ac\U0001d121\\u20ac'"""
         a = r"""br'\\\u20ac\U0001d121\\u20ac'"""
-        self.check(b, a)
+        self.unchanged(a)
 
     def test_unicode_literal_escape_u(self):
         b = r"""u'\\\u20ac\U0001d121\\u20ac'"""
@@ -3015,13 +3021,15 @@
 
     def test_native_unicode_literal_escape_u(self):
         f = "from __future__ import unicode_literals\n"
-        b = f + r"""'\\\u20ac\U0001d121\\u20ac'"""
         a = f + r"""'\\\u20ac\U0001d121\\u20ac'"""
-        self.check(b, a)
+        self.unchanged(a)
 
-        b = f + r"""r'\\\u20ac\U0001d121\\u20ac'"""
         a = f + r"""r'\\\u20ac\U0001d121\\u20ac'"""
-        self.check(b, a)
+        self.unchanged(a)
+
+    def test_unchanged(self):
+        a = """'h'"""
+        self.unchanged(a)
 
 
 class Test_filter(FixerTestCase):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fissix-20.5.1/fissix/tests/test_main.py 
new/fissix-20.8.0/fissix/tests/test_main.py
--- old/fissix-20.5.1/fissix/tests/test_main.py 2020-05-14 10:48:16.337000800 
+0200
+++ new/fissix-20.8.0/fissix/tests/test_main.py 2020-08-18 05:52:48.971938800 
+0200
@@ -9,6 +9,8 @@
 import tempfile
 import unittest
 
+import pytest
+
 from fissix import main
 
 
@@ -73,6 +75,7 @@
             trivial.write("print 'I need a simple conversion.'")
         self.setup_files.append("trivial.py")
 
+    @pytest.mark.xfail
     def test_filename_changing_on_output_single_dir(self):
         """2to3 a single directory with a new output dir and suffix."""
         self.setup_test_source_trees()
@@ -119,6 +122,7 @@
         self.assertRegex(stderr, r"No changes to .*/__init__\.py".replace("/", 
sep))
         self.assertNotRegex(stderr, r"No changes to 
.*/trivial\.py".replace("/", sep))
 
+    @pytest.mark.xfail
     def test_filename_changing_on_output_two_files(self):
         """2to3 two files in one directory with a new output dir."""
         self.setup_test_source_trees()
@@ -148,6 +152,7 @@
         )
         self.assertEqual(expected_files, set(os.listdir(self.py3_dest_dir)))
 
+    @pytest.mark.xfail
     def test_filename_changing_on_output_single_file(self):
         """2to3 a single file with a new output dir."""
         self.setup_test_source_trees()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fissix-20.5.1/fissix/tests/test_parser.py 
new/fissix-20.8.0/fissix/tests/test_parser.py
--- old/fissix-20.5.1/fissix/tests/test_parser.py       2020-05-14 
10:49:22.423782600 +0200
+++ new/fissix-20.8.0/fissix/tests/test_parser.py       2020-08-18 
05:52:48.972358700 +0200
@@ -22,6 +22,8 @@
 import tempfile
 import unittest
 
+import pytest
+
 # Local imports
 from fissix.pgen2 import driver as pgen2_driver
 from fissix.pgen2 import tokenize
@@ -58,6 +60,7 @@
         finally:
             shutil.rmtree(tmpdir)
 
+    @pytest.mark.xfail
     @unittest.skipIf(sys.executable is None, "sys.executable required")
     def test_load_grammar_from_subprocess(self):
         tmpdir = tempfile.mkdtemp()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fissix-20.5.1/makefile new/fissix-20.8.0/makefile
--- old/fissix-20.5.1/makefile  2020-05-14 11:22:43.835626100 +0200
+++ new/fissix-20.8.0/makefile  2020-08-18 06:09:36.022405100 +0200
@@ -2,6 +2,8 @@
        python -m venv .venv
        source .venv/bin/activate && make setup
 
+venv: .venv
+
 setup:
        python -m pip install -r requirements.txt
        python -m pip install -r requirements-dev.txt
@@ -25,14 +27,17 @@
        flit publish
 
 black:
-       python -m black fissix tests setup.py
-       python -m isort -rc fissix/__init__.py tests/ setup.py
+       python -m black fissix tests
+       python -m isort -rc fissix/__init__.py tests/
 
 lint:
-       python -m black --check fissix tests setup.py
+       python -m black --check fissix tests
 
 test:
-       python -m unittest --verbose tests
+       python -m pytest --verbose tests fissix/tests
 
 clean:
-       rm -rf build dist *.egg-info .venv .mypy_cache
+       rm -rf build dist *.egg-info .mypy_cache
+
+distclean:
+       rm -rf .venv
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fissix-20.5.1/pyproject.toml 
new/fissix-20.8.0/pyproject.toml
--- old/fissix-20.5.1/pyproject.toml    2020-05-14 11:11:34.399672700 +0200
+++ new/fissix-20.8.0/pyproject.toml    2020-08-18 06:00:39.168158300 +0200
@@ -30,4 +30,10 @@
 
 [tool.black]
 # try to remove this after future black updates
-exclude = "py3_test_grammar.py"
\ No newline at end of file
+exclude = "py3_test_grammar.py"
+
+[tool.pytest.ini_options]
+minversion = "6.0"
+xfail_strict=true
+addopts = "--strict-markers --strict-config"
+filterwarnings = ["error"]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fissix-20.5.1/requirements-dev.txt 
new/fissix-20.8.0/requirements-dev.txt
--- old/fissix-20.5.1/requirements-dev.txt      2020-05-14 11:03:55.447211300 
+0200
+++ new/fissix-20.8.0/requirements-dev.txt      2020-08-18 06:00:39.168529000 
+0200
@@ -1,3 +1,4 @@
 black
 flit
-isort
\ No newline at end of file
+isort
+pytest>=6.0.1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fissix-20.5.1/setup.py new/fissix-20.8.0/setup.py
--- old/fissix-20.5.1/setup.py  1970-01-01 01:00:00.000000000 +0100
+++ new/fissix-20.8.0/setup.py  1970-01-01 01:00:00.000000000 +0100
@@ -17,7 +17,7 @@
 ['appdirs']
 
 setup(name='fissix',
-      version='20.5.1',
+      version='20.8.0',
       description='Monkeypatches to override default behavior of lib2to3.',
       author='John Reese',
       author_email='j...@noswap.com',


Reply via email to