Hello community,

here is the log from the commit of package python-isort for openSUSE:Factory 
checked in at 2019-05-27 08:30:29
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-isort (Old)
 and      /work/SRC/openSUSE:Factory/.python-isort.new.5148 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-isort"

Mon May 27 08:30:29 2019 rev:11 rq:705236 version:4.3.20

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-isort/python-isort.changes        
2019-05-08 15:15:54.580914193 +0200
+++ /work/SRC/openSUSE:Factory/.python-isort.new.5148/python-isort.changes      
2019-05-27 08:30:30.479255226 +0200
@@ -1,0 +2,7 @@
+Fri May 24 12:12:26 UTC 2019 - [email protected]
+
+- version update to 4.3.20
+  - Fixed issue #948 - Pipe redirection broken on Python2.7
+  - Fixed issue #942 - correctly handle pyi (Python Template Files) to match 
`black` output
+
+-------------------------------------------------------------------

Old:
----
  isort-4.3.18.tar.gz

New:
----
  isort-4.3.20.tar.gz

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

Other differences:
------------------
++++++ python-isort.spec ++++++
--- /var/tmp/diff_new_pack.PhmbAJ/_old  2019-05-27 08:30:31.027255012 +0200
+++ /var/tmp/diff_new_pack.PhmbAJ/_new  2019-05-27 08:30:31.031255011 +0200
@@ -26,7 +26,7 @@
 %bcond_with test
 %endif
 Name:           python-isort%{psuffix}
-Version:        4.3.18
+Version:        4.3.20
 Release:        0
 Summary:        A Python utility / library to sort Python imports
 License:        MIT

++++++ isort-4.3.18.tar.gz -> isort-4.3.20.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/isort-4.3.18/CHANGELOG.md 
new/isort-4.3.20/CHANGELOG.md
--- old/isort-4.3.18/CHANGELOG.md       2019-05-02 07:17:09.000000000 +0200
+++ new/isort-4.3.20/CHANGELOG.md       2019-05-15 02:23:51.000000000 +0200
@@ -1,6 +1,12 @@
 Changelog
 =========
 
+### 4.3.20 - May 14, 2019 - hot fix release
+- Fixed issue #948 - Pipe redirection broken on Python2.7
+
+### 4.3.19 - May 12, 2019 - hot fix release
+- Fixed issue #942 - correctly handle pyi (Python Template Files) to match 
`black` output
+
 ### 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
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/isort-4.3.18/PKG-INFO new/isort-4.3.20/PKG-INFO
--- old/isort-4.3.18/PKG-INFO   2019-05-02 07:17:54.000000000 +0200
+++ new/isort-4.3.20/PKG-INFO   2019-05-15 02:24:39.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: isort
-Version: 4.3.18
+Version: 4.3.20
 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: requirements
-Provides-Extra: pyproject
 Provides-Extra: xdg_home
+Provides-Extra: pyproject
+Provides-Extra: requirements
 Provides-Extra: pipfile
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/isort-4.3.18/isort/__init__.py 
new/isort-4.3.20/isort/__init__.py
--- old/isort-4.3.18/isort/__init__.py  2019-05-02 07:17:09.000000000 +0200
+++ new/isort-4.3.20/isort/__init__.py  2019-05-15 02:23:51.000000000 +0200
@@ -25,4 +25,4 @@
 from . import settings  # noqa: F401
 from .isort import SortImports  # noqa: F401
 
-__version__ = "4.3.18"
+__version__ = "4.3.20"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/isort-4.3.18/isort/isort.py 
new/isort-4.3.20/isort/isort.py
--- old/isort-4.3.18/isort/isort.py     2019-05-02 07:17:09.000000000 +0200
+++ new/isort-4.3.20/isort/isort.py     2019-05-15 02:23:51.000000000 +0200
@@ -49,7 +49,7 @@
 
     def __init__(self, file_path=None, file_contents=None, file_=None, 
write_to_stdout=False, check=False,
                  show_diff=False, settings_path=None, ask_to_apply=False, 
run_path='', check_skip=True,
-                 **setting_overrides):
+                 extension=None, **setting_overrides):
         if not settings_path and file_path:
             settings_path = os.path.dirname(os.path.abspath(file_path))
         settings_path = settings_path or os.getcwd()
