diff options
| author | Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> | 2022-10-27 15:43:35 +0200 |
|---|---|---|
| committer | Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> | 2022-11-16 11:50:30 +0100 |
| commit | 43109854a2966afe2e0cf29961157a6f54d5775c (patch) | |
| tree | 19ee00969da875e0ab8ecd836fa31c0a39faba55 /build_scripts/config.py | |
| parent | 0bd80c41e1eb4c0c0ef9e490b9a6bf9b054f9aea (diff) | |
PySideTools: install tool only if corresponding Qt tool exists
- PySide tools which are wrappers around Qt tools are now only installed
if the corresponding Qt tool exists.
- PySide6 entry points for the Qt tool are now only created if the Qt
tool exists in the corresponding Qt installation.
- Incase the console entrypoint still exists and the corresponding Qt
tool does not exist, the tool would exit stating that the Qt tool does
not exist.
eg: 'pyside6-uic' is run and 'uic' does not exist. The the tool
outputs that the 'uic' does not exist.
Ideally as per this change, PySide6 entrypoints for missing Qt tools
should not exist at all.
- versions.py deleted and contents moved to __init__.py.
- Adds warning from Python incase if the tool does not exist. This
is in addition to the CMake warning.
Fixes: PYSIDE-2097
Pick-to: 6.4 6.2
Change-Id: I3f1b26d103679f7425d9ad85dfed8d9ad17f6fbf
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'build_scripts/config.py')
| -rw-r--r-- | build_scripts/config.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/build_scripts/config.py b/build_scripts/config.py index 6590dcc9d..98dc23042 100644 --- a/build_scripts/config.py +++ b/build_scripts/config.py @@ -6,7 +6,8 @@ import os from .log import log from pathlib import Path -from .versions import PYSIDE, PYSIDE_MODULE, SHIBOKEN +from . import PYSIDE, PYSIDE_MODULE, SHIBOKEN +from .utils import available_pyside_tools class Config(object): @@ -78,7 +79,8 @@ class Config(object): ext_modules=None, setup_script_dir=None, cmake_toolchain_file=None, - quiet=False): + quiet=False, + qt_install_path: Path = None): """ Sets up the global singleton config which is used in many parts of the setup process. @@ -199,11 +201,7 @@ class Config(object): setup_kwargs['install_requires'] = [ f"{self.shiboken_module_st_name}=={package_version}" ] - _pyside_tools = ["uic", "rcc", "assistant", "designer", "linguist", - "lupdate", "lrelease", "genpyi", "metaobjectdump", - "project", "qml", "qmltyperegistrar", "qmllint", "qmlformat", "qmlls", - "qtpy2cpp", "deploy", "qmlimportscanner"] - + _pyside_tools = available_pyside_tools(qt_tools_path=qt_install_path) setup_kwargs['entry_points'] = { 'console_scripts': [f'{PYSIDE}-{tool} = {package_name}.scripts.pyside_tool:{tool}' for tool in _pyside_tools] |
