From ea191a892451ffa0506d5fa218c39943a81d4e43 Mon Sep 17 00:00:00 2001 From: KIAaze Date: Wed, 20 May 2020 23:13:11 +0100 Subject: [PATCH 1/3] Fixed AttributeError in the packaging script when using python>=3.8. platform.dist() is deprecated since python version 3.5 and was removed in version 3.8. Added exception to use the distro package in that case, as suggested by the python documentation: https://docs.python.org/3.7/library/platform.html?highlight=platform#module-platform --- package.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/package.py b/package.py index 8d9b562a..216007c8 100644 --- a/package.py +++ b/package.py @@ -212,7 +212,11 @@ def main(): package_windows() else: if not args.arch_pkg: - distname, _, _ = platform.dist() + try: + distname, _, _ = platform.dist() + except AttributeError: + import distro + distname, _, _ = distro.linux_distribution(full_distribution_name=False) else: distname = "arch" if distname == "arch": From 0e8cd32a6ef89419d438e987121e6e8b43ff0125 Mon Sep 17 00:00:00 2001 From: KIAaze Date: Wed, 20 May 2020 23:15:49 +0100 Subject: [PATCH 2/3] Changed to -F option to build everything (source and binary packages). --- package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.py b/package.py index 216007c8..b9cf709c 100644 --- a/package.py +++ b/package.py @@ -90,7 +90,7 @@ def package_debian_distribution(distribution): ) shutil.copy(op.join("images", "dgse_logo_128.png"), srcpath) os.chdir(destpath) - cmd = "dpkg-buildpackage -S -us -uc" + cmd = "dpkg-buildpackage -F -us -uc" os.system(cmd) os.chdir("../..") From ecf005fad0f8cd1bdce6c5c2c587f6cf02fb7557 Mon Sep 17 00:00:00 2001 From: Andrew Senetar Date: Wed, 24 Jun 2020 18:39:06 -0500 Subject: [PATCH 3/3] Add distro to requirements and use for packaging - Add distro as a requirement - Use distro.id() to get the id as it is a bit cleaner than distro.linux_distribution() --- package.py | 7 ++----- requirements.txt | 1 + 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/package.py b/package.py index b9cf709c..be949bce 100644 --- a/package.py +++ b/package.py @@ -12,6 +12,7 @@ import shutil import json from argparse import ArgumentParser import platform +import distro import re from hscommon.build import ( @@ -212,11 +213,7 @@ def main(): package_windows() else: if not args.arch_pkg: - try: - distname, _, _ = platform.dist() - except AttributeError: - import distro - distname, _, _ = distro.linux_distribution(full_distribution_name=False) + distname = distro.id() else: distname = "arch" if distname == "arch": diff --git a/requirements.txt b/requirements.txt index 9b90932b..97fa8f44 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,3 +2,4 @@ Send2Trash>=1.3.0 sphinx>=1.2.2 polib>=1.0.4 hsaudiotag3k>=1.1.3 +distro>=1.5.0 \ No newline at end of file