forked from odlgroup/odl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
92 lines (77 loc) · 3.22 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
language: python
matrix:
include:
- python: 2.7
env: NUMPY_VERSION=1.13
- python: 3.6
env: NUMPY_VERSION=1.10.1
- python: 3.6
env: NUMPY_VERSION=1.12
- python: 3.6
env: NUMPY_VERSION=1.13 COVERALLS=true
- python: 3.6
env: NUMPY_VERSION=1.13 SKIP_TESTS=true BUILD_DOCS=true
sudo: false
addons:
apt:
packages:
libfftw3-dev
texlive-latex-base
texlive-latex-recommended
texlive-latex-extra
dvipng
# Setup numpy + scipy using miniconda
# See http://conda.pydata.org/docs/travis.html
install:
# Install miniconda according to Python version of the build (saves downloading if versions match)
- if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then
wget -q https://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh;
else
wget -q https://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
- conda config --set always_yes yes --set changeps1 no
# Useful for debugging any issues with conda
- conda info -a
# Install dependencies and enter test environment. Use conda for the minimal stuff to
# make it run faster and avoid downloading big stuff like mkl
- conda create -n testenv python=$TRAVIS_PYTHON_VERSION nomkl pywavelets
- source activate testenv
# Install packages with pip if possible, it's way faster
- pip install "numpy==$NUMPY_VERSION" scipy future scikit-image pytest pytest-cov;
# Building pyfftw wheels sometimes fails, using a conda-forge version instead
- conda install -c conda-forge pyfftw
# Doc dependencies
- if [[ "$BUILD_DOCS" == "true" ]]; then
pip install "sphinx>=1.7" sphinx_rtd_theme "travis-sphinx>=2.1.2";
fi
# Install our package
- pip install -e .
before_script:
- pip install -r test_requirements.txt
script:
# Run tests and produce a coverage report.
# Also invoke the alternative way of running the unit tests.
# Fail immediately after first failure to speed up the whole thing.
- if [[ "$SKIP_TESTS" != "true" ]]; then
pytest --doctest-modules --cov --cov-report term-missing $TRAVIS_BUILD_DIR/odl || exit -1;
python -c "import odl; odl.test()" || exit -1;
fi
# Build the Sphinx doc (only for one specific build, master branch, no PR)
# To avoid clogging the logs, we redirect stderr to /dev/null
- if [[ "$BUILD_DOCS" == "true" ]]; then
cd $TRAVIS_BUILD_DIR/doc/source && python generate_doc.py && cd -;
travis-sphinx build -n -s $TRAVIS_BUILD_DIR/doc/source 2>/dev/null;
fi
after_success:
# Push coverage report to coveralls, but only the one with most dependencies installed
- if [[ "$COVERALLS" == "true" ]]; then
coveralls;
fi
# Deploy the Sphinx doc to gh-pages (only for one specific build, master branch, no PR)
# See https://github.com/Syntaf/travis-sphinx
- if [[ "$BUILD_DOCS" == "true" && "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" ]]; then
travis-sphinx deploy;
fi