Hello community,
here is the log from the commit of package python-isort for openSUSE:Factory checked in at 2019-05-08 15:15:53
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-isort (Old)
and /work/SRC/openSUSE:Factory/.python-isort.new.5148 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-isort"
Wed May 8 15:15:53 2019 rev:10 rq:701237 version:4.3.18
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-isort/python-isort.changes 2019-03-29 20:34:33.214632054 +0100
+++ /work/SRC/openSUSE:Factory/.python-isort.new.5148/python-isort.changes 2019-05-08 15:15:54.580914193 +0200
@@ -1,0 +2,36 @@
+Tue May 7 08:06:20 UTC 2019 - Tomáš Chvátal
+
+- Again tweak failing tests
+
+-------------------------------------------------------------------
+Fri May 3 18:09:41 UTC 2019 - Sebastian Wagner
+
+- update to 4.3.18:
+ - Fixed an issue with parsing files that contain unicode characters in Python 2
+ - Fixed issue #924 - Pulling in pip internals causes depreciation warning
+ - Fixed issue #938 - Providing a way to filter explicitly passed in files via configuration settings (`--filter-files`)
+ - Improved interoperability with toml configuration files
+
+-------------------------------------------------------------------
+Mon Apr 29 22:13:28 CEST 2019 - Matej Cepl
+
+- skip failing tests
+- Update to 4.3.17:
+ - Fixed issue #905 & #919: Import section headers behaving
+ strangely
+
+-------------------------------------------------------------------
+Fri Mar 29 09:41:35 UTC 2019 - Tomáš Chvátal
+
+- Add missing recommended dependencies
+
+-------------------------------------------------------------------
+Sun Mar 24 08:31:58 UTC 2019 - Sebastian Wagner
+
+- update to version 4.3.16:
+ - Fixed issue #909 - skip and skip-glob are not enforced when using settings-path.
+ - Fixed issue #907 - appdirs optional requirement does not correctly specify version
+ - Fixed issue #902 - Too broad warning about missing toml package
+ - Fixed issue #778 - remove `user` from known standard library as it's no longer in any supported Python version.
+
+-------------------------------------------------------------------
Old:
----
isort-4.3.15.tar.gz
New:
----
isort-4.3.18.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-isort.spec ++++++
--- /var/tmp/diff_new_pack.hxhdfw/_old 2019-05-08 15:15:55.880917088 +0200
+++ /var/tmp/diff_new_pack.hxhdfw/_new 2019-05-08 15:15:55.908917151 +0200
@@ -26,24 +26,35 @@
%bcond_with test
%endif
Name: python-isort%{psuffix}
-Version: 4.3.15
+Version: 4.3.18
Release: 0
Summary: A Python utility / library to sort Python imports
License: MIT
Group: Development/Languages/Python
URL: https://github.com/timothycrosley/isort
Source: https://files.pythonhosted.org/packages/source/i/isort/isort-%{version}.tar.gz
+BuildRequires: %{python_module setuptools}
+BuildRequires: fdupes
+BuildRequires: python-futures
+BuildRequires: python-rpm-macros
+Requires: python-setuptools
+Recommends: python-appdirs >= 1.4.0
+Recommends: python-pip
+Recommends: python-pipreqs
+Recommends: python-requirementslib
+Recommends: python-toml
+BuildArch: noarch
%if %{with test}
+BuildRequires: %{python_module appdirs >= 1.4.0}
BuildRequires: %{python_module mock}
+BuildRequires: %{python_module pipreqs}
+BuildRequires: %{python_module pip}
BuildRequires: %{python_module pylama}
BuildRequires: %{python_module pytest}
+BuildRequires: %{python_module requirementslib}
+BuildRequires: %{python_module toml}
BuildRequires: python-backports.functools_lru_cache
%endif
-BuildRequires: %{python_module setuptools}
-BuildRequires: fdupes
-BuildRequires: python-futures
-BuildRequires: python-rpm-macros
-BuildArch: noarch
%ifpython2
Requires: python-backports.functools_lru_cache
Requires: python-futures
@@ -74,7 +85,7 @@
%check
%if %{with test}
-%python_expand py.test-%{$python_bin_suffix} -v
+%pytest -k 'not (test_settings_path_skip_issue_909 or test_standard_library_deprecates_user_issue_778 or test_skip_paths_issue_938 or test_requirements_finder)'
%endif
%if !%{with test}
++++++ isort-4.3.15.tar.gz -> isort-4.3.18.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/isort-4.3.15/CHANGELOG.md new/isort-4.3.18/CHANGELOG.md
--- old/isort-4.3.15/CHANGELOG.md 2019-03-11 06:25:21.000000000 +0100
+++ new/isort-4.3.18/CHANGELOG.md 2019-05-02 07:17:09.000000000 +0200
@@ -1,5 +1,21 @@
Changelog
=========
+
+### 4.3.18 - May 1, 2019 - hot fix release
+- Fixed an issue with parsing files that contain unicode characters in Python 2
+- Fixed issue #924 - Pulling in pip internals causes depreciation warning
+- Fixed issue #938 - Providing a way to filter explicitly passed in files via configuration settings (`--filter-files`)
+- Improved interoperability with toml configuration files
+
+### 4.3.17 - April 7, 2019 - hot fix release
+- Fixed issue #905 & #919: Import section headers behaving strangely
+
+### 4.3.16 - March 23, 2019 - hot fix release
+- Fixed issue #909 - skip and skip-glob are not enforced when using settings-path.
+- Fixed issue #907 - appdirs optional requirement does not correctly specify version
+- Fixed issue #902 - Too broad warning about missing toml package
+- Fixed issue #778 - remove `user` from known standard library as it's no longer in any supported Python version.
+
### 4.3.15 - March 10, 2019 - hot fix release
- Fixed a regression with handling streaming input from pipes (Issue #895)
- Fixed handling of \x0c whitespace character (Issue #811)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/isort-4.3.15/PKG-INFO new/isort-4.3.18/PKG-INFO
--- old/isort-4.3.15/PKG-INFO 2019-03-11 06:25:58.000000000 +0100
+++ new/isort-4.3.18/PKG-INFO 2019-05-02 07:17:54.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: isort
-Version: 4.3.15
+Version: 4.3.18
Summary: A Python utility / library to sort Python imports.
Home-page: https://github.com/timothycrosley/isort
Author: Timothy Crosley
@@ -366,6 +366,7 @@
...
Note: to change the how constant indents appear - simply change the indent property with the following accepted formats:
+
* Number of spaces you would like. For example: 4 would cause standard 4 space indentation.
* Tab
* A verbatim string with quotes around it.
@@ -681,6 +682,6 @@
Classifier: Topic :: Utilities
Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*
Provides-Extra: requirements
-Provides-Extra: pipfile
Provides-Extra: pyproject
Provides-Extra: xdg_home
+Provides-Extra: pipfile
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/isort-4.3.15/README.rst new/isort-4.3.18/README.rst
--- old/isort-4.3.15/README.rst 2019-03-11 06:25:21.000000000 +0100
+++ new/isort-4.3.18/README.rst 2019-05-02 07:17:09.000000000 +0200
@@ -358,6 +358,7 @@
...
Note: to change the how constant indents appear - simply change the indent property with the following accepted formats:
+
* Number of spaces you would like. For example: 4 would cause standard 4 space indentation.
* Tab
* A verbatim string with quotes around it.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/isort-4.3.15/isort/__init__.py new/isort-4.3.18/isort/__init__.py
--- old/isort-4.3.15/isort/__init__.py 2019-03-11 06:25:21.000000000 +0100
+++ new/isort-4.3.18/isort/__init__.py 2019-05-02 07:17:09.000000000 +0200
@@ -25,4 +25,4 @@
from . import settings # noqa: F401
from .isort import SortImports # noqa: F401
-__version__ = "4.3.15"
+__version__ = "4.3.18"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/isort-4.3.15/isort/finders.py new/isort-4.3.18/isort/finders.py
--- old/isort-4.3.15/isort/finders.py 2019-03-11 06:25:21.000000000 +0100
+++ new/isort-4.3.18/isort/finders.py 2019-05-02 07:17:09.000000000 +0200
@@ -20,15 +20,9 @@
pipreqs = None
try:
- # pip>=10
- from pip._internal.download import PipSession
- from pip._internal.req import parse_requirements
+ from pip_api import parse_requirements
except ImportError:
- try:
- from pip.download import PipSession
- from pip.req import parse_requirements
- except ImportError:
- parse_requirements = None
+ parse_requirements = None
try:
from requirementslib import Pipfile
@@ -321,8 +315,8 @@
results = []
with chdir(os.path.dirname(path)):
- requirements = parse_requirements(path, session=PipSession())
- for req in requirements:
+ requirements = parse_requirements(path)
+ for req in requirements.values():
if req.name:
results.append(req.name)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/isort-4.3.15/isort/isort.py new/isort-4.3.18/isort/isort.py
--- old/isort-4.3.15/isort/isort.py 2019-03-11 06:25:21.000000000 +0100
+++ new/isort-4.3.18/isort/isort.py 2019-05-02 07:17:09.000000000 +0200
@@ -236,6 +236,8 @@
if show_diff or self.config['show_diff']:
self._show_diff(file_contents)
elif write_to_stdout:
+ if sys.version_info[0] < 3:
+ self.output = self.output.encode(self.file_encoding)
sys.stdout.write(self.output)
elif file_name and not check:
if self.output == file_contents:
@@ -829,7 +831,7 @@
self._in_top_comment = True
return True
elif self._in_top_comment:
- if not line.startswith("#"):
+ if not line.startswith("#") or line in self._section_comments:
self._in_top_comment = False
self._first_comment_index_end = self.index - 1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/isort-4.3.15/isort/main.py new/isort-4.3.18/isort/main.py
--- old/isort-4.3.15/isort/main.py 2019-03-11 06:25:21.000000000 +0100
+++ new/isort-4.3.18/isort/main.py 2019-05-02 07:17:09.000000000 +0200
@@ -296,6 +296,8 @@
'where it may not be safe to operate in')
parser.add_argument('--case-sensitive', dest='case_sensitive', action='store_true',
help='Tells isort to include casing when sorting module names')
+ parser.add_argument('--filter-files', dest='filter_files', action='store_true',
+ help='Tells isort to filter files even when they are explicitly passed in as part of the command')
parser.add_argument('files', nargs='*', help='One or more Python source files that need their imports sorted.')
arguments = {key: value for key, value in vars(parser.parse_args(argv)).items() if value}
@@ -345,10 +347,21 @@
arguments['recursive'] = True
if not arguments.get('apply', False):
arguments['ask_to_apply'] = True
- config = from_path(os.path.abspath(file_names[0]) or os.getcwd()).copy()
+
+ config = from_path(arguments.get('settings_path', '') or os.path.abspath(file_names[0]) or os.getcwd()).copy()
config.update(arguments)
wrong_sorted_files = False
skipped = []
+
+ if config.get('filter_files'):
+ filtered_files = []
+ for file_name in file_names:
+ if should_skip(file_name, config):
+ skipped.append(file_name)
+ else:
+ filtered_files.append(file_name)
+ file_names = filtered_files
+
if arguments.get('recursive', False):
file_names = iter_source_code(file_names, config, skipped)
num_skipped = 0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/isort-4.3.15/isort/settings.py new/isort-4.3.18/isort/settings.py
--- old/isort-4.3.15/isort/settings.py 2019-03-11 06:25:21.000000000 +0100
+++ new/isort-4.3.18/isort/settings.py 2019-05-02 07:17:09.000000000 +0200
@@ -117,7 +117,7 @@
'test', 'textwrap', 'this', 'thread', 'threading', 'time', 'timeit', 'tkinter',
'token', 'tokenize', 'trace', 'traceback', 'tracemalloc', 'ttk', 'tty', 'turtle',
'turtledemo', 'types', 'typing', 'unicodedata', 'unittest', 'urllib', 'urllib2',
- 'urlparse', 'user', 'usercustomize', 'uu', 'uuid', 'venv', 'videoreader',
+ 'urlparse', 'usercustomize', 'uu', 'uuid', 'venv', 'videoreader',
'warnings', 'wave', 'weakref', 'webbrowser', 'whichdb', 'winreg', 'winsound',
'wsgiref', 'xdrlib', 'xml', 'xmlrpc', 'xmlrpclib', 'zipapp', 'zipfile',
'zipimport', 'zlib'],
@@ -262,7 +262,10 @@
def _as_list(value):
- return filter(bool, [item.strip() for item in value.replace('\n', ',').split(',')])
+ if not isinstance(value, list):
+ value = value.replace('\n', ',').split(',')
+
+ return filter(bool, [item.strip() for item in value])
def _abspaths(cwd, values):
@@ -289,10 +292,10 @@
config_section = config_section.get(key, {})
settings.update(config_section)
else:
- warnings.warn(
- "Found %s but toml package is not installed. To configure "
- "isort with %s, install with 'isort[pyproject]'." % (file_path, file_path)
- )
+ if '[tool.isort]' in config_file.read():
+ warnings.warn("Found {} with [tool.isort] section, but toml package is not installed. "
+ "To configure isort with {}, install with 'isort[pyproject]'.".format(file_path,
+ file_path))
else:
if file_path.endswith('.editorconfig'):
line = '\n'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/isort-4.3.15/isort.egg-info/PKG-INFO new/isort-4.3.18/isort.egg-info/PKG-INFO
--- old/isort-4.3.15/isort.egg-info/PKG-INFO 2019-03-11 06:25:58.000000000 +0100
+++ new/isort-4.3.18/isort.egg-info/PKG-INFO 2019-05-02 07:17:53.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: isort
-Version: 4.3.15
+Version: 4.3.18
Summary: A Python utility / library to sort Python imports.
Home-page: https://github.com/timothycrosley/isort
Author: Timothy Crosley
@@ -366,6 +366,7 @@
...
Note: to change the how constant indents appear - simply change the indent property with the following accepted formats:
+
* Number of spaces you would like. For example: 4 would cause standard 4 space indentation.
* Tab
* A verbatim string with quotes around it.
@@ -681,6 +682,6 @@
Classifier: Topic :: Utilities
Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*
Provides-Extra: requirements
-Provides-Extra: pipfile
Provides-Extra: pyproject
Provides-Extra: xdg_home
+Provides-Extra: pipfile
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/isort-4.3.15/isort.egg-info/requires.txt new/isort-4.3.18/isort.egg-info/requires.txt
--- old/isort-4.3.15/isort.egg-info/requires.txt 2019-03-11 06:25:58.000000000 +0100
+++ new/isort-4.3.18/isort.egg-info/requires.txt 2019-05-02 07:17:53.000000000 +0200
@@ -11,8 +11,8 @@
toml
[requirements]
-pip
pipreqs
+pip-api
[xdg_home]
-appdirs
+appdirs>=1.4.0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/isort-4.3.15/setup.py new/isort-4.3.18/setup.py
--- old/isort-4.3.15/setup.py 2019-03-11 06:25:21.000000000 +0100
+++ new/isort-4.3.18/setup.py 2019-05-02 07:17:09.000000000 +0200
@@ -6,7 +6,7 @@
readme = f.read()
setup(name='isort',
- version='4.3.15',
+ version='4.3.18',
description='A Python utility / library to sort Python imports.',
long_description=readme,
author='Timothy Crosley',
@@ -24,8 +24,8 @@
extras_require={
'pipfile': ['pipreqs', 'requirementslib'],
'pyproject': ['toml'],
- 'requirements': ['pip', 'pipreqs'],
- 'xdg_home': ['appdirs'],
+ 'requirements': ['pipreqs', 'pip-api'],
+ 'xdg_home': ['appdirs>=1.4.0'],
},
install_requires=[
'futures; python_version < "3.2"',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/isort-4.3.15/test_isort.py new/isort-4.3.18/test_isort.py
--- old/isort-4.3.15/test_isort.py 2019-03-11 06:25:21.000000000 +0100
+++ new/isort-4.3.18/test_isort.py 2019-05-02 07:17:09.000000000 +0200
@@ -23,21 +23,22 @@
"""
from __future__ import absolute_import, division, print_function, unicode_literals
-from tempfile import NamedTemporaryFile
import io
import os
import os.path
import posixpath
import sys
import sysconfig
+from subprocess import check_output
+from tempfile import NamedTemporaryFile
import pytest
from isort import finders, main, settings
from isort.isort import SortImports
-from isort.utils import exists_case_sensitive
from isort.main import is_python_file
from isort.settings import WrapModes
+from isort.utils import exists_case_sensitive
try:
import toml
@@ -2572,8 +2573,6 @@
os.remove(n_newline.name)
-@pytest.mark.skipif(not finders.RequirementsFinder.enabled, reason='RequirementsFinder not enabled (too old version of pip?)')
-@pytest.mark.skipif(not finders.pipreqs, reason='pipreqs is missing')
def test_requirements_finder(tmpdir):
subdir = tmpdir.mkdir('subdir').join("lol.txt")
subdir.write("flask")
@@ -2593,7 +2592,7 @@
files = list(finder._get_files())
assert len(files) == 1 # file finding
assert files[0].endswith('requirements.txt') # file finding
- assert list(finder._get_names(str(req_file))) == ['Django', 'deal'] # file parsing
+ assert set(finder._get_names(str(req_file))) == {'Django', 'deal'} # file parsing
assert finder.find("django") == si.sections.THIRDPARTY # package in reqs
assert finder.find("flask") is None # package not in reqs
@@ -2650,8 +2649,6 @@
"""
-@pytest.mark.skipif(not finders.PipfileFinder.enabled, reason='PipfileFinder not enabled (missing requirementslib?)')
-@pytest.mark.skipif(not finders.pipreqs, reason='pipreqs is missing')
def test_pipfile_finder(tmpdir):
pipfile = tmpdir.join('Pipfile')
pipfile.write(PIPFILE)
@@ -2888,3 +2885,112 @@
out, err = capsys.readouterr()
assert out == ''
assert err == ''
+
+
+def test_settings_path_skip_issue_909(tmpdir):
+ base_dir = tmpdir.mkdir('project')
+ config_dir = base_dir.mkdir('conf')
+ config_dir.join('.isort.cfg').write('[isort]\n'
+ 'skip =\n'
+ ' file_to_be_skipped.py\n'
+ 'skip_glob =\n'
+ ' *glob_skip*\n')
+
+ base_dir.join('file_glob_skip.py').write('import os\n'
+ '\n'
+ 'print("Hello World")\n'
+ '\n'
+ 'import sys\n')
+ base_dir.join('file_to_be_skipped.py').write('import os\n'
+ '\n'
+ 'print("Hello World")'
+ '\n'
+ 'import sys\n')
+
+ test_run_directory = os.getcwd()
+ os.chdir(str(base_dir))
+ with pytest.raises(Exception): # without the settings path provided: the command should not skip & identify errors
+ check_output(['isort', '--check-only'])
+ results = check_output(['isort', '--check-only', '--settings-path=conf/.isort.cfg'])
+ os.chdir(str(test_run_directory))
+
+ assert b'skipped 2' in results.lower()
+
+
+def test_skip_paths_issue_938(tmpdir):
+ base_dir = tmpdir.mkdir('project')
+ config_dir = base_dir.mkdir('conf')
+ config_dir.join('.isort.cfg').write('[isort]\n'
+ 'line_length = 88\n'
+ 'multi_line_output = 4\n'
+ 'lines_after_imports = 2\n'
+ 'skip_glob =\n'
+ ' migrations/**.py\n')
+ base_dir.join('dont_skip.py').write('import os\n'
+ '\n'
+ 'print("Hello World")'
+ '\n'
+ 'import sys\n')
+
+ migrations_dir = base_dir.mkdir('migrations')
+ migrations_dir.join('file_glob_skip.py').write('import os\n'
+ '\n'
+ 'print("Hello World")\n'
+ '\n'
+ 'import sys\n')
+
+ test_run_directory = os.getcwd()
+ os.chdir(str(base_dir))
+ results = check_output(['isort', 'dont_skip.py', 'migrations/file_glob_skip.py'])
+ os.chdir(str(test_run_directory))
+
+ assert b'skipped' not in results.lower()
+
+ os.chdir(str(base_dir))
+ results = check_output(['isort', '--filter-files', '--settings-path=conf/.isort.cfg', 'dont_skip.py', 'migrations/file_glob_skip.py'])
+ os.chdir(str(test_run_directory))
+
+ assert b'skipped 1' in results.lower()
+
+
+def test_standard_library_deprecates_user_issue_778():
+ test_input = ('import os\n'
+ '\n'
+ 'import user\n')
+ assert SortImports(file_contents=test_input).output == test_input
+
+
+def test_failing_file_check_916():
+ test_input = ('#!/usr/bin/env python\n'
+ '# -*- coding: utf-8 -*-\n'
+ 'from __future__ import unicode_literals\n')
+ expected_output = ('#!/usr/bin/env python\n'
+ '# -*- coding: utf-8 -*-\n'
+ '# FUTURE\n'
+ 'from __future__ import unicode_literals\n')
+ settings = {'known_future_library': 'future',
+ 'import_heading_future': 'FUTURE',
+ 'sections': ['FUTURE', 'STDLIB', 'NORDIGEN', 'FIRSTPARTY', 'THIRDPARTY', 'LOCALFOLDER'],
+ 'indent': ' ',
+ 'multi_line_output': 3,
+ 'lines_after_imports': 2}
+ assert SortImports(file_contents=test_input, **settings).output == expected_output
+ assert SortImports(file_contents=expected_output, **settings).output == expected_output
+ assert not SortImports(file_contents=expected_output, check=True, **settings).incorrectly_sorted
+
+
+def test_import_heading_issue_905():
+ config = {'import_heading_stdlib': 'Standard library imports',
+ 'import_heading_thirdparty': 'Third party imports',
+ 'import_heading_firstparty': 'Local imports',
+ 'known_third_party': ['numpy'],
+ 'known_first_party': ['oklib']}
+ test_input = ('# Standard library imports\n'
+ 'import os.path as osp\n'
+ '\n'
+ '# Third party imports\n'
+ 'import numpy as np\n'
+ '\n'
+ '# Local imports\n'
+ 'from oklib.plot_ok import imagesc\n')
+ assert SortImports(file_contents=test_input, **config).output == test_input