From 19acc417df1a920a5ded49258cf4b88f837fbcdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristi=C3=A1n=20Maureira-Fredes?= Date: Tue, 11 Oct 2022 18:01:26 +0200 Subject: build: replace DistutilsSetupError by SetupError Replacing the distutils errors by the setuptools one. Task-number: PYSIDE-2079 Change-Id: I9968d9562f8dd40317344d3295943c194e3f2197 Reviewed-by: Christian Tismer --- build_scripts/wheel_utils.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'build_scripts/wheel_utils.py') diff --git a/build_scripts/wheel_utils.py b/build_scripts/wheel_utils.py index d485aeb2f..31d8c7bd0 100644 --- a/build_scripts/wheel_utils.py +++ b/build_scripts/wheel_utils.py @@ -6,7 +6,7 @@ import time from sysconfig import get_config_var, get_platform from packaging.version import parse as parse_version -from setuptools._distutils.errors import DistutilsSetupError +from setuptools.errors import SetupError from .options import OPTION from .qtinfo import QtInfo @@ -28,12 +28,11 @@ def get_qt_version(): qt_version = qtinfo.version if not qt_version: - raise DistutilsSetupError("Failed to query the Qt version with " - f"qmake {qtinfo.qmake_command}") + raise SetupError("Failed to query the Qt version with qmake {qtinfo.qmake_command}") if parse_version(qtinfo.version) < parse_version("5.7"): - raise DistutilsSetupError(f"Incompatible Qt version detected: {qt_version}. " - "A Qt version >= 5.7 is required.") + raise SetupError(f"Incompatible Qt version detected: {qt_version}. " + "A Qt version >= 5.7 is required.") return qt_version @@ -69,7 +68,7 @@ def macos_qt_min_deployment_target(): target = QtInfo().macos_min_deployment_target if not target: - raise DistutilsSetupError("Failed to query for Qt's QMAKE_MACOSX_DEPLOYMENT_TARGET.") + raise SetupError("Failed to query for Qt's QMAKE_MACOSX_DEPLOYMENT_TARGET.") return target @@ -102,11 +101,9 @@ def macos_pyside_min_deployment_target(): # precedence. if setup_target: if python_target and setup_target_split < python_target_split: - raise DistutilsSetupError(message.format(setup_target, "Python", - python_target)) + raise SetupError(message.format(setup_target, "Python", python_target)) if setup_target_split < qt_target_split: - raise DistutilsSetupError(message.format(setup_target, "Qt", - qt_target)) + raise SetupError(message.format(setup_target, "Qt", qt_target)) # All checks clear, use setup.py provided value. return setup_target -- cgit v1.2.3