Hello community,

here is the log from the commit of package python-dephell-setuptools for 
openSUSE:Factory checked in at 2020-03-04 09:46:35
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-dephell-setuptools (Old)
 and      /work/SRC/openSUSE:Factory/.python-dephell-setuptools.new.26092 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-dephell-setuptools"

Wed Mar  4 09:46:35 2020 rev:2 rq:781256 version:0.2.3

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/python-dephell-setuptools/python-dephell-setuptools.changes
      2019-12-10 22:41:05.541838740 +0100
+++ 
/work/SRC/openSUSE:Factory/.python-dephell-setuptools.new.26092/python-dephell-setuptools.changes
   2020-03-04 09:47:05.990168533 +0100
@@ -1,0 +2,7 @@
+Tue Mar  3 14:29:59 UTC 2020 - Matej Cepl <[email protected]>
+
+- Update to 0.2.3:
+  - _pkginfo: Improve error handling
+  - Fix 'CommandReader' on Windows
+
+-------------------------------------------------------------------

Old:
----
  dephell_setuptools-0.2.1.tar.gz

New:
----
  dephell_setuptools-0.2.3.tar.gz

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

Other differences:
------------------
++++++ python-dephell-setuptools.spec ++++++
--- /var/tmp/diff_new_pack.2GBNvJ/_old  2020-03-04 09:47:06.670168940 +0100
+++ /var/tmp/diff_new_pack.2GBNvJ/_new  2020-03-04 09:47:06.670168940 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python-dephell-setuptools
 #
-# Copyright (c) 2019 SUSE LLC
+# Copyright (c) 2020 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -19,7 +19,7 @@
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 %define skip_python2 1
 Name:           python-dephell-setuptools
-Version:        0.2.1
+Version:        0.2.3
 Release:        0
 Summary:        Dephell plugin to extract meta information from setup.py
 License:        MIT

++++++ dephell_setuptools-0.2.1.tar.gz -> dephell_setuptools-0.2.3.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dephell_setuptools-0.2.1/PKG-INFO 
new/dephell_setuptools-0.2.3/PKG-INFO
--- old/dephell_setuptools-0.2.1/PKG-INFO       1970-01-01 01:00:00.000000000 
+0100
+++ new/dephell_setuptools-0.2.3/PKG-INFO       1970-01-01 01:00:00.000000000 
+0100
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: dephell-setuptools
-Version: 0.2.1
+Version: 0.2.3
 Summary: Read metainfo from setup.py
 Home-Page: https://github.com/dephell/dephell_setuptools
 Author: Gram (@orsinium)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/dephell_setuptools-0.2.1/dephell_setuptools/__init__.py 
new/dephell_setuptools-0.2.3/dephell_setuptools/__init__.py
--- old/dephell_setuptools-0.2.1/dephell_setuptools/__init__.py 2019-11-14 
16:26:42.000000000 +0100
+++ new/dephell_setuptools-0.2.3/dephell_setuptools/__init__.py 2019-12-30 
14:40:21.000000000 +0100
@@ -9,7 +9,7 @@
 from ._static import StaticReader
 
 
