Skip to content
This repository has been archived by the owner on Jun 16, 2018. It is now read-only.

Switch to container-based Travis infrastructure #172

Merged
merged 3 commits into from
Oct 4, 2015
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
17 changes: 11 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
language: python

# Setting sudo to false opts in to Travis-CI container-based builds.
sudo: false

# The apt packages below are needed for sphinx builds
addons:
apt:
packages:
- graphviz
- texlive-latex-extra
- dvipng

python:
- 2.6
- 2.7
Expand Down Expand Up @@ -65,12 +76,6 @@ before_install:
- export PATH=/home/travis/miniconda/bin:$PATH
- conda update --yes conda

# UPDATE APT-GET LISTINGS
- sudo apt-get update

# DOCUMENTATION DEPENDENCIES
- if [[ $SETUP_CMD == build_sphinx* ]]; then sudo apt-get install graphviz texlive-latex-extra dvipng; fi

# Make sure that interactive matplotlib backends work
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
Expand Down
16 changes: 15 additions & 1 deletion wcsaxes/datasets/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Downloads the FITS files that are used in image testing and for building documentation.
"""

import time

from astropy.utils.data import download_file
from astropy.io import fits

Expand All @@ -11,13 +14,24 @@
'fetch_bolocam_hdu',
]

MAX_RETRIES = 10
TIME_BETWEEN_RETRIES = 5
URL = 'http://data.astropy.org/'


def fetch_hdu(filename, cache=True):
"""Download a FITS file to the cache and open HDU 0.
"""
path = download_file(URL + filename, cache=cache)
for retry in range(MAX_RETRIES):
try:
path = download_file(URL + filename, cache=cache, timeout=30)
except:
if retry == MAX_RETRIES - 1:
raise
else:
time.sleep(TIME_BETWEEN_RETRIES)
else:
break
return fits.open(path)[0]


Expand Down