aboutsummaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
authorChristian Tismer <tismer@stackless.com>2021-06-15 14:08:01 +0200
committerChristian Tismer <tismer@stackless.com>2021-06-18 12:12:38 +0200
commit4269e3535b7b97c188a6d8377e685586da89592f (patch)
tree8924fcadc1f0e9abcae934afa928748ce48585e3 /testing
parent7e8d8d1a9adb4f75b878f4b5267b59c5a81170df (diff)
testing: enforce that .pyi files are always tested
Being able to run .pyi files in Python 3 is always assumed possible. Since this test is disabled in local builds, we were relying on correct configuration of COIN, but that failed. To be safe, we now add a test to wheel_tester as well that unconditionally tests all .pyi with all features enabled. A special problem was a name clash in Qt3DAnimation.pyi which uses the name "property" :-) An import of QtMultimedia seems not to work, always. This happened in wheel_tester.py in CI, only. Task-number: PYSIDE-1599 Change-Id: Ib158e710cec72287fe4a71c01254727ea9b6dc54 Pick-to: 6.1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'testing')
-rw-r--r--testing/wheel_tester.py17
1 files changed, 14 insertions, 3 deletions
diff --git a/testing/wheel_tester.py b/testing/wheel_tester.py
index c5c0fdc00..c09e2d8a7 100644
--- a/testing/wheel_tester.py
+++ b/testing/wheel_tester.py
@@ -291,8 +291,8 @@ def run_compiled_script(binary_path):
log.info("")
-def execute_script(script_path):
- args = [sys.executable, script_path]
+def execute_script(script_path, *extra):
+ args = list(map(str, (sys.executable, script_path) + extra))
exit_code = run_process(args)
if exit_code:
raise RuntimeError("Failure while executing script: {}".format(script_path))
@@ -329,8 +329,8 @@ def try_build_examples():
run_compiled_script(os.path.join(src_path,
"pyinstaller", "dist", "hello_app", "hello_app"))
- src_path = Path(examples_dir) / "installer_test"
log.info("Attempting to build hello.py using Nuitka.")
+ src_path = Path(examples_dir) / "installer_test"
# Nuitka is loaded by coin_build_instructions.py, but not when
# testing directly this script.
run_nuitka_test(os.fspath(src_path / "hello.py"))
@@ -356,6 +356,17 @@ def try_build_examples():
generate_build_qmake()
run_make()
+ if sys.version_info[:2] >= (3, 7):
+ log.info("Checking Python Interface Files in Python 3 with all features selected")
+ with tempfile.TemporaryDirectory() as tmpdirname:
+ src_path = Path(tmpdirname) / "pyi_test"
+ pyi_script_dir = Path(setup_script_dir) / "sources" / "pyside6" / "PySide6" / "support"
+ execute_script(pyi_script_dir / "generate_pyi.py", "all", "--outpath", src_path,
+ "--feature", "snake_case", "true_property")
+ from PySide6 import __all__ as modules
+ for modname in modules:
+ execute_script(src_path / f"{modname}.pyi")
+
def run_wheel_tests(install_wheels):
wheels_dir = get_wheels_dir()