Skip to content

Commit

Permalink
Merge pull request #65 from ajdawson/better-build-matrix
Browse files Browse the repository at this point in the history
Improve the build matrix on Travis CI.
  • Loading branch information
ajdawson committed Mar 3, 2016
2 parents 58c7fea + 100dd3b commit eb73088
Showing 1 changed file with 32 additions and 30 deletions.
62 changes: 32 additions & 30 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,52 +1,54 @@
language: python

python:
- "2.7"
- "3.3"
- "3.4"
- "3.5"

sudo: false

env:
- TEST_MODE=complete
- TEST_MODE=basic

matrix:
exclude:
- python: "3.3"
env: TEST_MODE=complete
- python: "3.5"
env: TEST_MODE=complete
global:
- PACKAGES_STANDARD="setuptools numpy nose pep8 coverage"
matrix:
- NAME="Python 2.7 (standard)"
PYTHON_VERSION=2.7
PACKAGES="${PACKAGES_STANDARD}"
- NAME="Python 2.7 (metadata)"
PYTHON_VERSION=2.7
PACKAGES="${PACKAGES_STANDARD} cdat-lite iris xarray"
- NAME="Python 3.3 (standard)"
PYTHON_VERSION=3.3
PACKAGES="${PACKAGES_STANDARD}"
- NAME="Python 3.4 (standard)"
PYTHON_VERSION=3.4
PACKAGES="${PACKAGES_STANDARD}"
- NAME="Python 3.4 (metadata)"
PYTHON_VERSION=3.4
PACKAGES="${PACKAGES_STANDARD} iris xarray"
- NAME="Python 3.5 (standard)"
PYTHON_VERSION=3.5
PACKAGES="${PACKAGES_STANDARD}"
- NAME="Python 3.5 (metadata)"
PYTHON_VERSION=3.5
PACKAGES="${PACKAGES_STANDARD} xarray"

install:
# Install Miniconda so we can use it to manage dependencies:
- if [[ "$TRAVIS_PYTHON_VERSION" == 2* ]]; then
wget http://repo.continuum.io/miniconda/Miniconda-3.4.2-Linux-x86_64.sh -O miniconda.sh;
wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh;
else
wget http://repo.continuum.io/miniconda/Miniconda3-3.4.2-Linux-x86_64.sh -O miniconda.sh;
wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
fi
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- hash -r
# Setup conda to use extra channels for dependencies:
- conda config --set always_yes yes --set changeps1 no
- conda config --add channels scitools
- conda config --add channels ajdawson
- conda update conda
- conda info -a
# Create a conda environment with the base dependencies:
- conda create -n test-environment python=$TRAVIS_PYTHON_VERSION
# Create a conda environment with the required python version:
- conda create -n test-environment python=$PYTHON_VERSION
- source activate test-environment
# In complete testing mode, install cdat-lite and iris for Python 2 and
# iris for Python 3:
- if [[ "$TRAVIS_PYTHON_VERSION" == 2* ]] && [[ "$TEST_MODE" == "complete" ]]; then
conda config --add channels SciTools;
conda install setuptools nose coverage pep8 numpy cdat-lite iris xarray;
elif [[ "$TRAVIS_PYTHON_VERSION" == 3* ]] && [[ "$TEST_MODE" == "complete" ]]; then
conda config --add channels SciTools;
conda install setuptools nose coverage pep8 numpy iris xarray;
else
conda install setuptools nose coverage pep8 numpy;
fi
# Install required packages:
- conda install ${PACKAGES}
# Install the package:
- python setup.py install

Expand Down

0 comments on commit eb73088

Please sign in to comment.