Skip to content
This repository has been archived by the owner on Dec 2, 2020. It is now read-only.

Commit

Permalink
Merge pull request #36 from bsipocz/infrastructure_update
Browse files Browse the repository at this point in the history
Infrastructure update
  • Loading branch information
astrofrog committed Jul 4, 2016
2 parents aee8f38 + 1c1b91e commit 0850eaf
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 94 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -11,6 +11,7 @@ __pycache__

# Other generated files
*/version.py
montage_wrapper/cython_version.py

# Sphinx
_build
Expand Down
118 changes: 47 additions & 71 deletions .travis.yml
@@ -1,106 +1,82 @@
language: python

python:
- 2.6
- 2.7
- 3.3
- 3.4
# This is just for "egg_info". All other builds are explicitly given in the matrix
- 3.5

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

# The apt packages below are needed for sphinx builds, which can no longer
# be installed with sudo apt-get.
addons:
apt:
packages:
- graphviz
- texlive-latex-extra
- dvipng

env:
global:

# The following versions are the 'default' for tests, unless
# overidden underneath. They are defined here in order to save having
# overridden underneath. They are defined here in order to save having
# to repeat them for all configurations.
- NUMPY_VERSION=1.9
- NUMPY_VERSION=stable
- ASTROPY_VERSION=stable
- CONDA_INSTALL='conda install -c astropy-ci-extras --yes'
- PIP_INSTALL='pip install'
- SETUP_CMD='test'
- CONDA_DEPENDENCIES=''
- PIP_DEPENDENCIES=''

matrix:
- SETUP_CMD='egg_info'
- SETUP_CMD='test'

matrix:
include:

# Do a coverage test in Python 2.
- python: 2.7
env: SETUP_CMD='test --coverage'

# Check for sphinx doc build warnings - we do this first because it
# may run for a long time
- python: 2.7
env: SETUP_CMD='build_sphinx -w'

# Try Astropy development version
- python: 2.7
env: ASTROPY_VERSION=development SETUP_CMD='test'
- python: 3.3
env: ASTROPY_VERSION=development SETUP_CMD='test'

# Try all python versions with the latest numpy
- python: 2.6
env: SETUP_CMD='test'
env: ASTROPY_VERSION=development SETUP_CMD='test --coverage'
- python: 3.5
env: ASTROPY_VERSION=development
- python: 2.7
env: SETUP_CMD='test'
env: ASTROPY_VERSION=lts
- python: 3.5
env: ASTROPY_VERSION=lts

# Python 3.3 doesn't have numpy 1.10 in conda, they can be put
# back into the main matrix once the numpy build is available in the
# astropy-ci-extras channel (or in the one provided in the
# CONDA_CHANNELS environmental variable).
- python: 3.3
env: SETUP_CMD='egg_info'
- python: 3.3
env: SETUP_CMD='test'
- python: 3.4
env: SETUP_CMD='test'
env: SETUP_CMD='test' NUMPY_VERSION=1.9

# Try older numpy versions
- python: 2.7
env: NUMPY_VERSION=1.8 SETUP_CMD='test'
env: NUMPY_VERSION=1.10
- python: 2.7
env: NUMPY_VERSION=1.7 SETUP_CMD='test'
env: NUMPY_VERSION=1.9
- python: 2.7
env: NUMPY_VERSION=1.6 SETUP_CMD='test'

before_install:

# Use utf8 encoding. Should be default, but this is insurance against
# future changes
- export PYTHONIOENCODING=UTF8
- wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh
- chmod +x miniconda.sh
- ./miniconda.sh -b
- export PATH=/home/travis/miniconda/bin:$PATH
- conda update --yes conda

# UPDATE APT-GET LISTINGS
- sudo apt-get update
env: NUMPY_VERSION=1.8
- python: 2.7
env: NUMPY_VERSION=1.7

# DOCUMENTATION DEPENDENCIES
- if [[ $SETUP_CMD == build_sphinx* ]]; then sudo apt-get install graphviz texlive-latex-extra dvipng; fi
# Try numpy pre-release
- python: 3.5
env: NUMPY_VERSION=prerelease