-__version__ = '0.2.1'
+__version__ = '0.2.3'
 
 
 __all__ = [
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dephell_setuptools-0.2.1/dephell_setuptools/_cmd.py 
new/dephell_setuptools-0.2.3/dephell_setuptools/_cmd.py
--- old/dephell_setuptools-0.2.1/dephell_setuptools/_cmd.py     2019-11-14 
16:24:44.000000000 +0100
+++ new/dephell_setuptools-0.2.3/dephell_setuptools/_cmd.py     2019-12-30 
14:40:20.000000000 +0100
@@ -6,7 +6,7 @@
 from contextlib import contextmanager
 from distutils.core import Command
 from pathlib import Path
-from tempfile import NamedTemporaryFile
+from tempfile import mkstemp
 from typing import Any, Dict
 
 # app
@@ -25,31 +25,46 @@
         os.chdir(old_path)
 
 
+@contextmanager
+def tmpfile():
+    fd, path = mkstemp()
+    os.close(fd)
+    try:
+        yield Path(path)
+    finally:
+        os.unlink(path)
+
+
 class CommandReader(BaseReader):
     @cached_property
     def content(self) -> Dict[str, Any]:
         # generate a temporary json file which contains the metadata
-        output_json = NamedTemporaryFile()
-        cmd = [
-            sys.executable,
-            self.path.name,
-            '-q',
-            '--command-packages', 'dephell_setuptools',
-            'distutils_cmd',
-            '-o', output_json.name,
-        ]
-        with cd(self.path.parent):
-            result = subprocess.run(
-                cmd,
-                stderr=subprocess.PIPE,
-                stdout=subprocess.PIPE,
-                env={'PYTHONPATH': str(Path(__file__).parent.parent)},
-            )
-        if result.returncode != 0:
-            raise RuntimeError(result.stderr.decode().strip().split('\n')[-1])
+        with tmpfile() as output_json:
+            cmd = [
+                sys.executable,
+                self.path.name,
+                '-q',
+                '--command-packages', 'dephell_setuptools',
+                'distutils_cmd',
+                '-o', str(output_json),
+            ]
+            with cd(self.path.parent):
+                env = {'PYTHONPATH': str(Path(__file__).parent.parent)}
+                if sys.platform == 'win32':
+                    env['SystemRoot'] = os.environ['SystemRoot']
+
+                result = subprocess.run(
+                    cmd,
+                    stderr=subprocess.PIPE,
+                    stdout=subprocess.PIPE,
+                    env=env,
+                )
+            if result.returncode != 0:
+                raise 
RuntimeError(result.stderr.decode().strip().split('\n')[-1])
+
+            with output_json.open() as stream:
+                content = json.load(stream)
 
-        with open(output_json.name) as stream:
-            content = json.load(stream)
         return self._clean(content)
 
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/dephell_setuptools-0.2.1/dephell_setuptools/_pkginfo.py 
new/dephell_setuptools-0.2.3/dephell_setuptools/_pkginfo.py
--- old/dephell_setuptools-0.2.1/dephell_setuptools/_pkginfo.py 2019-11-14 
15:00:35.000000000 +0100
+++ new/dephell_setuptools-0.2.3/dephell_setuptools/_pkginfo.py 2019-12-27 
16:09:41.000000000 +0100
@@ -17,6 +17,15 @@
         cmd = ['pkginfo', '--json', str(self.path)]
         result = subprocess.run(cmd, stderr=subprocess.PIPE, 
stdout=subprocess.PIPE)
         if result.returncode != 0:
-            raise RuntimeError(result.stderr.decode().split('\n')[-1])
-        content = json.loads(result.stdout.decode())
+            msg_lines = result.stderr.decode().rstrip().split('\n')
+            raise RuntimeError(msg_lines[-1] if msg_lines else 'Unknown error')
+        stdout = result.stdout.decode()
+        if not stdout:
+            return {}
+
+        try:
+            content = json.loads(stdout)
+        except json.decoder.JSONDecodeError:
+            return {}
+
         return self._clean(content)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/dephell_setuptools-0.2.1/dephell_setuptools.egg-info/PKG-INFO 
new/dephell_setuptools-0.2.3/dephell_setuptools.egg-info/PKG-INFO
--- old/dephell_setuptools-0.2.1/dephell_setuptools.egg-info/PKG-INFO   
1970-01-01 01:00:00.000000000 +0100
+++ new/dephell_setuptools-0.2.3/dephell_setuptools.egg-info/PKG-INFO   
1970-01-01 01:00:00.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: dephell-setuptools
-Version: 0.2.1
+Version: 0.2.3
 Summary: Read metainfo from setup.py
 Home-Page: https://github.com/dephell/dephell_setuptools
 Author: Gram (@orsinium)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dephell_setuptools-0.2.1/setup.py 
new/dephell_setuptools-0.2.3/setup.py
--- old/dephell_setuptools-0.2.1/setup.py       2019-11-14 16:26:46.000000000 
+0100
+++ new/dephell_setuptools-0.2.3/setup.py       2019-12-30 14:40:23.000000000 
+0100
@@ -21,7 +21,7 @@
 setup(
     long_description=readme,
     name='dephell_setuptools',
-    version='0.2.1',
+    version='0.2.3',
     description='Read metainfo from setup.py',
     python_requires='>=3.5',
     project_urls={"homepage": "https://github.com/dephell/dephell_setuptools"},


Reply via email to