From fd276dabc732a944b14d3bb6c7ff4cf91c15a345 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 30 Mar 2017 21:58:33 +0200 Subject: [PATCH] appveyor_install: Don't install old PyQt if unneeded --- scripts/dev/ci/appveyor_install.py | 39 ++++++++++++++++-------------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/scripts/dev/ci/appveyor_install.py b/scripts/dev/ci/appveyor_install.py index 2c04304d5..131906248 100644 --- a/scripts/dev/ci/appveyor_install.py +++ b/scripts/dev/ci/appveyor_install.py @@ -28,6 +28,7 @@ CI machines. from __future__ import print_function +import os import time import subprocess import urllib @@ -44,23 +45,6 @@ def pip_install(pkg): pkg]) -print("Getting PyQt5...") -qt_version = '5.5.1' -pyqt_version = '5.5.1' -pyqt_url = ('https://www.qutebrowser.org/pyqt/' - 'PyQt5-{}-gpl-Py3.4-Qt{}-x32.exe'.format( - pyqt_version, qt_version)) - -try: - urllib.urlretrieve(pyqt_url, r'C:\install-PyQt5.exe') -except (OSError, IOError): - print("Downloading PyQt failed, trying again in 10 seconds...") - time.sleep(10) - urllib.urlretrieve(pyqt_url, r'C:\install-PyQt5.exe') - -print("Installing PyQt5...") -subprocess.check_call([r'C:\install-PyQt5.exe', '/S']) - print("Installing tox") pip_install('pip') pip_install(r'-rmisc\requirements\requirements-tox.txt') @@ -69,4 +53,23 @@ print("Linking Python...") with open(r'C:\Windows\system32\python3.bat', 'w') as f: f.write(r'@C:\Python34\python %*') -check_setup(r'C:\Python34\python') + +if '-pyqt' not in os.environ['TESTENV']: + print("Getting PyQt5...") + qt_version = '5.5.1' + pyqt_version = '5.5.1' + pyqt_url = ('https://www.qutebrowser.org/pyqt/' + 'PyQt5-{}-gpl-Py3.4-Qt{}-x32.exe'.format( + pyqt_version, qt_version)) + + try: + urllib.urlretrieve(pyqt_url, r'C:\install-PyQt5.exe') + except (OSError, IOError): + print("Downloading PyQt failed, trying again in 10 seconds...") + time.sleep(10) + urllib.urlretrieve(pyqt_url, r'C:\install-PyQt5.exe') + + print("Installing PyQt5...") + subprocess.check_call([r'C:\install-PyQt5.exe', '/S']) + + check_setup(r'C:\Python34\python')