Skip to content

Cache PyQt installers in AppVeyor #138

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 29, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ install:
- C:\Python27\python -u scripts\install-qt.py
- C:\Python27\python -m pip install tox

cache:
- C:\Installers -> appveyor.yml, scripts\install-qt.py

build: false # Not a C# project

test_script:
Expand Down
17 changes: 13 additions & 4 deletions scripts/install-qt.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,24 @@ def fix_registry(python_ver):
fix_registry('35')
fix_registry('27')
caption = os.environ['INSTALL_QT']
url = downloads[caption]
print("Downloading %s..." % caption)
installer = r'C:\install-%s.exe' % caption
urllib.urlretrieve(base_url + url, installer)
installers_dir = r'C:\Installers'
if not os.path.isdir(installers_dir):
os.makedirs(installers_dir)
installer = os.path.join(installers_dir, 'install-%s.exe' % caption)
if not os.path.isfile(installer):
# download all files because the cache is for all builds
for cap, url in sorted(downloads.items()):
print("Downloading %s..." % cap)
filename = os.path.join(installers_dir, 'install-%s.exe' % cap)
urllib.urlretrieve(base_url + url, filename)
else:
print('Using cached installers')
print('Installing %s...' % caption)
subprocess.check_call([installer, '/S'])
python = caption.split('-')[0]
assert python[:2] == 'py'
executable = r'C:\Python%s\python.exe' % python[2:]
url = downloads[caption]
module = url.split('/')[0]
cmdline = [executable, '-c', 'import %s;print(%s)' % (module, module)]
print('Checking: %r' % cmdline)
Expand Down