Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-autopep8 for openSUSE:Factory 
checked in at 2021-04-10 15:27:04
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-autopep8 (Old)
 and      /work/SRC/openSUSE:Factory/.python-autopep8.new.2401 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-autopep8"

Sat Apr 10 15:27:04 2021 rev:21 rq:883214 version:1.5.6

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-autopep8/python-autopep8.changes  
2020-08-18 15:08:27.059976126 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-autopep8.new.2401/python-autopep8.changes    
    2021-04-10 15:28:06.994430633 +0200
@@ -1,0 +2,22 @@
+Mon Apr  5 00:52:52 UTC 2021 - Arun Persaud <[email protected]>
+
+- specfile:
+  * update copyright year
+
+- update to version 1.5.6:
+  * Update pycodestyle 2.7.0
+  * Update test_autopep8.py after continued_indentation fix
+  * continued_indentation: Make the E128 check similar to pycodestyle
+  * Restore the original pep8 copyright notice
+  * change: use build and twine tools for pypi upload
+
+- changes from version 1.5.5:
+  * drop py35
+  * change test python version
+  * (origin/v1) add unit test that multilines w605
+  * remove unnecessary function
+  * change: not convert raw string for w605 fixed method
+  * docs: fix simple typo, requred -> required
+  * change: toml package not to import until it is needed (for #566)
+
+-------------------------------------------------------------------

Old:
----
  autopep8-1.5.4.tar.gz

New:
----
  autopep8-1.5.6.tar.gz

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

Other differences:
------------------
++++++ python-autopep8.spec ++++++
--- /var/tmp/diff_new_pack.ZzLsGe/_old  2021-04-10 15:28:07.654431409 +0200
+++ /var/tmp/diff_new_pack.ZzLsGe/_new  2021-04-10 15:28:07.658431414 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package python-autopep8
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2021 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -18,22 +18,22 @@
 
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:           python-autopep8
-Version:        1.5.4
+Version:        1.5.6
 Release:        0
 Summary:        Automatic generated to pep8 checked code
 License:        MIT
 Group:          Development/Languages/Python
 URL:            https://github.com/hhatto/autopep8
 Source:         
https://files.pythonhosted.org/packages/source/a/autopep8/autopep8-%{version}.tar.gz
-BuildRequires:  %{python_module pycodestyle >= 2.6}
+BuildRequires:  %{python_module pycodestyle >= 2.7}
 BuildRequires:  %{python_module setuptools}
 BuildRequires:  %{python_module toml}
 BuildRequires:  python-rpm-macros
-Requires:       python-pycodestyle >= 2.6
+Requires:       python-pycodestyle >= 2.7
 Requires:       python-setuptools
 Requires:       python-toml
 Requires(post): update-alternatives
-Requires(postun): update-alternatives
+Requires(postun):update-alternatives
 BuildArch:      noarch
 %python_subpackages
 

++++++ autopep8-1.5.4.tar.gz -> autopep8-1.5.6.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/autopep8-1.5.4/PKG-INFO new/autopep8-1.5.6/PKG-INFO
--- old/autopep8-1.5.4/PKG-INFO 2020-08-02 06:28:35.000000000 +0200
+++ new/autopep8-1.5.6/PKG-INFO 2021-03-16 16:01:32.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: autopep8
-Version: 1.5.4
+Version: 1.5.6
 Summary: A tool that automatically formats Python code to conform to the PEP 8 
style guide
 Home-page: https://github.com/hhatto/autopep8
 Author: Hideo Hattori
@@ -392,7 +392,7 @@
         Test cases are in ``test/test_autopep8.py``. They can be run directly 
via
         ``python test/test_autopep8.py`` or via tox_. The latter is useful for
         testing against multiple Python interpreters. (We currently test 
against
-        CPython versions 2.7, 3.4, 3.5, 3.6 and 3.7. We also test against 
PyPy.)
+        CPython versions 2.7, 3.6 3.7 and 3.8. We also test against PyPy.)
         
         .. _`tox`: https://pypi.org/project/tox/
         
@@ -442,8 +442,6 @@
 Classifier: Programming Language :: Python :: 2
 Classifier: Programming Language :: Python :: 2.7
 Classifier: Programming Language :: Python :: 3
