diff options
author | Cristián Maureira-Fredes <Cristian.Maureira-Fredes@qt.io> | 2022-10-11 21:29:13 +0200 |
---|---|---|
committer | Cristián Maureira-Fredes <Cristian.Maureira-Fredes@qt.io> | 2022-10-13 21:04:40 +0200 |
commit | 7147b48ed466409fda818b2e26f46a36f624c4d3 (patch) | |
tree | 46d3a9e950b978aa4fa2a7f8e04a3bf76b32c7f6 /build_scripts | |
parent | 50a0c29bb7729864f484f1c127373461a7c6b359 (diff) |
build: rename DistUtilsCommandMixin to CommandMixin
Renamed to avoid confusion related to distutil usage.
Task-number: PYSIDE-2079
Change-Id: Idf6a8b64835be34a1e92032bd3b18b8eafe28e3e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'build_scripts')
-rw-r--r-- | build_scripts/main.py | 26 | ||||
-rw-r--r-- | build_scripts/options.py | 14 | ||||
-rw-r--r-- | build_scripts/wheel_override.py | 10 |
3 files changed, 25 insertions, 25 deletions
diff --git a/build_scripts/main.py b/build_scripts/main.py index 52a92affa..0698963ff 100644 --- a/build_scripts/main.py +++ b/build_scripts/main.py @@ -34,7 +34,7 @@ from setuptools.errors import SetupError from .build_info_collector import BuildInfoCollectorMixin from .config import config -from .options import OPTION, DistUtilsCommandMixin +from .options import OPTION, CommandMixin from .platforms.unix import prepare_packages_posix from .platforms.windows_desktop import prepare_packages_win32 from .qtinfo import QtInfo @@ -166,20 +166,20 @@ def prepare_build(): qt_src_dir = maybe_qt_src_dir -class PysideInstall(_install, DistUtilsCommandMixin): +class PysideInstall(_install, CommandMixin): - user_options = _install.user_options + DistUtilsCommandMixin.mixin_user_options + user_options = _install.user_options + CommandMixin.mixin_user_options def __init__(self, *args, **kwargs): self.command_name = "install" _install.__init__(self, *args, **kwargs) - DistUtilsCommandMixin.__init__(self) + CommandMixin.__init__(self) def initialize_options(self): _install.initialize_options(self) def finalize_options(self): - DistUtilsCommandMixin.mixin_finalize_options(self) + CommandMixin.mixin_finalize_options(self) _install.finalize_options(self) if sys.platform == 'darwin' or self.is_cross_compile: @@ -264,19 +264,19 @@ class PysideInstallLib(_install_lib): return outfiles -class PysideBuild(_build, DistUtilsCommandMixin, BuildInfoCollectorMixin): +class PysideBuild(_build, CommandMixin, BuildInfoCollectorMixin): - user_options = _build.user_options + DistUtilsCommandMixin.mixin_user_options + user_options = _build.user_options + CommandMixin.mixin_user_options def __init__(self, *args, **kwargs): self.command_name = "build" _build.__init__(self, *args, **kwargs) - DistUtilsCommandMixin.__init__(self) + CommandMixin.__init__(self) BuildInfoCollectorMixin.__init__(self) def finalize_options(self): os_name_backup = os.name - DistUtilsCommandMixin.mixin_finalize_options(self) + CommandMixin.mixin_finalize_options(self) BuildInfoCollectorMixin.collect_and_assign(self) use_os_name_hack = False @@ -1178,14 +1178,14 @@ class PysideBuild(_build, DistUtilsCommandMixin, BuildInfoCollectorMixin): log.info(f"Patched rpath to '{rpath_value}' in {library}.") -class PysideRstDocs(Command, DistUtilsCommandMixin): +class PysideRstDocs(Command, CommandMixin): description = "Build .rst documentation only" - user_options = DistUtilsCommandMixin.mixin_user_options + user_options = CommandMixin.mixin_user_options def __init__(self, *args, **kwargs): self.command_name = "build_rst_docs" Command.__init__(self, *args, **kwargs) - DistUtilsCommandMixin.__init__(self) + CommandMixin.__init__(self) def initialize_options(self): log.info("-- This build process will not include the API documentation." @@ -1258,7 +1258,7 @@ class PysideRstDocs(Command, DistUtilsCommandMixin): log.info(f"-- The documentation was built. Check html/{PYSIDE}/index.html") def finalize_options(self): - DistUtilsCommandMixin.mixin_finalize_options(self) + CommandMixin.mixin_finalize_options(self) cmd_class_dict = { diff --git a/build_scripts/options.py b/build_scripts/options.py index 1de4b0fc8..c019a1061 100644 --- a/build_scripts/options.py +++ b/build_scripts/options.py @@ -133,7 +133,7 @@ def _jobs_option_value(): return '' -# Declare options which need to be known when instantiating the DistUtils +# Declare options which need to be known when instantiating the setuptools # commands or even earlier during SetupRunner.run(). OPTION = { "BUILD_TYPE": option_value("build-type"), @@ -162,8 +162,8 @@ if _deprecated_option_jobs: OPTION["JOBS"] = _deprecated_option_jobs -class DistUtilsCommandMixin(object): - """Mixin for the DistUtils build/install commands handling the options.""" +class CommandMixin(object): + """Mixin for the setuptools build/install commands handling the options.""" _static_class_finalized_once = False @@ -290,7 +290,7 @@ class DistUtilsCommandMixin(object): # ensuring that all commands that inherit from # the mixin, get our custom properties set by the time # finalize_options is called. - if DistUtilsCommandMixin._static_class_finalized_once: + if CommandMixin._static_class_finalized_once: current_command: Command = self dist = current_command.distribution main_command_name = dist.commands[0] @@ -306,14 +306,14 @@ class DistUtilsCommandMixin(object): @memoize def get_mixin_options_set(): keys = set() - for (name, _, _) in DistUtilsCommandMixin.mixin_user_options: + for (name, _, _) in CommandMixin.mixin_user_options: keys.add(name.rstrip("=").replace("-", "_")) return keys def mixin_finalize_options(self): # The very first we finalize options, record that. - if not DistUtilsCommandMixin._static_class_finalized_once: - DistUtilsCommandMixin._static_class_finalized_once = True + if not CommandMixin._static_class_finalized_once: + CommandMixin._static_class_finalized_once = True # Ensure we finalize once per command object, rather than per # setup.py invocation. We want to have the option values diff --git a/build_scripts/wheel_override.py b/build_scripts/wheel_override.py index c77598e30..292c049f1 100644 --- a/build_scripts/wheel_override.py +++ b/build_scripts/wheel_override.py @@ -8,7 +8,7 @@ import sys from email.generator import Generator from .log import log -from .options import OPTION, DistUtilsCommandMixin +from .options import OPTION, CommandMixin from .utils import is_64bit from .wheel_utils import get_package_version, get_qt_version, macos_plat_name @@ -34,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. |