TST: Enable cache directories on AppVeyor. #8179

Merged
merged 4 commits into from Mar 8, 2017
View
@@ -178,6 +178,8 @@ script:
pip install $PRE requests==2.9.2 linkchecker
linkchecker build/html/index.html
fi
+
+before_cache:
- rm -rf $HOME/.cache/matplotlib/tex.cache
- rm -rf $HOME/.cache/matplotlib/test_cache
View
@@ -63,6 +63,10 @@ platform:
# all our python builds have to happen in tests_script...
build: false
+cache:
+ - '%LOCALAPPDATA%\pip\Cache'
+ - '%USERPROFILE%\.cache\matplotlib'
+
init:
- cmd: "ECHO %PYTHON_VERSION% PYTEST=%USE_PYTEST% %CONDA_INSTALL_LOCN%"
View
@@ -1146,12 +1146,15 @@ def do_custom_build(self):
os.path.isfile(tarball_cache_path)):
if get_file_hash(tarball_cache_path) == LOCAL_FREETYPE_HASH:
try:
- # fail on Lpy, oh well
- os.makedirs('build', exist_ok=True)
+ os.makedirs('build')
+ except OSError:
+ # Don't care if it exists.
+ pass
+ try:
shutil.copy(tarball_cache_path, tarball_path)
print('Using cached tarball: {}'
.format(tarball_cache_path))
@anntzer

anntzer Mar 3, 2017

Contributor

The except just below could probably be just for OSError?

@QuLogic

QuLogic Mar 8, 2017

Member

This is fixed, BTW.

@NelleV

NelleV Mar 8, 2017

Contributor

👍

- except:
+ except OSError:
# If this fails, oh well just re-download
pass
@@ -1165,12 +1168,12 @@ def do_custom_build(self):
os.makedirs('build')
sourceforge_url = (
- 'http://downloads.sourceforge.net/project/freetype'
+ 'https://downloads.sourceforge.net/project/freetype'
'/freetype2/{0}/'.format(LOCAL_FREETYPE_VERSION)
)
url_fmts = (
sourceforge_url + '{0}',
- 'http://download.savannah.gnu.org/releases/freetype/{0}'
+ 'https://download.savannah.gnu.org/releases/freetype/{0}'
)
for url_fmt in url_fmts:
tarball_url = url_fmt.format(tarball)
@@ -1186,12 +1189,15 @@ def do_custom_build(self):
raise IOError("Failed to download freetype")
if get_file_hash(tarball_path) == LOCAL_FREETYPE_HASH:
try:
- # this will fail on LPy, oh well
- os.makedirs(tarball_cache_dir, exist_ok=True)
+ os.makedirs(tarball_cache_dir)
+ except OSError:
+ # Don't care if it exists.
+ pass
+ try:
shutil.copy(tarball_path, tarball_cache_path)
print('Cached tarball at: {}'
.format(tarball_cache_path))
- except:
+ except OSError:
# again, we do not care if this fails, can
# always re download
pass