aboutsummaryrefslogtreecommitdiffstats
path: root/testing/wheel_tester.py
diff options
context:
space:
mode:
Diffstat (limited to 'testing/wheel_tester.py')
-rw-r--r--testing/wheel_tester.py36
1 files changed, 18 insertions, 18 deletions
diff --git a/testing/wheel_tester.py b/testing/wheel_tester.py
index 535cb3712..100fd18f7 100644
--- a/testing/wheel_tester.py
+++ b/testing/wheel_tester.py
@@ -65,9 +65,6 @@ this_dir = os.path.dirname(this_file)
setup_script_dir = os.path.abspath(os.path.join(this_dir, '..'))
sys.path.append(setup_script_dir)
-from build_scripts.options import OPTION_QMAKE
-from build_scripts.options import OPTION_CMAKE
-
from build_scripts.utils import find_files_using_glob
from build_scripts.utils import find_glob_in_path
from build_scripts.utils import run_process, run_process_output
@@ -78,14 +75,6 @@ import platform
log.set_verbosity(1)
-def find_executable_qmake():
- return find_executable('qmake', OPTION_QMAKE)
-
-
-def find_executable_cmake():
- return find_executable('cmake', OPTION_CMAKE)
-
-
def find_executable(executable, command_line_value):
value = command_line_value
option_str = '--{}'.format(executable)
@@ -109,8 +98,8 @@ def find_executable(executable, command_line_value):
return value
-QMAKE_PATH = find_executable_qmake()
-CMAKE_PATH = find_executable_cmake()
+QMAKE_PATH = None
+CMAKE_PATH = None
def get_wheels_dir():
@@ -122,6 +111,8 @@ def get_examples_dir():
def package_prefix_names():
+ # Note: shiboken2_generator is not needed for compile_using_pyinstaller,
+ # but building modules with cmake needs it.
return ["shiboken2", "shiboken2_generator", "PySide2"]
@@ -160,16 +151,18 @@ def try_install_wheels(wheels_dir, py_version):
log.info("")
for p in package_prefix_names():
- pattern = "{}-*cp{}*.whl".format(p, py_version)
+ log.info("Trying to install {p}:".format(**locals()))
+ pattern = "{}-*cp{}*.whl".format(p, int(float(py_version)))
files = find_files_using_glob(wheels_dir, pattern)
if files and len(files) == 1:
wheel_path = files[0]
install_wheel(wheel_path)
elif len(files) > 1:
- raise RuntimeError("More than one wheel found for specific package and version.")
+ raise RuntimeError("More than one wheel found for specific {p} version."
+ .format(**locals()))
else:
- raise RuntimeError("No wheels compatible with Python {} found "
- "for testing.".format(py_version))
+ raise RuntimeError("No {p} wheels compatible with Python {py_version} found "
+ "for testing.".format(**locals()))
def is_unix():
@@ -330,7 +323,7 @@ def try_build_examples():
def run_wheel_tests(install_wheels):
wheels_dir = get_wheels_dir()
- py_version = sys.version_info[0]
+ py_version = "{v.major}.{v.minor}".format(v=sys.version_info)
if install_wheels:
log.info("Attempting to install wheels.\n")
@@ -348,5 +341,12 @@ if __name__ == "__main__":
parser.add_argument('--no-install-wheels', '-n', action='store_true',
help='Do not install wheels'
' (for developer builds with virtualenv)')
+ parser.add_argument("--qmake", type=str,
+ help="Path to qmake")
+ parser.add_argument("--cmake", type=str,
+ help="Path to cmake")
options = parser.parse_args()
+ QMAKE_PATH = find_executable('qmake', options.qmake)
+ CMAKE_PATH = find_executable('cmake', options.cmake)
+
run_wheel_tests(not options.no_install_wheels)