summaryrefslogtreecommitdiffstats
path: root/scripts/packagetesting
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2021-02-03 08:43:08 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2021-02-03 10:28:04 +0100
commit79509d531710c5732f31fd10d8724fc1c23e8205 (patch)
treeca7fcd5704e5740f635fba0d8b95e26f4b0a8dbd /scripts/packagetesting
parent935e6ccc155966c8dbbc8ec6de350d989744b8fa (diff)
testwheel.py: Add an option to turn off pyinstaller
It does not work yet for Qt 6. Pick-to: master Change-Id: I8f0e6077046a12c8a7cbc34a2d1ba7a5680bf77f Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'scripts/packagetesting')
-rw-r--r--scripts/packagetesting/testwheel.py30
1 files changed, 20 insertions, 10 deletions
diff --git a/scripts/packagetesting/testwheel.py b/scripts/packagetesting/testwheel.py
index e4f1ca43..e2607785 100644
--- a/scripts/packagetesting/testwheel.py
+++ b/scripts/packagetesting/testwheel.py
@@ -28,6 +28,7 @@
# ############################################################################
+from argparse import ArgumentParser, RawTextHelpFormatter
import os
import subprocess
import sys
@@ -120,8 +121,15 @@ def test_pyinstaller(example):
if __name__ == "__main__":
- do_pyinst = True
- if sys.version_info[0] < 3: # Note: PyInstaller no longer supports Python 2
+ parser = ArgumentParser(description='Qt for Python package tester',
+ formatter_class=RawTextHelpFormatter)
+ parser.add_argument('--no-pyinstaller', '-p', action='store_true',
+ help='Skip pyinstaller test')
+
+ options = parser.parse_args()
+ do_pyinst = not options.no_pyinstaller
+
+ if do_pyinst and sys.version_info[0] < 3: # Note: PyInstaller no longer supports Python 2
print('PyInstaller requires Python 3, test disabled')
do_pyinst = False
root = None
@@ -146,12 +154,14 @@ if __name__ == "__main__":
for e in examples():
run_example(root_ex, e)
- if has_pyinstaller():
- if test_pyinstaller(os.path.join(root_ex, PYINSTALLER_EXAMPLE)):
- print("\nPyInstaller test successful")
- else:
- print("\nProblem running PyInstaller")
- sys.exit(1)
+ if not do_pyinst:
+ sys.exit(0)
+ if not has_pyinstaller():
+ print('PyInstaller not found, skipping test')
+ sys.exit(0)
+
+ if test_pyinstaller(os.path.join(root_ex, PYINSTALLER_EXAMPLE)):
+ print("\nPyInstaller test successful")
else:
- if do_pyinst:
- print('PyInstaller not found, skipping test')
+ print("\nProblem running PyInstaller")
+ sys.exit(1)