aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Tismer <tismer@stackless.com>2019-04-23 15:00:34 +0200
committerChristian Tismer <tismer@stackless.com>2019-04-23 14:51:23 +0000
commit8f74adea7cffdf2e1158df15ba0105dc40b24fa3 (patch)
tree3ca84b4de82d29c162fe8d1ff7761dd7f5cd1e6d
parentc09a0dc64f6509d47086f02c3983487477056337 (diff)
Provide a spec file for hello.app used by wheel_tester
The PyInstaller test was done with minimalistic options to keep things as simple as possible. This had the side effect that on certain Python versions and platforms things were touched that created errors, although those things were nowhere in use. It turned out that the generated hello_app.spec file contains the result of an in-depth analysis which touches so many non-existing modules. When using just the generated spec file and no other option, the analysis is almost skipped and the generation of an executable avoids further problems and is faster. This patch removes all arguments and uses a spec file instead. The arguments are kept in a comment, just in case. Change-Id: I17c43a588bc6f95f62fc3104a047dc08e8d8e70d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
-rw-r--r--examples/installer_test/hello_app.spec85
-rw-r--r--testing/wheel_tester.py9
2 files changed, 91 insertions, 3 deletions
diff --git a/examples/installer_test/hello_app.spec b/examples/installer_test/hello_app.spec
new file mode 100644
index 000000000..d096ab170
--- /dev/null
+++ b/examples/installer_test/hello_app.spec
@@ -0,0 +1,85 @@
+# This Python file uses the following encoding: utf-8
+# It has been edited by fix-complaints.py .
+
+#############################################################################
+##
+## Copyright (C) 2019 The Qt Company Ltd.
+## Contact: https://www.qt.io/licensing/
+##
+## This file is part of Qt for Python.
+##
+## $QT_BEGIN_LICENSE:LGPL$
+## Commercial License Usage
+## Licensees holding valid commercial Qt licenses may use this file in
+## accordance with the commercial license agreement provided with the
+## Software or, alternatively, in accordance with the terms contained in
+## a written agreement between you and The Qt Company. For licensing terms
+## and conditions see https://www.qt.io/terms-conditions. For further
+## information use the contact form at https://www.qt.io/contact-us.
+##
+## GNU Lesser General Public License Usage
+## Alternatively, this file may be used under the terms of the GNU Lesser
+## General Public License version 3 as published by the Free Software
+## Foundation and appearing in the file LICENSE.LGPL3 included in the
+## packaging of this file. Please review the following information to
+## ensure the GNU Lesser General Public License version 3 requirements
+## will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+##
+## GNU General Public License Usage
+## Alternatively, this file may be used under the terms of the GNU
+## General Public License version 2.0 or (at your option) the GNU General
+## Public license version 3 or any later version approved by the KDE Free
+## Qt Foundation. The licenses are as published by the Free Software
+## Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+## included in the packaging of this file. Please review the following
+## information to ensure the GNU General Public License requirements will
+## be met: https://www.gnu.org/licenses/gpl-2.0.html and
+## https://www.gnu.org/licenses/gpl-3.0.html.
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+
+"""
+hello_app.spec
+
+This is almost the spec file generated by running PyInstaller.
+Just the paths were adjusted and made relative.
+As an effect, all the analysis is avoided, and the log file of
+wheel_tester.py went down from 775 lines to 278 lines. :-)
+"""
+
+block_cipher = None
+
+
+a = Analysis(['hello.py'],
+ pathex=['pyinstaller'],
+ binaries=[],
+ datas=[],
+ hiddenimports=[],
+ hookspath=[],
+ runtime_hooks=[],
+ excludes=[],
+ win_no_prefer_redirects=False,
+ win_private_assemblies=False,
+ cipher=block_cipher,
+ noarchive=False)
+pyz = PYZ(a.pure, a.zipped_data,
+ cipher=block_cipher)
+exe = EXE(pyz,
+ a.scripts,
+ [],
+ exclude_binaries=True,
+ name='hello_app',
+ debug=False,
+ bootloader_ignore_signals=False,
+ strip=False,
+ upx=True,
+ console=True )
+coll = COLLECT(exe,
+ a.binaries,
+ a.zipfiles,
+ a.datas,
+ strip=False,
+ upx=True,
+ name='hello_app')
diff --git a/testing/wheel_tester.py b/testing/wheel_tester.py
index 810ef0f56..a6ee2d463 100644
--- a/testing/wheel_tester.py
+++ b/testing/wheel_tester.py
@@ -206,9 +206,12 @@ def generate_build_qmake():
def compile_using_pyinstaller():
src_path = os.path.join("..", "hello.py")
- exit_code = run_process([sys.executable, "-m", "PyInstaller",
- "--name=hello_app", "--console", "--log-level=DEBUG",
- src_path])
+ spec_path = os.path.join("..", "hello_app.spec")
+ exit_code = run_process([sys.executable, "-m", "PyInstaller", spec_path])
+ # to create the spec file, this setting was used:
+ #"--name=hello_app", "--console", "--log-level=DEBUG", src_path])
+ # By using a spec file, we avoid all the probing that might disturb certain
+ # platforms and also save some analysis time.
if exit_code:
# raise RuntimeError("Failure while compiling script using PyInstaller.")
print("PYINST: Failure while compiling script using PyInstaller.")