Hello community, here is the log from the commit of package python-isort for openSUSE:Factory checked in at 2019-07-30 12:59:55 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-isort (Old) and /work/SRC/openSUSE:Factory/.python-isort.new.4126 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-isort" Tue Jul 30 12:59:55 2019 rev:12 rq:713859 version:4.3.21 Changes: -------- --- /work/SRC/openSUSE:Factory/python-isort/python-isort.changes 2019-05-27 08:30:30.479255226 +0200 +++ /work/SRC/openSUSE:Factory/.python-isort.new.4126/python-isort.changes 2019-07-30 12:59:56.902454022 +0200 @@ -1,0 +2,6 @@ +Sun Jun 30 13:17:40 UTC 2019 - Sebastian Wagner <[email protected]> + +- update to version 4.3.21: + - Fixed issue #957 - Long aliases and use_parentheses generates invalid syntax + +------------------------------------------------------------------- @@ -4 +10 @@ -- version update to 4.3.20 +- version update to 4.3.20: @@ -6,0 +13,2 @@ +- update to version 4.3.19: + - Fixed issue #942 - correctly handle pyi (Python Template Files) to match `black` output Old: ---- isort-4.3.20.tar.gz New: ---- isort-4.3.21.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-isort.spec ++++++ --- /var/tmp/diff_new_pack.QPrPEV/_old 2019-07-30 12:59:57.562453875 +0200 +++ /var/tmp/diff_new_pack.QPrPEV/_new 2019-07-30 12:59:57.566453874 +0200 @@ -26,7 +26,7 @@ %bcond_with test %endif Name: python-isort%{psuffix} -Version: 4.3.20 +Version: 4.3.21 Release: 0 Summary: A Python utility / library to sort Python imports License: MIT ++++++ isort-4.3.20.tar.gz -> isort-4.3.21.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/isort-4.3.20/CHANGELOG.md new/isort-4.3.21/CHANGELOG.md --- old/isort-4.3.20/CHANGELOG.md 2019-05-15 02:23:51.000000000 +0200 +++ new/isort-4.3.21/CHANGELOG.md 2019-06-26 03:12:09.000000000 +0200 @@ -1,6 +1,9 @@ Changelog ========= +### 4.3.21 - June 25, 2019 - hot fix release +- Fixed issue #957 - Long aliases and use_parentheses generates invalid syntax + ### 4.3.20 - May 14, 2019 - hot fix release - Fixed issue #948 - Pipe redirection broken on Python2.7 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/isort-4.3.20/PKG-INFO new/isort-4.3.21/PKG-INFO --- old/isort-4.3.20/PKG-INFO 2019-05-15 02:24:39.000000000 +0200 +++ new/isort-4.3.21/PKG-INFO 2019-06-26 03:12:53.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: isort -Version: 4.3.20 +Version: 4.3.21 Summary: A Python utility / library to sort Python imports. Home-page: https://github.com/timothycrosley/isort Author: Timothy Crosley @@ -681,7 +681,7 @@ Classifier: Topic :: Software Development :: Libraries Classifier: Topic :: Utilities Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.* -Provides-Extra: xdg_home -Provides-Extra: pyproject Provides-Extra: requirements +Provides-Extra: pyproject +Provides-Extra: xdg_home Provides-Extra: pipfile diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/isort-4.3.20/isort/__init__.py new/isort-4.3.21/isort/__init__.py --- old/isort-4.3.20/isort/__init__.py 2019-05-15 02:23:51.000000000 +0200 +++ new/isort-4.3.21/isort/__init__.py 2019-06-26 03:12:09.000000000 +0200 @@ -25,4 +25,4 @@ from . import settings # noqa: F401 from .isort import SortImports # noqa: F401 -__version__ = "4.3.20" +__version__ = "4.3.21" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/isort-4.3.20/isort/isort.py new/isort-4.3.21/isort/isort.py --- old/isort-4.3.20/isort/isort.py 2019-05-15 02:23:51.000000000 +0200 +++ new/isort-4.3.21/isort/isort.py 2019-06-26 03:12:09.000000000 +0200 @@ -380,13 +380,15 @@ cont_line = self._wrap(self.config['indent'] + splitter.join(next_line).lstrip()) if self.config['use_parentheses']: - output = "{0}{1}({2}{3}{4}{5})".format( - line, splitter, self.line_separator, cont_line, - "," if self.config['include_trailing_comma'] else "", - self.line_separator if wrap_mode in ( - settings.WrapModes.VERTICAL_HANGING_INDENT, - settings.WrapModes.VERTICAL_GRID_GROUPED, - ) else "") + if splitter == "as ": + output = "{0}{1}{2}".format(line, splitter, cont_line.lstrip()) + else: + output = "{0}{1}({2}{3}{4}{5})".format( + line, splitter, self.line_separator, cont_line, + "," if self.config['include_trailing_comma'] else "", + self.line_separator if wrap_mode in (settings.WrapModes.VERTICAL_HANGING_INDENT, + settings.WrapModes.VERTICAL_GRID_GROUPED) + else "") lines = output.split(self.line_separator) if self.config['comment_prefix'] in lines[-1] and lines[-1].endswith(')'): line, comment = lines[-1].split(self.config['comment_prefix'], 1) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/isort-4.3.20/isort.egg-info/PKG-INFO new/isort-4.3.21/isort.egg-info/PKG-INFO --- old/isort-4.3.20/isort.egg-info/PKG-INFO 2019-05-15 02:24:39.000000000 +0200 +++ new/isort-4.3.21/isort.egg-info/PKG-INFO 2019-06-26 03:12:53.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: isort -Version: 4.3.20 +Version: 4.3.21 Summary: A Python utility / library to sort Python imports. Home-page: https://github.com/timothycrosley/isort Author: Timothy Crosley @@ -681,7 +681,7 @@ Classifier: Topic :: Software Development :: Libraries Classifier: Topic :: Utilities Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.* -Provides-Extra: xdg_home -Provides-Extra: pyproject Provides-Extra: requirements +Provides-Extra: pyproject +Provides-Extra: xdg_home Provides-Extra: pipfile diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/isort-4.3.20/setup.py new/isort-4.3.21/setup.py --- old/isort-4.3.20/setup.py 2019-05-15 02:23:51.000000000 +0200 +++ new/isort-4.3.21/setup.py 2019-06-26 03:12:09.000000000 +0200 @@ -6,7 +6,7 @@ readme = f.read() setup(name='isort', - version='4.3.20', + version='4.3.21', description='A Python utility / library to sort Python imports.', long_description=readme, author='Timothy Crosley', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/isort-4.3.20/test_isort.py new/isort-4.3.21/test_isort.py --- old/isort-4.3.20/test_isort.py 2019-05-15 02:23:51.000000000 +0200 +++ new/isort-4.3.21/test_isort.py 2019-06-26 03:12:09.000000000 +0200 @@ -2192,6 +2192,32 @@ use_parentheses=True).output == expected_output +def test_long_alias_using_paren_issue_957(): + test_input = ('from package import module as very_very_very_very_very_very_very_very_very_very_long_alias\n') + expected_output = ('from package import (\n' + ' module as very_very_very_very_very_very_very_very_very_very_long_alias\n' + ')\n') + out = SortImports(file_contents=test_input, line_length=50, use_parentheses=True, multi_line_output=WrapModes.VERTICAL_GRID_GROUPED, check=True).output + assert out == expected_output + + test_input = ('from deep.deep.deep.deep.deep.deep.deep.deep.deep.package import module as very_very_very_very_very_very_very_very_very_very_long_alias\n') + expected_output = ('from deep.deep.deep.deep.deep.deep.deep.deep.deep.package import (\n' + ' module as very_very_very_very_very_very_very_very_very_very_long_alias\n' + ')\n') + out = SortImports(file_contents=test_input, line_length=50, use_parentheses=True, multi_line_output=WrapModes.VERTICAL_GRID_GROUPED, check=True).output + assert out == expected_output + + test_input = ('from deep.deep.deep.deep.deep.deep.deep.deep.deep.package import very_very_very' + '_very_very_very_very_very_very_very_long_module as very_very_very_very_very' + '_very_very_very_very_very_long_alias\n') + expected_output = ('from deep.deep.deep.deep.deep.deep.deep.deep.deep.package import (\n' + ' very_very_very_very_very_very_very_very_very_very_long_module as very' + '_very_very_very_very_very_very_very_very_very_long_alias\n' + ')\n') + out = SortImports(file_contents=test_input, line_length=50, use_parentheses=True, multi_line_output=WrapModes.VERTICAL_GRID_GROUPED, check=True).output + assert out == expected_output + + def test_strict_whitespace_by_default(capsys): test_input = ('import os\n' 'from django.conf import settings\n')