-Classifier: Programming Language :: Python :: 3.4
-Classifier: Programming Language :: Python :: 3.5
 Classifier: Programming Language :: Python :: 3.6
 Classifier: Programming Language :: Python :: 3.7
 Classifier: Programming Language :: Python :: 3.8
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/autopep8-1.5.4/README.rst 
new/autopep8-1.5.6/README.rst
--- old/autopep8-1.5.4/README.rst       2020-07-31 08:06:41.000000000 +0200
+++ new/autopep8-1.5.6/README.rst       2021-02-22 13:49:43.000000000 +0100
@@ -384,7 +384,7 @@
 Test cases are in ``test/test_autopep8.py``. They can be run directly via
 ``python test/test_autopep8.py`` or via tox_. The latter is useful for
 testing against multiple Python interpreters. (We currently test against
-CPython versions 2.7, 3.4, 3.5, 3.6 and 3.7. We also test against PyPy.)
+CPython versions 2.7, 3.6 3.7 and 3.8. We also test against PyPy.)
 
 .. _`tox`: https://pypi.org/project/tox/
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/autopep8-1.5.4/autopep8.egg-info/PKG-INFO 
new/autopep8-1.5.6/autopep8.egg-info/PKG-INFO
--- old/autopep8-1.5.4/autopep8.egg-info/PKG-INFO       2020-08-02 
06:28:35.000000000 +0200
+++ new/autopep8-1.5.6/autopep8.egg-info/PKG-INFO       2021-03-16 
16:01:32.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: autopep8
-Version: 1.5.4
+Version: 1.5.6
 Summary: A tool that automatically formats Python code to conform to the PEP 8 
style guide
 Home-page: https://github.com/hhatto/autopep8
 Author: Hideo Hattori
@@ -392,7 +392,7 @@
         Test cases are in ``test/test_autopep8.py``. They can be run directly 
via
         ``python test/test_autopep8.py`` or via tox_. The latter is useful for
         testing against multiple Python interpreters. (We currently test 
against
-        CPython versions 2.7, 3.4, 3.5, 3.6 and 3.7. We also test against 
PyPy.)
+        CPython versions 2.7, 3.6 3.7 and 3.8. We also test against PyPy.)
         
         .. _`tox`: https://pypi.org/project/tox/
         
@@ -442,8 +442,6 @@
 Classifier: Programming Language :: Python :: 2
 Classifier: Programming Language :: Python :: 2.7
 Classifier: Programming Language :: Python :: 3
-Classifier: Programming Language :: Python :: 3.4
-Classifier: Programming Language :: Python :: 3.5
 Classifier: Programming Language :: Python :: 3.6
 Classifier: Programming Language :: Python :: 3.7
 Classifier: Programming Language :: Python :: 3.8
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/autopep8-1.5.4/autopep8.egg-info/requires.txt 
new/autopep8-1.5.6/autopep8.egg-info/requires.txt
--- old/autopep8-1.5.4/autopep8.egg-info/requires.txt   2020-08-02 
06:28:35.000000000 +0200
+++ new/autopep8-1.5.6/autopep8.egg-info/requires.txt   2021-03-16 
16:01:32.000000000 +0100
@@ -1,2 +1,2 @@
-pycodestyle>=2.6.0
+pycodestyle>=2.7.0
 toml
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/autopep8-1.5.4/autopep8.py 
new/autopep8-1.5.6/autopep8.py
--- old/autopep8-1.5.4/autopep8.py      2020-08-02 04:24:44.000000000 +0200
+++ new/autopep8-1.5.6/autopep8.py      2021-03-16 15:50:28.000000000 +0100
@@ -24,6 +24,29 @@
 # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 # SOFTWARE.
 
