Skip to content

Commit 7554c36

Browse files
committed
Merge pull request scikit-learn#3022 from ogrisel/travis-old-numpy-scipy
[MRG] Set travis to test old versions of numpy and scipy too
2 parents 4c4bda3 + 80ef9eb commit 7554c36

File tree

3 files changed

+79
-30
lines changed

3 files changed

+79
-30
lines changed

.travis.yml

Lines changed: 12 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,16 @@
11
language: python
2-
env:
3-
- COVERAGE=--with-coverage
4-
python:
5-
- "2.7"
6-
- "2.6"
7-
- "3.3"
82
virtualenv:
93
system_site_packages: true
10-
before_install:
11-
- 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
12-
- if [[ $TRAVIS_PYTHON_VERSION != '2.7' ]]; then chmod +x miniconda.sh ; fi
13-
- if [[ $TRAVIS_PYTHON_VERSION != '2.7' ]]; then ./miniconda.sh -b ; fi
14-
- if [[ $TRAVIS_PYTHON_VERSION != '2.7' ]]; then export PATH=/home/travis/anaconda/bin:$PATH ; fi
15-
- if [[ $TRAVIS_PYTHON_VERSION != '2.7' ]]; then conda update --yes conda ; fi
16-
- if [[ $TRAVIS_PYTHON_VERSION != '2.7' ]]; then conda update --yes conda ; fi
17-
- if [[ $TRAVIS_PYTHON_VERSION != '2.7' ]]; then conda create -n testenv --yes pip python=$TRAVIS_PYTHON_VERSION ; fi
18-
- if [[ $TRAVIS_PYTHON_VERSION != '2.7' ]]; then source activate testenv ; fi
19-
- if [[ $TRAVIS_PYTHON_VERSION != '2.7' ]]; then conda install --yes numpy scipy nose ; fi
20-
- if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then sudo apt-get update -qq ; fi
21-
- if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then sudo apt-get install -qq python-scipy python-nose python-pip ; fi
22-
install:
23-
- python setup.py build_ext --inplace
24-
- if [ "${COVERAGE}" == "--with-coverage" ]; then sudo pip install coverage; fi
25-
- if [ "${COVERAGE}" == "--with-coverage" ]; then sudo pip install coveralls; fi
26-
script:
27-
- if [ "${COVERAGE}" == "--with-coverage" ]; then
28-
- make test-coverage;
29-
- else
30-
- make test;
31-
- fi
4+
env:
5+
matrix:
6+
- DISTRIB="ubuntu" PYTHON_VERSION="2.7" INSTALL_ATLAS="true"
7+
COVERAGE="true"
8+
- DISTRIB="conda" PYTHON_VERSION="2.6" INSTALL_MKL="false"
9+
NUMPY_VERSION="1.6.2" SCIPY_VERSION="0.11.0"
10+
- DISTRIB="conda" PYTHON_VERSION="3.3" INSTALL_MKL="true"
11+
NUMPY_VERSION="1.8.1" SCIPY_VERSION="0.13.3"
12+
install: source continuous_integration/install.sh
13+
script: bash continuous_integration/test_script.sh
3214
after_success:
33-
- if [ "${COVERAGE}" == "--with-coverage" ]; then coveralls; fi
34-
15+
- if [[ "$COVERAGE" == "true" ]]; then coveralls; fi
16+
cache: apt

continuous_integration/install.sh

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/bin/bash
2+
# This script is meant to be called by the "install" step defined in
3+
# .travis.yml. See http://docs.travis-ci.com/ for more details.
4+
# The behavior of the script is controlled by environment variabled defined
5+
# in the .travis.yml in the top level folder of the project.
6+
7+
set -e
8+
9+
sudo apt-get update -qq
10+
if [[ "$INSTALL_ATLAS" == "true" ]]; then
11+
sudo apt-get install -qq libatlas3gf-base libatlas-dev
12+
fi
13+
14+
if [[ "$DISTRIB" == "conda" ]]; then
15+
# Deactivate the travis-provided virtual environment and setup a
16+
# conda-based environment instead
17+
deactivate
18+
19+
# Use the miniconda installer for faster download / install of conda
20+
# itself
21+
wget http://repo.continuum.io/miniconda/Miniconda-2.2.2-Linux-x86_64.sh \
22+
-O miniconda.sh
23+
chmod +x miniconda.sh && ./miniconda.sh -b
24+
export PATH=/home/travis/anaconda/bin:$PATH
25+
conda update --yes conda
26+
27+
# Configure the conda environment and put it in the path using the
28+
# provided versions
29+
conda create -n testenv --yes python=$PYTHON_VERSION pip nose \
30+
numpy=$NUMPY_VERSION scipy=$SCIPY_VERSION
31+
source activate testenv
32+
33+
if [[ "$INSTALL_MKL" == "true" ]]; then
34+
# Make sure that MKL is used
35+
conda install --yes mkl
36+
else
37+
# Make sure that MKL is not used
38+
conda remove --yes --features mkl || echo "MKL not installed"
39+
fi
40+
41+
elif [[ "$DISTRIB" == "ubuntu" ]]; then
42+
# Use standard ubuntu packages in their default version
43+
sudo apt-get install -qq python-scipy python-nose python-pip
44+
fi
45+
46+
if [[ "$COVERAGE" == "true" ]]; then
47+
pip install coverage coveralls
48+
fi
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
# This script is meant to be called by the "script" step defined in
3+
# .travis.yml. See http://docs.travis-ci.com/ for more details.
4+
# The behavior of the script is controlled by environment variabled defined
5+
# in the .travis.yml in the top level folder of the project.
6+
7+
set -e
8+
9+
python --version
10+
python -c "import numpy; print('numpy %s' % numpy.__version__)"
11+
python -c "import scipy; print('scipy %s' % scipy.__version__)"
12+
python setup.py build_ext --inplace
13+
14+
if [[ "$COVERAGE" == "true" ]]; then
15+
export WITH_COVERAGE="--with-coverage"
16+
else
17+
export WITH_COVERAGE=""
18+
fi
19+
nosetests -s -v $WITH_COVERAGE sklearn

0 commit comments

Comments
 (0)