Hello community,

here is the log from the commit of package python-distro for openSUSE:Leap:15.2 
checked in at 2020-04-20 12:54:59
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Leap:15.2/python-distro (Old)
 and      /work/SRC/openSUSE:Leap:15.2/.python-distro.new.2738 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-distro"

Mon Apr 20 12:54:59 2020 rev:23 rq:793646 version:1.5.0

Changes:
--------
--- /work/SRC/openSUSE:Leap:15.2/python-distro/python-distro.changes    
2020-03-09 18:04:41.304797347 +0100
+++ /work/SRC/openSUSE:Leap:15.2/.python-distro.new.2738/python-distro.changes  
2020-04-20 12:55:16.580708491 +0200
@@ -1,0 +2,11 @@
+Thu Apr  2 04:18:04 UTC 2020 - Steve Kowalik <steven.kowa...@suse.com>
+
+- Update to 1.5.0:
+  * Backward Compatibility:
+    + Keep output as native string so we can compatible with python2 interface
+  * Bug Fixes:
+    + Fix detection of RHEL 6 ComputeNode [#255]
+    + Fix Oracle 4/5 lsb_release id and names [#250]
+    + Ignore /etc/plesk-release file while parsing distribution
+
+-------------------------------------------------------------------

Old:
----
  distro-1.4.0.tar.gz

New:
----
  distro-1.5.0.tar.gz

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

Other differences:
------------------
++++++ python-distro.spec ++++++
--- /var/tmp/diff_new_pack.3OjrVt/_old  2020-04-20 12:55:16.944709063 +0200
+++ /var/tmp/diff_new_pack.3OjrVt/_new  2020-04-20 12:55:16.948709069 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package python-distro
 #
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# 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
@@ -20,7 +20,7 @@
 %{!?license: %global license %doc}
 %bcond_without test
 Name:           python-distro
-Version:        1.4.0
+Version:        1.5.0
 Release:        0
 Summary:        Linux Distribution - a Linux OS platform information API
 License:        Apache-2.0

++++++ distro-1.4.0.tar.gz -> distro-1.5.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/distro-1.4.0/CHANGELOG.md 
new/distro-1.5.0/CHANGELOG.md
--- old/distro-1.4.0/CHANGELOG.md       2019-02-04 09:56:19.000000000 +0100
+++ new/distro-1.5.0/CHANGELOG.md       2020-03-30 23:11:09.000000000 +0200
@@ -1,3 +1,24 @@
+## 1.5.0 (2020.3.30)
+
+BACKWARD COMPATIBILITY:
+* Keep output as native string so we can compatible with python2 interface 
[[#248](https://github.com/nir0s/distro/pull/248)]
+
+ENHANCEMENTS:
+
+BUG FIXES:
+* Fix detection of RHEL 6 ComputeNode 
[[#255](https://github.com/nir0s/distro/issues/255)]
+* Fix Oracle 4/5 lsb_release id and names 
[[#250](https://github.com/nir0s/distro/pull/250)]
+* Ignore /etc/plesk-release file while parsing distribution 
[[#246](https://github.com/nir0s/distro/pull/246)]
+
+TESTS:
+* Test on MidnightBSD [[#254](https://github.com/nir0s/distro/issues/254)]
+
+RELEASE:
+* Remove build testing on Python 3.3 and add pypy 3.5 and Python 3.7 and 3.8 
[[#244](https://github.com/nir0s/distro/pull/244)]
+* Fix Windows build due to Appveyor not supporting builds on Python 2.7 
anymore [[#257](https://github.com/nir0s/distro/pull/257)]
+
+Additionally, The Python2.6 branch was fixed to support distro version 1.4.0. 
It is now passing all tests. Thanks [abadger](https://github.com/abadger)!
+
 ## 1.4.0 (2019.2.4)
 
 BACKWARD COMPATIBILITY:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/distro-1.4.0/PKG-INFO new/distro-1.5.0/PKG-INFO
--- old/distro-1.4.0/PKG-INFO   2019-02-04 09:56:28.000000000 +0100
+++ new/distro-1.5.0/PKG-INFO   2020-03-30 23:22:37.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: distro
-Version: 1.4.0
+Version: 1.5.0
 Summary: Distro - an OS platform information API
 Home-page: https://github.com/nir0s/distro
 Author: Nir Cohen
@@ -163,6 +163,8 @@
 Classifier: Programming Language :: Python :: 3.4
 Classifier: Programming Language :: Python :: 3.5
 Classifier: Programming Language :: Python :: 3.6
+Classifier: Programming Language :: Python :: 3.7
+Classifier: Programming Language :: Python :: 3.8
 Classifier: Topic :: Software Development :: Libraries :: Python Modules
 Classifier: Topic :: System :: Operating System
 Description-Content-Type: text/markdown
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/distro-1.4.0/distro.egg-info/PKG-INFO 
new/distro-1.5.0/distro.egg-info/PKG-INFO
--- old/distro-1.4.0/distro.egg-info/PKG-INFO   2019-02-04 09:56:28.000000000 
+0100
+++ new/distro-1.5.0/distro.egg-info/PKG-INFO   2020-03-30 23:22:37.000000000 
+0200
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: distro
-Version: 1.4.0
+Version: 1.5.0
 Summary: Distro - an OS platform information API
 Home-page: https://github.com/nir0s/distro
 Author: Nir Cohen
@@ -163,6 +163,8 @@
 Classifier: Programming Language :: Python :: 3.4
 Classifier: Programming Language :: Python :: 3.5
 Classifier: Programming Language :: Python :: 3.6
+Classifier: Programming Language :: Python :: 3.7
+Classifier: Programming Language :: Python :: 3.8
 Classifier: Topic :: Software Development :: Libraries :: Python Modules
 Classifier: Topic :: System :: Operating System
 Description-Content-Type: text/markdown
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/distro-1.4.0/distro.egg-info/SOURCES.txt 
new/distro-1.5.0/distro.egg-info/SOURCES.txt
--- old/distro-1.4.0/distro.egg-info/SOURCES.txt        2019-02-04 
09:56:28.000000000 +0100
+++ new/distro-1.5.0/distro.egg-info/SOURCES.txt        2020-03-30 
23:22:37.000000000 +0200
@@ -97,6 +97,7 @@
 tests/resources/distros/manjaro1512/etc/lsb-release
 tests/resources/distros/manjaro1512/etc/manjaro-release
 tests/resources/distros/manjaro1512/etc/os-release
+tests/resources/distros/midnightbsd12/bin/uname
 tests/resources/distros/netbsd711/bin/uname
 tests/resources/distros/openbsd62/bin/uname
 tests/resources/distros/openelec6/etc/os-release
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/distro-1.4.0/distro.py new/distro-1.5.0/distro.py
--- old/distro-1.4.0/distro.py  2019-02-04 09:25:26.000000000 +0100
+++ new/distro-1.5.0/distro.py  2020-03-30 22:35:18.000000000 +0200
@@ -49,7 +49,7 @@
 #:
 #: * Value: Normalized value.
 NORMALIZED_OS_ID = {
-    'ol': 'oracle',  # Oracle Enterprise Linux
+    'ol': 'oracle',  # Oracle Linux
 }
 
 #: Translation table for normalizing the "Distributor ID" attribute returned by
@@ -60,9 +60,11 @@
 #:
 #: * Value: Normalized value.
 NORMALIZED_LSB_ID = {
-    'enterpriseenterprise': 'oracle',  # Oracle Enterprise Linux
+    'enterpriseenterpriseas': 'oracle',  # Oracle Enterprise Linux 4
+    'enterpriseenterpriseserver': 'oracle',  # Oracle Linux 5
     'redhatenterpriseworkstation': 'rhel',  # RHEL 6, 7 Workstation
     'redhatenterpriseserver': 'rhel',  # RHEL 6, 7 Server
+    'redhatenterprisecomputenode': 'rhel',  # RHEL 6 ComputeNode
 }
 
 #: Translation table for normalizing the distro ID derived from the file name
@@ -90,7 +92,8 @@
     'lsb-release',
     'oem-release',
     _OS_RELEASE_BASENAME,
-    'system-release'
+    'system-release',
+    'plesk-release',
 )
 
 
@@ -163,6 +166,7 @@
     "openbsd"       OpenBSD
     "netbsd"        NetBSD
     "freebsd"       FreeBSD
+    "midnightbsd"   MidnightBSD
     ==============  =========================================
 
     If you have a need to get distros for reliable IDs added into this set,
@@ -609,7 +613,7 @@
           distro release file can be found, the data source for the distro
           release file will be empty.
 
-        * ``include_name`` (bool): Controls whether uname command output is
+        * ``include_uname`` (bool): Controls whether uname command output is
           included as a data source. If the uname command is not available in
           the program execution path the data source for the uname command will
           be empty.
@@ -757,7 +761,7 @@
                     version = v
                     break
         if pretty and version and self.codename():
-            version = u'{0} ({1})'.format(version, self.codename())
+            version = '{0} ({1})'.format(version, self.codename())
         return version
 
     def version_parts(self, best=False):
@@ -967,8 +971,6 @@
             # * commands or their arguments (not allowed in os-release)
             if '=' in token:
                 k, v = token.split('=', 1)
-                if isinstance(v, bytes):
-                    v = v.decode('utf-8')
                 props[k.lower()] = v
             else:
                 # Ignore any tokens that are not variable assignments
@@ -1012,7 +1014,7 @@
                 stdout = subprocess.check_output(cmd, stderr=devnull)
             except OSError:  # Command not found
                 return {}
-        content = stdout.decode(sys.getfilesystemencoding()).splitlines()
+        content = self._to_str(stdout).splitlines()
         return self._parse_lsb_release_content(content)
 
     @staticmethod
@@ -1047,7 +1049,7 @@
                 stdout = subprocess.check_output(cmd, stderr=devnull)
             except OSError:
                 return {}
-        content = stdout.decode(sys.getfilesystemencoding()).splitlines()
+        content = self._to_str(stdout).splitlines()
         return self._parse_uname_content(content)
 
     @staticmethod
@@ -1067,6 +1069,20 @@
             props['release'] = version
         return props
 
+    @staticmethod
+    def _to_str(text):
+        encoding = sys.getfilesystemencoding()
+        encoding = 'utf-8' if encoding == 'ascii' else encoding
+
+        if sys.version_info[0] >= 3:
+            if isinstance(text, bytes):
+                return text.decode(encoding)
+        else:
+            if isinstance(text, unicode):  # noqa
+                return text.encode(encoding)
+
+        return text
+
     @cached_property
     def _distro_release_info(self):
         """
@@ -1169,8 +1185,6 @@
         Returns:
             A dictionary containing all information items.
         """
-        if isinstance(line, bytes):
-            line = line.decode('utf-8')
         matches = _DISTRO_RELEASE_CONTENT_REVERSED_PATTERN.match(
             line.strip()[::-1])
         distro_info = {}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/distro-1.4.0/setup.py new/distro-1.5.0/setup.py
--- old/distro-1.4.0/setup.py   2019-02-04 09:56:19.000000000 +0100
+++ new/distro-1.5.0/setup.py   2020-03-30 23:21:46.000000000 +0200
@@ -1,4 +1,4 @@
-# Copyright 2015,2016 Nir Cohen
+# Copyright 2015-2020 Nir Cohen
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -18,7 +18,7 @@
 
 # The following version is parsed by other parts of this package.
 # Don't change the format of the line, or the variable name.
-package_version = "1.4.0"
+package_version = "1.5.0"
 
 here = os.path.abspath(os.path.dirname(__file__))
 
@@ -61,6 +61,8 @@
         'Programming Language :: Python :: 3.4',
         'Programming Language :: Python :: 3.5',
         'Programming Language :: Python :: 3.6',
+        'Programming Language :: Python :: 3.7',
+        'Programming Language :: Python :: 3.8',
         'Topic :: Software Development :: Libraries :: Python Modules',
         'Topic :: System :: Operating System',
     ]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/distro-1.4.0/tests/resources/distros/midnightbsd12/bin/uname 
new/distro-1.5.0/tests/resources/distros/midnightbsd12/bin/uname
--- old/distro-1.4.0/tests/resources/distros/midnightbsd12/bin/uname    
1970-01-01 01:00:00.000000000 +0100
+++ new/distro-1.5.0/tests/resources/distros/midnightbsd12/bin/uname    
2020-03-30 22:35:18.000000000 +0200
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+echo "MidnightBSD 1.2"
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/distro-1.4.0/tests/test_distro.py 
new/distro-1.5.0/tests/test_distro.py
--- old/distro-1.4.0/tests/test_distro.py       2019-02-04 09:25:26.000000000 
+0100
+++ new/distro-1.5.0/tests/test_distro.py       2020-03-30 22:35:18.000000000 
+0200
@@ -1,3 +1,4 @@
+# coding=utf-8
 # Copyright 2015,2016 Nir Cohen
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
@@ -191,11 +192,11 @@
         desired_outcome = {
             'id': 'fedora',
             'name': 'Fedora',
-            'pretty_name': u'Fedora 19 (Schr\u00F6dinger\u2019s Cat)',
+            'pretty_name': 'Fedora 19 (Schrödinger’s Cat)',
             'version': '19',
-            'pretty_version': u'19 (Schr\u00F6dinger\u2019s Cat)',
+            'pretty_version': '19 (Schrödinger’s Cat)',
             'best_version': '19',
-            'codename': u'Schr\u00F6dinger\u2019s Cat'
+            'codename': 'Schrödinger’s Cat'
         }
         self._test_outcome(desired_outcome)
 
@@ -520,6 +521,16 @@
             'best_version': '11.1'
         })
 
+    def test_midnightbsd12_uname(self):
+        self._test_outcome({
+            'id': 'midnightbsd',
+            'name': 'MidnightBSD',
+            'version': '1.2',
+            'pretty_name': 'MidnightBSD 1.2',
+            'pretty_version': '1.2',
+            'best_version': '1.2'
+        })
+
     def test_ubuntu14normal_lsb_release(self):
         self._setup_for_distro(os.path.join(TESTDISTROS, 'lsb',
                                             'ubuntu14_normal'))
@@ -703,11 +714,11 @@
         desired_outcome = {
             'id': 'fedora',
             'name': 'Fedora',
-            'pretty_name': u'Fedora 19 (Schr\u00F6dinger\u2019s Cat)',
+            'pretty_name': 'Fedora 19 (Schrödinger’s Cat)',
             'version': '19',
-            'pretty_version': u'19 (Schr\u00F6dinger\u2019s Cat)',
+            'pretty_version': '19 (Schrödinger’s Cat)',
             'best_version': '19',
-            'codename': u'Schr\u00F6dinger\u2019s Cat',
+            'codename': 'Schrödinger’s Cat',
             'major_version': '19'
         }
         self._test_outcome(desired_outcome, 'fedora', '19')
@@ -1078,11 +1089,11 @@
         desired_outcome = {
             'id': 'fedora',
             'name': 'Fedora',
-            'pretty_name': u'Fedora 19 (Schr\u00F6dinger\u2019s Cat)',
+            'pretty_name': 'Fedora 19 (Schrödinger’s Cat)',
             'version': '19',
-            'pretty_version': u'19 (Schr\u00F6dinger\u2019s Cat)',
+            'pretty_version': '19 (Schrödinger’s Cat)',
             'best_version': '19',
-            'codename': u'Schr\u00F6dinger\u2019s Cat',
+            'codename': 'Schrödinger’s Cat',
             'major_version': '19'
         }
         self._test_outcome(desired_outcome)
@@ -1091,7 +1102,7 @@
             'id': 'fedora',
             'name': 'Fedora',
             'version_id': '19',
-            'codename': u'Schr\u00F6dinger\u2019s Cat'
+            'codename': 'Schrödinger’s Cat'
         }
         self._test_release_file_info('fedora-release', desired_info)
 
@@ -1618,7 +1629,7 @@
     raise OSError()
 
 
-@pytest.mark.skipIf(not IS_LINUX, reason='Irrelevant on non-linx')
+@pytest.mark.skipif(not IS_LINUX, reason='Irrelevant on non-linux')
 class TestOverallWithEtcNotReadable(TestOverall):
     def setup_method(self, test_method):
         self._old_listdir = os.listdir
@@ -2060,3 +2071,20 @@
         assert "LinuxDistribution" in repr_str
         for attr in MODULE_DISTRO.__dict__.keys():
             assert attr + '=' in repr_str
+
+
+@pytest.mark.skipif(not IS_LINUX, reason='Irrelevant on non-linux')
+class TestToStr:
+    """Test the _to_str() method.
+    """
+
+    def test_to_str(self):
+        ret = distro.LinuxDistribution._to_str(b'bytes')
+        assert isinstance(ret, str)
+        assert ret == 'bytes'
+
+        ret = distro.LinuxDistribution._to_str(u'bytes')
+        assert isinstance(ret, str)
+
+        ret = distro.LinuxDistribution._to_str('bytes')
+        assert isinstance(ret, str)


Reply via email to