diff --git a/.travis.yml b/.travis.yml index 77fc2f8963c3..625d2f4c077d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/appveyor.yml b/appveyor.yml index df916cd9de9b..653e7d5ebd00 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -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%" diff --git a/setupext.py b/setupext.py index 3f6430cb15dd..1b2506da2c6b 100644 --- a/setupext.py +++ b/setupext.py @@ -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)) - 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