install:

# CONDA
- conda create --yes -n test -c astropy-ci-extras python=$TRAVIS_PYTHON_VERSION
- source activate test

# CORE DEPENDENCIES
- if [[ $SETUP_CMD != egg_info ]]; then $CONDA_INSTALL numpy=$NUMPY_VERSION pytest pip Cython jinja2; fi
- if [[ $SETUP_CMD != egg_info ]]; then $PIP_INSTALL pytest-xdist; fi

# ASTROPY
- if [[ $SETUP_CMD != egg_info ]] && [[ $ASTROPY_VERSION == development ]]; then $PIP_INSTALL git+http://github.com/astropy/astropy.git#egg=astropy; fi
- if [[ $SETUP_CMD != egg_info ]] && [[ $ASTROPY_VERSION == stable ]]; then $CONDA_INSTALL numpy=$NUMPY_VERSION astropy; fi

# OPTIONAL DEPENDENCIES
# Here you can add any dependencies your package may have. You can use
# conda for packages available through conda, or pip for any other
# packages. You should leave the `numpy=$NUMPY_VERSION` in the `conda`
# install since this ensures Numpy does not get automatically upgraded.
# - if [[ $SETUP_CMD != egg_info ]]; then $CONDA_INSTALL numpy=$NUMPY_VERSION ... ; fi
# - if [[ $SETUP_CMD != egg_info ]]; then $PIP_INSTALL ...; fi

# DOCUMENTATION DEPENDENCIES
# build_sphinx needs sphinx and matplotlib (for plot_directive). Note that
# this matplotlib will *not* work with py 3.x, but our sphinx build is
# currently 2.7, so that's fine
- if [[ $SETUP_CMD == build_sphinx* ]]; then $CONDA_INSTALL numpy=$NUMPY_VERSION Sphinx matplotlib; fi

# COVERAGE DEPENDENCIES
- if [[ $SETUP_CMD == 'test --coverage' ]]; then $PIP_INSTALL coverage coveralls; fi
# Installing python dependencies with conda
- git clone git://github.com/astropy/ci-helpers.git
- source ci-helpers/travis/setup_conda_$TRAVIS_OS_NAME.sh

# Build Montage from source
- wget http://montage.ipac.caltech.edu/download/Montage_v3.3.tar.gz
Expand Down
40 changes: 17 additions & 23 deletions montage_wrapper/conftest.py
@@ -1,3 +1,5 @@
import os

# this contains imports plugins that configure py.test for astropy tests.
# by importing them here in conftest.py they are discoverable by py.test
# no matter how it is invoked within the source tree.
Expand All @@ -8,27 +10,19 @@
## exceptions
# enable_deprecations_as_exceptions()

## Uncomment and customize the following lines to add/remove entries
## from the list of packages for which version numbers are displayed
## when running the tests
# try:
# PYTEST_HEADER_MODULES['Astropy'] = 'astropy'
# PYTEST_HEADER_MODULES['scikit-image'] = 'skimage'
# del PYTEST_HEADER_MODULES['h5py']
# except NameError: # needed to support Astropy < 1.0
# pass
try:
PYTEST_HEADER_MODULES['Astropy'] = 'astropy'
del PYTEST_HEADER_MODULES['h5py']
del PYTEST_HEADER_MODULES['Scipy']
except NameError: # needed to support Astropy < 1.0
pass

# This is to figure out the affiliated package version, rather than
# using Astropy's
from . import version

## Uncomment the following lines to display the version number of the
## package rather than the version number of Astropy in the top line when
## running the tests.
# import os
#
## This is to figure out the affiliated package version, rather than
## using Astropy's
# from . import version
#
# try:
# packagename = os.path.basename(os.path.dirname(__file__))
# TESTED_VERSIONS[packagename] = version.version
# except NameError: # Needed to support Astropy <= 1.0.0
# pass
try:
packagename = os.path.basename(os.path.dirname(__file__))
TESTED_VERSIONS[packagename] = version.version
except NameError: # Needed to support Astropy <= 1.0.0
pass

0 comments on commit 0850eaf

Please sign in to comment.