From 587179fecfe07c4b449c202d2858d69fc3bd9b15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Gia=20Phong?= Date: Fri, 31 Jul 2020 16:25:04 +0700 Subject: [PATCH] Nitpick packaging This follows up GH-112. --- setup.cfg | 2 +- setup.py | 16 +++++++--------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/setup.cfg b/setup.cfg index 7d8df5c..7731493 100644 --- a/setup.cfg +++ b/setup.cfg @@ -20,7 +20,7 @@ classifiers = Topic :: Software Development :: Libraries Typing :: Typed license = LGPLv3+ -license_file = LICENSE +license_files = LICENSE description = Pythonic Audio Library and Codecs Environment long_description = file: README.md long_description_content_type = text/markdown diff --git a/setup.py b/setup.py index 57996a6..a23e237 100755 --- a/setup.py +++ b/setup.py @@ -18,12 +18,11 @@ # You should have received a copy of the GNU Lesser General Public License # along with palace. If not, see . -import sys import re from distutils import log from distutils.command.clean import clean from distutils.dir_util import mkpath -from distutils.errors import DistutilsFileError +from distutils.errors import DistutilsExecError, DistutilsFileError from distutils.file_util import copy_file from operator import methodcaller from os import environ, unlink @@ -57,15 +56,14 @@ class BuildAlure2Ext(build_ext): """ super().finalize_options() mkpath(self.build_temp) - copy_file(join(dirname(__file__), 'CMakeLists.txt'), - self.build_temp) + copy_file(join(dirname(__file__), 'CMakeLists.txt'), self.build_temp) try: - cmake = run(['cmake', '.'], - check=True, stdout=DEVNULL, stderr=PIPE, - cwd=self.build_temp, universal_newlines=True) + cmake = run( + ['cmake', '.'], check=True, stdout=DEVNULL, stderr=PIPE, + cwd=self.build_temp, universal_newlines=True) except CalledProcessError as e: - print(e.stderr, file=sys.stderr) - raise e from None + log.error(e.stderr.strip()) + raise DistutilsExecError(str(e)) for key, value in map(methodcaller('groups'), re.finditer(r'^alure2_(\w*)=(.*)$',