Skip to content

Commit 587357b

Browse files
committed
1st take on continuous integration via travis
1 parent ef7e473 commit 587357b

File tree

4 files changed

+106
-1
lines changed

4 files changed

+106
-1
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# System-specific temporary and index files
2+
.DS_Store
3+
14
# Byte-compiled / optimized / DLL files
25
__pycache__/
36
*.py[cod]
@@ -58,4 +61,4 @@ target/
5861

5962
# IPython Notebooks
6063
Testing TPOT usage.ipynb
61-
.ipynb_checkpoints/*
64+
.ipynb_checkpoints/*

.travis.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
language: python
2+
virtualenv:
3+
system_site_packages: true
4+
env:
5+
matrix:
6+
# let's start simple:
7+
#- PYTHON_VERSION="2.7" LATEST="true"
8+
- PYTHON_VERSION="3.4" LATEST="true"
9+
#- PYTHON_VERSION="3.5" LATEST="true"
10+
#- PYTHON_VERSION="3.4" COVERAGE="true" LATEST="true"
11+
install: source ./ci/.travis_install.sh
12+
script: bash ./ci/.travis_test.sh
13+
after_success:
14+
# Ignore coveralls failures as the coveralls server is not very reliable
15+
# but we don't want travis to report a failure in the github UI just
16+
# because the coverage report failed to be published.
17+
- if [[ "$COVERAGE" == "true" ]]; then coveralls || echo "failed"; fi
18+
cache: apt
19+
sudo: false

ci/.travis_install.sh

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
#!/bin/bash
2+
3+
# modified from https://github.com/trevorstephens/gplearn
4+
5+
# This script is meant to be called by the "install" step defined in
6+
# .travis.yml. See http://docs.travis-ci.com/ for more details.
7+
# The behavior of the script is controlled by environment variabled defined
8+
# in the .travis.yml in the top level folder of the project.
9+
10+
11+
# License: GNU/GPLv3
12+
13+
set -e
14+
15+
# Fix the compilers to workaround avoid having the Python 3.4 build
16+
# lookup for g++44 unexpectedly.
17+
export CC=gcc
18+
export CXX=g++
19+
20+
# Deactivate the travis-provided virtual environment and setup a
21+
# conda-based environment instead
22+
deactivate
23+
24+
# Use the miniconda installer for faster download / install of conda
25+
# itself
26+
wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh \
27+
-O miniconda.sh
28+
chmod +x miniconda.sh && ./miniconda.sh -b
29+
export PATH=/home/travis/miniconda/bin:$PATH
30+
conda update --yes conda
31+
32+
# Configure the conda environment and put it in the path using the
33+
# provided versions
34+
if [[ "$LATEST" == "true" ]]; then
35+
conda create -n testenv --yes python=$PYTHON_VERSION pip nose \
36+
numpy scipy scikit-learn cython pandas deap
37+
else
38+
conda create -n testenv --yes python=$PYTHON_VERSION pip nose \
39+
numpy=$NUMPY_VERSION scipy=$SCIPY_VERSION \
40+
scikit-learn=$SKLEARN_VERSION \
41+
pandas=$PANDAS_VERSION \
42+
deap=$DEAP_VERSION \
43+
cython
44+
fi
45+
46+
source activate testenv
47+
48+
if [[ "$COVERAGE" == "true" ]]; then
49+
pip install coverage coveralls
50+
fi
51+
52+
# build output in the travis output when it succeeds.
53+
python --version
54+
python -c "import numpy; print('numpy %s' % numpy.__version__)"
55+
python -c "import scipy; print('scipy %s' % scipy.__version__)"
56+
python -c "import sklearn; print('sklearn %s' % sklearn.__version__)"
57+
python -c "import pandas; print('pandas %s' % pandas.__version__)"
58+
python -c "import deap; print('deap %s' % deap.__version__)"
59+
python setup.py build_ext --inplace

ci/.travis_test.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# modified from https://github.com/trevorstephens/gplearn
2+
3+
# This script is meant to be called by the "install" step defined in
4+
# .travis.yml. See http://docs.travis-ci.com/ for more details.
5+
# The behavior of the script is controlled by environment variabled defined
6+
# in the .travis.yml in the top level folder of the project.
7+
8+
# License: GNU/GPLv3
9+
10+
set -e
11+
12+
python --version
13+
python -c "import numpy; print('numpy %s' % numpy.__version__)"
14+
python -c "import scipy; print('scipy %s' % scipy.__version__)"
15+
python -c "import sklearn; print('sklearn %s' % sklearn.__version__)"
16+
python -c "import pandas; print('pandas %s' % pandas.__version__)"
17+
python -c "import deap; print('deap %s' % deap.__version__)"
18+
19+
if [[ "$COVERAGE" == "true" ]]; then
20+
nosetests -s -v --with-coverage
21+
else
22+
nosetests -s -v
23+
fi
24+
#make test-doc test-sphinxext

0 commit comments

Comments
 (0)