From 14af709e10fa8a2e3c84094c13ebdda9833be124 Mon Sep 17 00:00:00 2001 From: Christian Tismer Date: Sun, 25 Nov 2018 15:55:45 +0100 Subject: Generate Hinting Stubs Automatically The script is now automatically called in the cmake build, as part of the create_pyside_module macro. The script runs after every module build and tries to generate .pyi files. This does not need to succeed, but will generate all files in the end. The script has been prepared to allow partial runs without overhead. After integration of the .pyi generation into cmake, these files are also installed into the install directory by cmake. For wheel building, setup.py has entries, too. Building a full project with all modules revealed a bug in the signature module that allowed unsupported function objects. Module enum_sig had to be changed to suppress types which have no ancestry in shiboken. PYTHONPATH was avoided because it was not Windows compatible. Instead, the script was changed to accept "--sys-path" and "--lib-path" parameters. The latter evaluates either to PATH or LD_LIBRARY_PATH. The necessity to create .pyi files while the project is in the build process showed a hard to track down error condition in PySide_BuildSignatureProps. Simple logging was added as a start of introducing logging everywhere. Task-number: PYSIDE-735 Change-Id: I6b3eec4b823d026583e902023badedeb06fe0961 Reviewed-by: Qt CI Bot Reviewed-by: Cristian Maureira-Fredes --- build_scripts/platforms/unix.py | 8 ++++++++ build_scripts/platforms/windows_desktop.py | 8 ++++++++ 2 files changed, 16 insertions(+) (limited to 'build_scripts/platforms') diff --git a/build_scripts/platforms/unix.py b/build_scripts/platforms/unix.py index fc56992f4..d3767976f 100644 --- a/build_scripts/platforms/unix.py +++ b/build_scripts/platforms/unix.py @@ -184,6 +184,14 @@ def prepare_packages_posix(self, vars): "{st_build_dir}/{st_package_name}/support", vars=vars) + # /pyside2/{st_package_name}/*.pyi -> + # /{st_package_name}/*.pyi + copydir( + "{build_dir}/pyside2/{st_package_name}", + "{st_build_dir}/{st_package_name}", + filter=["*.pyi"], + vars=vars) + if not OPTION_NOEXAMPLES: # examples/* -> /{st_package_name}/examples copydir(os.path.join(self.script_dir, "examples"), diff --git a/build_scripts/platforms/windows_desktop.py b/build_scripts/platforms/windows_desktop.py index c61bbbc99..c98ef3959 100644 --- a/build_scripts/platforms/windows_desktop.py +++ b/build_scripts/platforms/windows_desktop.py @@ -207,6 +207,14 @@ def prepare_packages_win32(self, vars): "{st_build_dir}/{st_package_name}/support", vars=vars) + # /pyside2/{st_package_name}/*.pyi -> + # /{st_package_name}/*.pyi + copydir( + "{build_dir}/pyside2/{st_package_name}", + "{st_build_dir}/{st_package_name}", + filter=["*.pyi"], + vars=vars) + copydir( "{build_dir}/pyside2/libpyside", "{st_build_dir}/{st_package_name}", -- cgit v1.2.3