forked from nengo/nengo
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.travis.yml
93 lines (87 loc) · 3.14 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
language: c
sudo: false
notifications:
email:
env:
global:
- NUMPY="1.13"
- SCIPY="false"
- COVERAGE="false"
- STATIC="false"
- DOCS="false"
- CONDA_DEPS="matplotlib jupyter"
- PIP_DEPS="pytest pytest-xdist"
matrix:
include:
- env: PYTHON="2.7" STATIC="true"
- env: PYTHON="2.7" COVERAGE="true"
- env: PYTHON="2.7" NUMPY="1.8"
- env: PYTHON="2.7" NUMPY="1.9"
- env: PYTHON="2.7" NUMPY="1.10"
- env: PYTHON="2.7" NUMPY="1.11"
- env: PYTHON="2.7" NUMPY="1.12"
- env: PYTHON="3.4" NUMPY="1.11" # 1.12 not packaged for py34 in conda
- env: PYTHON="3.5"
- env: PYTHON="3.6" COVERAGE="true" SCIPY="true"
- env: PYTHON="3.6" DOCS="true"
# Setup Miniconda
before_install:
- wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh
- bash miniconda.sh -b -p "$HOME/miniconda"
- export PATH="$HOME/miniconda/bin:$PATH"
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda
- conda info -a
- conda create -q -n test python="$PYTHON" pip
- source activate test
# Install packages with conda, then pip
install:
- if [[ "$COVERAGE" == "true" ]]; then
export PIP_DEPS="pytest coverage";
elif [[ "$STATIC" == "true" ]]; then
export CONDA_DEPS="";
export PIP_DEPS="flake8 pylint";
elif [[ "$DOCS" == "true" ]]; then
export CONDA_DEPS="matplotlib scipy";
export PIP_DEPS="ipython[all]==2.4.1 sphinx ghp-import -e git+https://github.com/tbekolay/guzzle_sphinx_theme.git@use_smartypants#egg=guzzle_sphinx_theme";
fi
- if [[ -n "$NUMPY" && "$STATIC" == "false" ]]; then
export CONDA_DEPS="$CONDA_DEPS numpy=$NUMPY";
fi
- if [[ "$SCIPY" == "true" ]]; then
export CONDA_DEPS="$CONDA_DEPS scipy";
fi
- if [[ -n "$CONDA_DEPS" ]]; then eval conda install "$CONDA_DEPS"; fi
- if [[ -n "$PIP_DEPS" ]]; then eval pip install "$PIP_DEPS"; fi
# Run the tests
script:
- mkdir -p "$HOME/.ipython/profile_default"
- "echo 'c.HistoryAccessor.enabled = False\n' > $HOME/.ipython/profile_default/ipython_config.py"
- if [[ "$STATIC" == "true" ]]; then
flake8 -v nengo && pylint nengo;
else
python -c "import numpy; numpy.show_config()";
python setup.py -q develop;
if [[ "$COVERAGE" == "true" ]]; then
coverage run --rcfile .coveragerc --source nengo -m py.test nengo -v --duration 20 && coverage report;
elif [[ "$DOCS" == "true" ]]; then
if [[ -n "$TRAVIS_TAG" ]]; then
rm "$HOME/.ipython/profile_default/ipython_config.py";
sphinx-build -W docs docs/_build;
fi
else
py.test nengo -n 2 -v --duration 20;
fi
fi
after_success:
- if [[ "$COVERAGE" == "true" ]]; then
eval "bash <(curl -s https://codecov.io/bash)";
fi
- if [[ -n "$TRAVIS_TAG" && "$DOCS" == "true" ]]; then
export DATE=$(date '+%Y-%m-%d %T');
git config --global user.email "[email protected]";
git config --global user.name "TravisCI";
ghp-import -m "Last update at $DATE" -b gh-pages docs/_build;
git push -fq "https://[email protected]/nengo/nengo.git" gh-pages;
fi