Hello community, here is the log from the commit of package python-isort for openSUSE:Factory checked in at 2018-07-23 17:58:23 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-isort (Old) and /work/SRC/openSUSE:Factory/.python-isort.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-isort" Mon Jul 23 17:58:23 2018 rev:4 rq:624436 version:4.3.4 Changes: -------- --- /work/SRC/openSUSE:Factory/python-isort/python-isort.changes 2018-02-12 10:10:50.354966590 +0100 +++ /work/SRC/openSUSE:Factory/.python-isort.new/python-isort.changes 2018-07-23 17:58:28.133120084 +0200 @@ -1,0 +2,17 @@ +Sat Jul 21 04:35:40 UTC 2018 - [email protected] + +- specfile: + * be more specific in %files section + +- update to version 4.3.4: + * Fixed issue #671: isort is corrupting CRLF files + +- changes from version 4.3.3: + * Fixed issue #665: Tabs turned into single spaces + +- changes from version 4.3.2: + * Fixed issue #651: Add imports option is broken + * Fixed issue #662: An error generated by rewriting .imports to + . imoprts + +------------------------------------------------------------------- Old: ---- 4.3.1.tar.gz New: ---- 4.3.4.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-isort.spec ++++++ --- /var/tmp/diff_new_pack.5f9k3f/_old 2018-07-23 17:58:28.841119201 +0200 +++ /var/tmp/diff_new_pack.5f9k3f/_new 2018-07-23 17:58:28.845119196 +0200 @@ -19,12 +19,12 @@ %{!?license: %global license %doc} %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-isort -Version: 4.3.1 +Version: 4.3.4 Release: 0 Summary: A Python utility / library to sort Python imports License: MIT Group: Development/Languages/Python -Url: https://github.com/timothycrosley/isort +URL: https://github.com/timothycrosley/isort # Tests included in pypi package fail Source: https://github.com/timothycrosley/isort/archive/%{version}.tar.gz BuildRequires: %{python_module mock} @@ -32,10 +32,10 @@ BuildRequires: %{python_module setuptools} BuildRequires: python-rpm-macros BuildRequires: python2-futures +BuildArch: noarch %ifpython2 Requires: python-futures %endif -BuildArch: noarch %python_subpackages %description @@ -62,8 +62,7 @@ %python_exec setup.py test %files %{python_files} -%defattr(-,root,root,-) -%{python_sitelib}/* +%{python_sitelib}/isort* %python3_only %{_bindir}/isort %license LICENSE ++++++ 4.3.1.tar.gz -> 4.3.4.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/isort-4.3.1/ACKNOWLEDGEMENTS.md new/isort-4.3.4/ACKNOWLEDGEMENTS.md --- old/isort-4.3.1/ACKNOWLEDGEMENTS.md 2018-02-02 20:43:32.000000000 +0100 +++ new/isort-4.3.4/ACKNOWLEDGEMENTS.md 2018-02-12 16:12:28.000000000 +0100 @@ -75,6 +75,7 @@ - Jason Brackman (@jasonbrackman) - Kathryn Lingel (@katlings) - Andrew Gaul (@gaul) +- John Chadwick (@jchv) Documenters =================== diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/isort-4.3.1/CHANGELOG.md new/isort-4.3.4/CHANGELOG.md --- old/isort-4.3.1/CHANGELOG.md 2018-02-02 20:43:32.000000000 +0100 +++ new/isort-4.3.4/CHANGELOG.md 2018-02-12 16:12:28.000000000 +0100 @@ -1,9 +1,18 @@ Changelog ========= +### 4.3.4 - Feburary 12, 2018 - hotfix release +- Fixed issue #671: isort is corrupting CRLF files + +### 4.3.3 - Feburary 5, 2018 - hotfix release +- Fixed issue #665: Tabs turned into single spaces + +### 4.3.2 - Feburary 4, 2018 - hotfix release +- Fixed issue #651: Add imports option is broken +- Fixed issue #662: An error generated by rewriting `.imports` to `. imoprts` + ### 4.3.1 - Feburary 2, 2018 - hotfix release - Fixed setup.py errors - Fixed issue #654: Trailing comma count error -- Fixed issue #651: Add imports option is broken - Fixed issue #650: Wrong error message displayed ### 4.3.0 - January 31, 2018 @@ -11,6 +20,7 @@ - Fix case-sensitive path existence check in Mac OS X - Added `--no-lines-before` for more granular control over section output - Fixed #493: Unwanted conversion to Windows line endings +- Fixed #590: Import `as` mucks with alphabetical sorting - Implemented `--version-number` to retrieve just the version number without the isort logo - Breaking changes - Python 2.7+ only (dropped 2.6) allowing various code simplifications and improvements. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/isort-4.3.1/isort/__init__.py new/isort-4.3.4/isort/__init__.py --- old/isort-4.3.1/isort/__init__.py 2018-02-02 20:43:32.000000000 +0100 +++ new/isort-4.3.4/isort/__init__.py 2018-02-12 16:12:28.000000000 +0100 @@ -25,4 +25,4 @@ from . import settings # noqa: F401 from .isort import SortImports # noqa: F401 -__version__ = "4.3.1" +__version__ = "4.3.4" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/isort-4.3.1/isort/isort.py new/isort-4.3.4/isort/isort.py --- old/isort-4.3.1/isort/isort.py 2018-02-02 20:43:32.000000000 +0100 +++ new/isort-4.3.4/isort/isort.py 2018-02-12 16:12:28.000000000 +0100 @@ -211,7 +211,7 @@ return if answer in ('quit', 'q'): sys.exit(1) - with io.open(self.file_path, encoding=self.file_encoding, mode='w', newline=self.line_separator) as output_file: + with io.open(self.file_path, encoding=self.file_encoding, mode='w', newline='') as output_file: print("Fixing {0}".format(self.file_path)) output_file.write(self.output) @@ -634,6 +634,7 @@ parts = line.split() if len(parts) >= 3 and parts[1] == '=' and "'" not in parts[0] and '"' not in parts[0]: next_construct = line + break if self.config['lines_after_imports'] != -1: self.out_lines[imports_tail:0] = ["" for line in range(self.config['lines_after_imports'])] @@ -821,8 +822,6 @@ self._in_quote = line[index] elif line[index] == "#": break - elif line[index] not in (' ', '\t'): - break index += 1 return skip_line or self._in_quote or self._in_top_comment @@ -844,10 +843,10 @@ self._in_quote = False self._in_top_comment = False while not self._at_end(): - line = self._get_line() - line = line.replace("from.import", "from . import") + raw_line = line = self._get_line() + line = line.replace("from.import ", "from . import ") line = line.replace("\t", " ").replace('import*', 'import *') - line = line.replace(" .import", " . import") + line = line.replace(" .import ", " . import ") statement_index = self.index skip_line = self._skip_line(line) @@ -868,7 +867,7 @@ import_type = self._import_type(line) if not import_type or skip_line: - self.out_lines.append(line) + self.out_lines.append(raw_line) continue for line in (line.strip() for line in line.split(";")): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/isort-4.3.1/isort/main.py new/isort-4.3.4/isort/main.py --- old/isort-4.3.1/isort/main.py 2018-02-02 20:43:32.000000000 +0100 +++ new/isort-4.3.4/isort/main.py 2018-02-12 16:12:28.000000000 +0100 @@ -21,12 +21,12 @@ from __future__ import absolute_import, division, print_function, unicode_literals import argparse +import functools import glob import os import re import sys from concurrent.futures import ProcessPoolExecutor -import functools import setuptools diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/isort-4.3.1/setup.py new/isort-4.3.4/setup.py --- old/isort-4.3.1/setup.py 2018-02-02 20:43:32.000000000 +0100 +++ new/isort-4.3.4/setup.py 2018-02-12 16:12:28.000000000 +0100 @@ -43,7 +43,7 @@ install_requires = ['futures'] setup(name='isort', - version='4.3.1', + version='4.3.4', 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.1/test_isort.py new/isort-4.3.4/test_isort.py --- old/isort-4.3.1/test_isort.py 2018-02-02 20:43:32.000000000 +0100 +++ new/isort-4.3.4/test_isort.py 2018-02-12 16:12:28.000000000 +0100 @@ -23,8 +23,10 @@ """ from __future__ import absolute_import, division, print_function, unicode_literals +from tempfile import NamedTemporaryFile import codecs import os +import io import shutil import sys import tempfile @@ -2342,3 +2344,83 @@ def test_is_python_file_ioerror(tmpdir): does_not_exist = tmpdir.join('fake.txt') assert is_python_file(str(does_not_exist)) is False + + +def test_to_ensure_imports_are_brought_to_top_issue_651(): + test_input = ('from __future__ import absolute_import, unicode_literals\n' + '\n' + 'VAR = """\n' + 'multiline text\n' + '"""\n' + '\n' + 'from __future__ import unicode_literals\n' + 'from __future__ import absolute_import\n') + expected_output = ('from __future__ import absolute_import, unicode_literals\n' + '\n' + 'VAR = """\n' + 'multiline text\n' + '"""\n') + assert SortImports(file_contents=test_input).output == expected_output + + +def test_to_ensure_importing_from_imports_module_works_issue_662(): + test_input = ('@wraps(fun)\n' + 'def __inner(*args, **kwargs):\n' + ' from .imports import qualname\n' + ' warn(description=description or qualname(fun), deprecation=deprecation, removal=removal)\n') + assert SortImports(file_contents=test_input).output == test_input + + +def test_to_ensure_no_unexpected_changes_issue_666(): + test_input = ('from django.conf import settings\n' + 'from django.core.management import call_command\n' + 'from django.core.management.base import BaseCommand\n' + 'from django.utils.translation import ugettext_lazy as _\n' + '\n' + 'TEMPLATE = """\n' + '# This file is generated automatically with the management command\n' + '#\n' + '# manage.py bis_compile_i18n\n' + '#\n' + '# please dont change it manually.\n' + 'from django.utils.translation import ugettext_lazy as _\n' + '"""\n') + assert SortImports(file_contents=test_input).output == test_input + + +def test_to_ensure_tabs_dont_become_space_issue_665(): + test_input = ('import os\n' + '\n' + '\n' + 'def my_method():\n' + '\tpass\n') + assert SortImports(file_contents=test_input).output == test_input + + +def test_new_lines_are_preserved(): + with NamedTemporaryFile('w', suffix='py') as rn_newline: + with io.open(rn_newline.name, mode='w', newline='') as rn_newline_input: + rn_newline_input.write('import sys\r\nimport os\r\n') + rn_newline_input.flush() + SortImports(rn_newline.name) + with io.open(rn_newline.name, newline='') as rn_newline_file: + rn_newline_contents = rn_newline_file.read() + assert rn_newline_contents == 'import os\r\nimport sys\r\n' + + with NamedTemporaryFile('w', suffix='py') as r_newline: + with io.open(r_newline.name, mode='w', newline='') as r_newline_input: + r_newline_input.write('import sys\rimport os\r') + r_newline_input.flush() + SortImports(r_newline.name) + with io.open(r_newline.name, newline='') as r_newline_file: + r_newline_contents = r_newline_file.read() + assert r_newline_contents == 'import os\rimport sys\r' + + with NamedTemporaryFile('w', suffix='py') as n_newline: + with io.open(n_newline.name, mode='w', newline='') as n_newline_input: + n_newline_input.write('import sys\nimport os\n') + n_newline_input.flush() + SortImports(n_newline.name) + with io.open(n_newline.name, newline='') as n_newline_file: + n_newline_contents = n_newline_file.read() + assert n_newline_contents == 'import os\nimport sys\n'
