summaryrefslogtreecommitdiffstats
path: root/scripts/packagetesting
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2020-11-11 11:15:32 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2020-11-11 13:11:36 +0100
commitea120c181289371b9780ecc2aeda3b16fc715e93 (patch)
tree2b07cf1c7a111b960b37d7a5c70de0f0379e7297 /scripts/packagetesting
parentf082b8eb4ce7a774aacbbda3c0d98c060d784b05 (diff)
testwheel.py: Adapt to PySide6
Detect version and adapt list of examples. Pick-to: master Change-Id: Ifbe3bcd97d7e27daaf599dd51f713acd974ade2e 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, 21 insertions, 9 deletions
diff --git a/scripts/packagetesting/testwheel.py b/scripts/packagetesting/testwheel.py
index d70681f3..2b9cbed2 100644
--- a/scripts/packagetesting/testwheel.py
+++ b/scripts/packagetesting/testwheel.py
@@ -40,13 +40,19 @@ Qt Package testing script for testing Qt for Python wheels
PYINSTALLER_EXAMPLE = 'widgets/widgets/tetrix.py'
+
+VERSION = -1
+
+
def examples():
"""Compile a list of examples to be tested"""
- return ['opengl/hellogl.py',
- 'multimedia/player.py',
- 'charts/donutbreakdown.py',
- 'widgets/mainwindows/mdi/mdi.py',
- 'webenginewidgets/tabbedbrowser/main.py']
+ result = ['widgets/mainwindows/mdi/mdi.py']
+ if VERSION < 6:
+ result.extend(['opengl/hellogl.py',
+ 'multimedia/player.py',
+ 'charts/donutbreakdown.py',
+ 'webenginewidgets/tabbedbrowser/main.py'])
+ return result
def execute(args):
@@ -118,16 +124,22 @@ if __name__ == "__main__":
root = None
for p in sys.path:
if os.path.basename(p) == 'site-packages':
- root = os.path.join(p, 'PySide2')
+ root = os.path.join(p, 'PySide6')
+ if os.path.exists(root):
+ VERSION = 6
+ else:
+ root = os.path.join(p, 'PySide2')
+ VERSION = 2
root_ex = os.path.join(root, 'examples')
break
if not root or not os.path.exists(root):
- print('Could not locate the PySide2 module.')
+ print('Could not locate any PySide module.')
sys.exit(1)
if not os.path.exists(root_ex):
- print("PySide2 module found without examples. Did you forget to install wheels?")
+ m = "PySide{} module found without examples. Did you forget to install wheels?".format(VERSION)
+ print(m)
sys.exit(1)
- print('Detected PySide2 at {}.'.format(root))
+ print('Detected PySide{} at {}.'.format(VERSION, root))
for e in examples():
run_example(root_ex, e)