From ecf005fad0f8cd1bdce6c5c2c587f6cf02fb7557 Mon Sep 17 00:00:00 2001 From: Andrew Senetar Date: Wed, 24 Jun 2020 18:39:06 -0500 Subject: [PATCH] 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