+# Copyright (C) 2006-2009 Johann C. Rocholl <[email protected]>
+# Copyright (C) 2009-2013 Florent Xicluna <[email protected]>
+#
+# Permission is hereby granted, free of charge, to any person
+# obtaining a copy of this software and associated documentation files
+# (the "Software"), to deal in the Software without restriction,
+# including without limitation the rights to use, copy, modify, merge,
+# publish, distribute, sublicense, and/or sell copies of the Software,
+# and to permit persons to whom the Software is furnished to do so,
+# subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
 """Automatically formats Python code to conform to the PEP 8 style guide.
 
 Fixes that only need be done once can be added by adding a function of the form
@@ -67,7 +90,6 @@
     from ConfigParser import SafeConfigParser
     from ConfigParser import Error
 
-import toml
 import pycodestyle
 from pycodestyle import STARTSWITH_INDENT_STATEMENT_REGEX
 
@@ -78,7 +100,7 @@
     unicode = str
 
 
-__version__ = '1.5.4'
+__version__ = '1.5.6'
 
 
 CR = '\r'
@@ -294,8 +316,9 @@
                 if hang_closing:
                     yield (start, 'E133 {}'.format(indent[depth]))
             elif indent[depth] and start[1] < indent[depth]:
-                # Visual indent is broken.
-                yield (start, 'E128 {}'.format(indent[depth]))
+                if visual_indent is not True:
+                    # Visual indent is broken.
+                    yield (start, 'E128 {}'.format(indent[depth]))
             elif (hanging_indent or
                   (indent_next and
                    rel_indent[row] == 2 * DEFAULT_INDENT_SIZE)):
@@ -1385,56 +1408,10 @@
             next_line[next_line_indent:])
 
     def fix_w605(self, result):
-        (line_index, _, target) = get_index_offset_contents(result,
-                                                            self.source)
-        try:
-            tokens = list(generate_tokens(target))
-        except (SyntaxError, tokenize.TokenError):
-            return
-        for (pos, _msg) in get_w605_position(tokens):
-            if target[pos - 1] == "r":
-                # ignore special case
-                if self.options.verbose:
-                    print("invalid line: line_number={}, line: {}".format(
-                        line_index + 1, target))
-                return
-            self.source[line_index] = '{}r{}'.format(
-                target[:pos], target[pos:])
-
-
-def get_w605_position(tokens):
-    """workaround get pointing out position by W605."""
-    # TODO: When this PR(*) change is released, use pos of pycodestyle
-    # *: https://github.com/PyCQA/pycodestyle/pull/747
-    valid = [
-        '\n', '\\', '\'', '"', 'a', 'b', 'f', 'n', 'r', 't', 'v',
-        '0', '1', '2', '3', '4', '5', '6', '7', 'x',
-
-        # Escape sequences only recognized in string literals
-        'N', 'u', 'U',
-    ]
-
-    for token_type, text, start_pos, _end_pos, _line in tokens:
-        if token_type == tokenize.STRING:
-            quote = text[-3:] if text[-3:] in ('"""', "'''") else text[-1]
-            # Extract string modifiers (e.g. u or r)
-            quote_pos = text.index(quote)
-            prefix = text[:quote_pos].lower()
-            start = quote_pos + len(quote)
-            string = text[start:-len(quote)]
-
-            if 'r' not in prefix:
-                pos = string.find('\\')
-                while pos >= 0:
-                    pos += 1
-                    if string[pos] not in valid:
-                        yield (
-                            # No need to search line, token stores position
-                            start_pos[1],
-                            "W605 invalid escape sequence '\\%s'" %
-                            string[pos],
-                        )
-                    pos = string.find('\\', pos + 1)
+        (line_index, offset, target) = get_index_offset_contents(result,
+                                                                 self.source)
+        self.source[line_index] = '{}\\{}'.format(
+            target[:offset + 1], target[offset + 1:])
 
 
 def get_module_imports_on_top_of_file(source, import_line_index):
@@ -3985,6 +3962,8 @@
 
 def read_pyproject_toml(args, parser):
     """Read pyproject.toml and load configuration."""
+    import toml
+
     config = None
 
     if os.path.exists(args.global_config):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/autopep8-1.5.4/setup.py new/autopep8-1.5.6/setup.py
--- old/autopep8-1.5.4/setup.py 2020-07-27 01:58:14.000000000 +0200
+++ new/autopep8-1.5.6/setup.py 2021-03-16 15:46:16.000000000 +0100
@@ -10,7 +10,7 @@
 
 
 INSTALL_REQUIRES = (
-    ['pycodestyle >= 2.6.0', 'toml']
+    ['pycodestyle >= 2.7.0', 'toml']
 )
 
 
