From f2eee366548a2117472c5b14e12c67649f102963 Mon Sep 17 00:00:00 2001 From: x24git <23037854+x24git@users.noreply.github.com> Date: Fri, 6 Mar 2020 18:44:31 -0800 Subject: [PATCH] Fix Issue #14 - Update to use distro package to get Linux Distribution information - Add distro to package dependencies --- setup.py | 6 ++++-- utils/dist.py | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 8701a82..56abaf2 100644 --- a/setup.py +++ b/setup.py @@ -21,12 +21,11 @@ import platform import sys -from distutils.core import setup +from setuptools import setup sys.path.insert(1, os.path.abspath('./src')) import wixpy -import dependencies IS_PY2 = sys.version_info.major < 3 IS_MSW = os.name == 'nt' @@ -45,6 +44,7 @@ maintainer=wixpy.MAINTAINER, maintainer_email=wixpy.MAINTAINER_EMAIL, license=wixpy.LICENSE, + install_requires=['distro'], url=wixpy.URL, download_url=wixpy.DOWNLOAD_URL, long_description=wixpy.LONG_DESCRIPTION, @@ -54,5 +54,7 @@ scripts=scripts, ) +import dependencies + if 'install' in sys.argv and not IS_MSW: dependencies.install() diff --git a/utils/dist.py b/utils/dist.py index cf984c3..2d9227b 100644 --- a/utils/dist.py +++ b/utils/dist.py @@ -18,6 +18,7 @@ # along with this program. If not, see . import platform +import distro WINDOWS = 'Windows' LINUX = 'Linux' @@ -75,7 +76,7 @@ class SystemFacts(object): def __init__(self): - self.family, self.version = platform.dist()[:2] + self.family, self.version = distro.linux_distribution()[:2] # Workaround for Leap 15.0 bug if not self.family and not self.version: