diff options
Diffstat (limited to 'build_scripts/wheel_override.py')
-rw-r--r-- | build_scripts/wheel_override.py | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/build_scripts/wheel_override.py b/build_scripts/wheel_override.py index 0a359c08e..f3f9f17a9 100644 --- a/build_scripts/wheel_override.py +++ b/build_scripts/wheel_override.py @@ -2,14 +2,13 @@ # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only -import os import platform import sys +from pathlib import Path from email.generator import Generator -from setuptools._distutils import log as logger - -from .options import OPTION, DistUtilsCommandMixin +from .log import log +from .options import OPTION, CommandMixin from .utils import is_64bit from .wheel_utils import get_package_version, get_qt_version, macos_plat_name @@ -27,7 +26,7 @@ try: wheel_module_exists = True except Exception as e: _bdist_wheel, wheel_version = type, "" # dummy to make class statement happy - logger.warn(f"***** Exception while trying to prepare bdist_wheel override class: {e}. " + log.warning(f"***** Exception while trying to prepare bdist_wheel override class: {e}. " "Skipping wheel overriding.") @@ -35,19 +34,19 @@ def get_bdist_wheel_override(): return PysideBuildWheel if wheel_module_exists else None -class PysideBuildWheel(_bdist_wheel, DistUtilsCommandMixin): +class PysideBuildWheel(_bdist_wheel, CommandMixin): - user_options = (_bdist_wheel.user_options + DistUtilsCommandMixin.mixin_user_options + user_options = (_bdist_wheel.user_options + CommandMixin.mixin_user_options if wheel_module_exists else None) def __init__(self, *args, **kwargs): self.command_name = "bdist_wheel" self._package_version = None _bdist_wheel.__init__(self, *args, **kwargs) - DistUtilsCommandMixin.__init__(self) + CommandMixin.__init__(self) def finalize_options(self): - DistUtilsCommandMixin.mixin_finalize_options(self) + CommandMixin.mixin_finalize_options(self) if sys.platform == 'darwin': # Override the platform name to contain the correct # minimum deployment target. @@ -59,7 +58,7 @@ class PysideBuildWheel(_bdist_wheel, DistUtilsCommandMixin): # the initial cpython version we support. limited_api_enabled = OPTION["LIMITED_API"] == 'yes' if limited_api_enabled: - self.py_limited_api = "cp36" + self.py_limited_api = "cp37" self._package_version = get_package_version() @@ -100,7 +99,7 @@ class PysideBuildWheel(_bdist_wheel, DistUtilsCommandMixin): so_abi = python_target_info['so_abi'] if so_abi and so_abi.startswith('cpython-'): - interpreter_name, cp_version = so_abi.split('-') + interpreter_name, cp_version = so_abi.split('-')[:2] impl_name = tags.INTERPRETER_SHORT_NAMES.get(interpreter_name) or interpreter_name impl_ver = f"{py_version_major}{py_version_minor}" impl = impl_name + impl_ver @@ -190,11 +189,11 @@ class PysideBuildWheel(_bdist_wheel, DistUtilsCommandMixin): if self.plat_name and not self.plat_name.startswith("macosx"): plat_name = self.plat_name else: - # on macosx always limit the platform name to comply with any + # on macOS always limit the platform name to comply with any # c-extension modules in bdist_dir, since the user can specify # a higher MACOSX_DEPLOYMENT_TARGET via tools like CMake - # on other platforms, and on macosx if there are no c-extension + # on other platforms, and on macOS if there are no c-extension # modules, use the default platform name. plat_name = get_platform(self.bdist_dir) @@ -254,8 +253,8 @@ class PysideBuildWheel(_bdist_wheel, DistUtilsCommandMixin): for impl in impl_tag.split('.'): writeTag(impl) - wheelfile_path = os.path.join(wheelfile_base, 'WHEEL') - logger.info(f'creating {wheelfile_path}') + wheelfile_path = Path(wheelfile_base) / 'WHEEL' + log.info(f'creating {wheelfile_path}') with open(wheelfile_path, 'w') as f: Generator(f, maxheaderlen=0).flatten(msg) |