@@ -43,8 +43,6 @@
             'Programming Language :: Python :: 2',
             'Programming Language :: Python :: 2.7',
             'Programming Language :: Python :: 3',
-            'Programming Language :: Python :: 3.4',
-            'Programming Language :: Python :: 3.5',
             'Programming Language :: Python :: 3.6',
             'Programming Language :: Python :: 3.7',
             'Programming Language :: Python :: 3.8',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/autopep8-1.5.4/test/test_autopep8.py 
new/autopep8-1.5.6/test/test_autopep8.py
--- old/autopep8-1.5.4/test/test_autopep8.py    2020-07-31 08:06:41.000000000 
+0200
+++ new/autopep8-1.5.6/test/test_autopep8.py    2021-03-16 15:48:24.000000000 
+0100
@@ -1329,7 +1329,7 @@
 
 sql = 'update %s set %s %s' % (from_table,
                                ','.join(['%s=%s' % (col, col)
-                                         for col in cols]),
+                                        for col in cols]),
                                where_clause)
 """
         with autopep8_context(line) as result:
@@ -5037,32 +5037,44 @@
 
     def test_w605_simple(self):
         line = "escape = '\\.jpg'\n"
-        fixed = "escape = r'\\.jpg'\n"
+        fixed = "escape = '\\\\.jpg'\n"
         with autopep8_context(line, options=['--aggressive']) as result:
             self.assertEqual(fixed, result)
 
     def test_w605_identical_token(self):
-        # ***NOTE***: The --pep8-passes option is requred to prevent an 
infinite loop in
+        # ***NOTE***: The --pep8-passes option is required to prevent an 
infinite loop in
         # the old, failing code. DO NOT REMOVE.
         line = "escape = foo('\\.bar', '\\.kilroy')\n"
-        fixed = "escape = foo(r'\\.bar', r'\\.kilroy')\n"
+        fixed = "escape = foo('\\\\.bar', '\\\\.kilroy')\n"
         with autopep8_context(line, options=['--aggressive', '--pep8-passes', 
'5']) as result:
             self.assertEqual(fixed, result, "Two tokens get r added")
 
-        line = "escape = foo('\\.bar', r'\\.kilroy')\n"
-        fixed = "escape = foo(r'\\.bar', r'\\.kilroy')\n"
+        line = "escape = foo('\\.bar', '\\\\.kilroy')\n"
+        fixed = "escape = foo('\\\\.bar', '\\\\.kilroy')\n"
         with autopep8_context(line, options=['--aggressive', '--pep8-passes', 
'5']) as result:
             self.assertEqual(fixed, result, "r not added if already there")
 
         # Test Case to catch bad behavior reported in Issue #449
         line = "escape = foo('\\.bar', '\\.bar')\n"
-        fixed = "escape = foo(r'\\.bar', r'\\.bar')\n"
+        fixed = "escape = foo('\\\\.bar', '\\\\.bar')\n"
         with autopep8_context(line, options=['--aggressive', '--pep8-passes', 
'5']) as result:
             self.assertEqual(fixed, result)
 
     def test_w605_with_invalid_syntax(self):
         line = "escape = rr'\\.jpg'\n"
-        fixed = "escape = rr'\\.jpg'\n"
+        fixed = "escape = rr'\\\\.jpg'\n"
+        with autopep8_context(line, options=['--aggressive']) as result:
+            self.assertEqual(fixed, result)
+
+    def test_w605_with_multilines(self):
+        line = """\
+regex = '\\d+(\\.\\d+){3}$'
+foo = validators.RegexValidator(
+    regex='\\d+(\\.\\d+){3}$')\n"""  # noqa
+        fixed = """\
+regex = '\\\\d+(\\\\.\\\\d+){3}$'
+foo = validators.RegexValidator(
+    regex='\\\\d+(\\\\.\\\\d+){3}$')\n"""
         with autopep8_context(line, options=['--aggressive']) as result:
             self.assertEqual(fixed, result)
 

Reply via email to