Skip to content

Commit

Permalink
MAINT use conda in .travis.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
superbobry committed Oct 29, 2014
1 parent fd2507d commit c3745e5
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 38 deletions.
41 changes: 7 additions & 34 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,9 @@
language: python
install: source continuous_integration/install.sh
script: bash continuous_integration/test_script.sh
env:
- COVERAGE=--with-coverage
python:
- "2.7"
- "2.6"
- "3.3"
virtualenv:
system_site_packages: true
before_install:
- wget -O- http://neuro.debian.net/lists/precise.us-nh.libre | sudo tee /etc/apt/sources.list.d/neurodebian.sources.list
- sudo apt-key adv --recv-keys --keyserver pgp.mit.edu 2649A5A9
- if [[ $TRAVIS_PYTHON_VERSION != '2.7' ]]; then wget http://repo.continuum.io/miniconda/Miniconda-2.2.2-Linux-x86_64.sh -O miniconda.sh ; fi
- if [[ $TRAVIS_PYTHON_VERSION != '2.7' ]]; then chmod +x miniconda.sh ; fi
- if [[ $TRAVIS_PYTHON_VERSION != '2.7' ]]; then ./miniconda.sh -b ; fi
- if [[ $TRAVIS_PYTHON_VERSION != '2.7' ]]; then export PATH=/home/travis/anaconda/bin:$PATH ; fi
- if [[ $TRAVIS_PYTHON_VERSION != '2.7' ]]; then conda update --yes conda ; fi
- if [[ $TRAVIS_PYTHON_VERSION != '2.7' ]]; then conda update --yes conda ; fi
- if [[ $TRAVIS_PYTHON_VERSION != '2.7' ]]; then conda create -n testenv --yes pip python=$TRAVIS_PYTHON_VERSION ; fi
- if [[ $TRAVIS_PYTHON_VERSION != '2.7' ]]; then source activate testenv ; fi
- if [[ $TRAVIS_PYTHON_VERSION != '2.7' ]]; then conda install --yes numpy scipy nose scikit-learn ; fi
- if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then sudo apt-get update -qq ; fi
- if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then sudo apt-get install -qq python-scipy python-nose python-pip python-sklearn ; fi
install:
- python setup.py build_ext --inplace
- if [ "${COVERAGE}" == "--with-coverage" ]; then sudo pip install coverage; fi
- if [ "${COVERAGE}" == "--with-coverage" ]; then sudo pip install coveralls; fi
script:
- if [ "${COVERAGE}" == "--with-coverage" ]; then
- make test-coverage;
- else
- make test;
- fi
after_success:
- if [ "${COVERAGE}" == "--with-coverage" ]; then coveralls; fi

matrix:
- PYTHON_VERSION="2.6"
- PYTHON_VERSION="2.7"
- PYTHON_VERSION="3.3"
- PYTHON_VERSION="3.4"
5 changes: 1 addition & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@ inplace:
test-code: in
$(NOSETESTS) -s -v hmmlearn
test-doc:
$(NOSETESTS) -s -v doc/ doc/modules/ doc/datasets/ \
doc/developers doc/tutorial/basic doc/tutorial/statistical_inference \
doc/tutorial/text_analytics

$(NOSETESTS) -s -v doc/ doc/modules/
test-coverage:
rm -rf coverage .coverage
$(NOSETESTS) -s -v --with-coverage hmmlearn
Expand Down
37 changes: 37 additions & 0 deletions continuous_integration/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/bash
# This script is meant to be called by the "install" step defined in
# .travis.yml. See http://docs.travis-ci.com/ for more details.
# The behavior of the script is controlled by environment variabled defined
# in the .travis.yml in the top level folder of the project.

# License: 3-clause BSD

set -e

# Fix the compilers to workaround avoid having the Python 3.4 build
# lookup for g++44 unexpectedly.
export CC=gcc
export CXX=g++

# Deactivate the travis-provided virtual environment and setup a
# conda-based environment instead
deactivate

# Use the miniconda installer for faster download / install of conda
# itself
wget http://repo.continuum.io/miniconda/Miniconda-3.7.0-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

# Configure the conda environment and put it in the path using the
# provided versions
conda create -n testenv --yes python=$PYTHON_VERSION pip nose scikit-learn
source activate testenv

# Build hmmlearn in the install.sh script to collapse the verbose
# build output in the travis output when it succeeds.
python --version
python -c "import sklearn; print('sklearn %s' % sklearn.__version__)"
python setup.py build_ext --inplace
14 changes: 14 additions & 0 deletions continuous_integration/test_script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash
# This script is meant to be called by the "script" step defined in
# .travis.yml. See http://docs.travis-ci.com/ for more details.
# The behavior of the script is controlled by environment variabled defined
# in the .travis.yml in the top level folder of the project.

# License: 3-clause BSD

set -e

python --version
python -c "import sklearn; print('sklearn %s' % sklearn.__version__)"

make test

0 comments on commit c3745e5

Please sign in to comment.