Skip to content

Commit dab867b

Browse files
authored
Merge pull request #8179 from QuLogic/appveyor-cache
TST: Enable cache directories on AppVeyor.
2 parents f49ff66 + 99cd0fa commit dab867b

File tree

3 files changed

+20
-8
lines changed

3 files changed

+20
-8
lines changed

.travis.yml

+2
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,8 @@ script:
178178
pip install $PRE requests==2.9.2 linkchecker
179179
linkchecker build/html/index.html
180180
fi
181+
182+
before_cache:
181183
- rm -rf $HOME/.cache/matplotlib/tex.cache
182184
- rm -rf $HOME/.cache/matplotlib/test_cache
183185

appveyor.yml

+4
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ platform:
6363
# all our python builds have to happen in tests_script...
6464
build: false
6565

66+
cache:
67+
- '%LOCALAPPDATA%\pip\Cache'
68+
- '%USERPROFILE%\.cache\matplotlib'
69+
6670
init:
6771
- cmd: "ECHO %PYTHON_VERSION% PYTEST=%USE_PYTEST% %CONDA_INSTALL_LOCN%"
6872

setupext.py

+14-8
Original file line numberDiff line numberDiff line change
@@ -1146,12 +1146,15 @@ def do_custom_build(self):
11461146
os.path.isfile(tarball_cache_path)):
11471147
if get_file_hash(tarball_cache_path) == LOCAL_FREETYPE_HASH:
11481148
try:
1149-
# fail on Lpy, oh well
1150-
os.makedirs('build', exist_ok=True)
1149+
os.makedirs('build')
1150+
except OSError:
1151+
# Don't care if it exists.
1152+
pass
1153+
try:
11511154
shutil.copy(tarball_cache_path, tarball_path)
11521155
print('Using cached tarball: {}'
11531156
.format(tarball_cache_path))
1154-
except:
1157+
except OSError:
11551158
# If this fails, oh well just re-download
11561159
pass
11571160

@@ -1165,12 +1168,12 @@ def do_custom_build(self):
11651168
os.makedirs('build')
11661169

11671170
sourceforge_url = (
1168-
'http://downloads.sourceforge.net/project/freetype'
1171+
'https://downloads.sourceforge.net/project/freetype'
11691172
'/freetype2/{0}/'.format(LOCAL_FREETYPE_VERSION)
11701173
)
11711174
url_fmts = (
11721175
sourceforge_url + '{0}',
1173-
'http://download.savannah.gnu.org/releases/freetype/{0}'
1176+
'https://download.savannah.gnu.org/releases/freetype/{0}'
11741177
)
11751178
for url_fmt in url_fmts:
11761179
tarball_url = url_fmt.format(tarball)
@@ -1186,12 +1189,15 @@ def do_custom_build(self):
11861189
raise IOError("Failed to download freetype")
11871190
if get_file_hash(tarball_path) == LOCAL_FREETYPE_HASH:
11881191
try:
1189-
# this will fail on LPy, oh well
1190-
os.makedirs(tarball_cache_dir, exist_ok=True)
1192+
os.makedirs(tarball_cache_dir)
1193+
except OSError:
1194+
# Don't care if it exists.
1195+
pass
1196+
try:
11911197
shutil.copy(tarball_path, tarball_cache_path)
11921198
print('Cached tarball at: {}'
11931199
.format(tarball_cache_path))
1194-
except:
1200+
except OSError:
11951201
# again, we do not care if this fails, can
11961202
# always re download
11971203
pass

0 commit comments

Comments
 (0)