@@ -140,7 +140,7 @@
                 file_.seek(0)
                 self.file_encoding = coding_check(file_)
                 file_.seek(0)
-            except io.UnsupportedOperation:
+            except (io.UnsupportedOperation, IOError):
                 pass
             reader = codecs.getreader(self.file_encoding)
             file_contents = reader(file_).read()
@@ -181,6 +181,11 @@
                 self.in_lines.append(add_import)
         self.number_of_lines = len(self.in_lines)
 
+        if not extension:
+            self.extension = file_name.split('.')[-1] if file_name else "py"
+        else:
+            self.extension = extension
+
         self.out_lines = []
         self.comments = {'from': {}, 'straight': {}, 'nested': {}, 'above': 
{'straight': {}, 'from': {}}}
         self.imports = OrderedDict()
@@ -672,8 +677,10 @@
 
             if self.config['lines_after_imports'] != -1:
                 self.out_lines[imports_tail:0] = ["" for line in 
range(self.config['lines_after_imports'])]
-            elif next_construct.startswith("def ") or 
next_construct.startswith("class ") or \
-               next_construct.startswith("@") or 
next_construct.startswith("async def"):
+            elif self.extension != "pyi" and (next_construct.startswith("def 
") or
+                                              next_construct.startswith("class 
") or
+                                              next_construct.startswith("@") or
+                                              next_construct.startswith("async 
def")):
                 self.out_lines[imports_tail:0] = ["", ""]
             else:
                 self.out_lines[imports_tail:0] = [""]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/isort-4.3.18/isort.egg-info/PKG-INFO 
new/isort-4.3.20/isort.egg-info/PKG-INFO
--- old/isort-4.3.18/isort.egg-info/PKG-INFO    2019-05-02 07:17:53.000000000 
+0200
+++ new/isort-4.3.20/isort.egg-info/PKG-INFO    2019-05-15 02:24:39.000000000 
+0200
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: isort
-Version: 4.3.18
+Version: 4.3.20
 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: requirements
-Provides-Extra: pyproject
 Provides-Extra: xdg_home
+Provides-Extra: pyproject
+Provides-Extra: requirements
 Provides-Extra: pipfile
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/isort-4.3.18/setup.py new/isort-4.3.20/setup.py
--- old/isort-4.3.18/setup.py   2019-05-02 07:17:09.000000000 +0200
+++ new/isort-4.3.20/setup.py   2019-05-15 02:23:51.000000000 +0200
@@ -6,7 +6,7 @@
     readme = f.read()
 
 setup(name='isort',
-      version='4.3.18',
+      version='4.3.20',
       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.18/test_isort.py 
new/isort-4.3.20/test_isort.py
--- old/isort-4.3.18/test_isort.py      2019-05-02 07:17:09.000000000 +0200
+++ new/isort-4.3.20/test_isort.py      2019-05-15 02:23:51.000000000 +0200
@@ -2994,3 +2994,25 @@
                   '# Local imports\n'
                   'from oklib.plot_ok import imagesc\n')
     assert SortImports(file_contents=test_input, **config).output == test_input
+
+
+def test_pyi_formatting_issue_942(tmpdir):
+    test_input = ('import os\n'
+                  '\n'
+                  '\n'
+                  'def my_method():\n')
+    expected_py_output = test_input.splitlines()
+    expected_pyi_output = ('import os\n'
+                           '\n'
+                           'def my_method():\n').splitlines()
+    assert SortImports(file_contents=test_input).output.splitlines() == 
expected_py_output
+    assert SortImports(file_contents=test_input,
+                       extension="pyi").output.splitlines() == 
expected_pyi_output
+
+    source_py = tmpdir.join('source.py')
+    source_py.write(test_input)
+    assert SortImports(file_path=str(source_py)).output.splitlines() == 
expected_py_output
+
+    source_pyi = tmpdir.join('source.pyi')
+    source_pyi.write(test_input)
+    assert SortImports(file_path=str(source_pyi)).output.splitlines() == 
expected_pyi_output


Reply via email to