forked from odlgroup/odl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
71 lines (59 loc) · 2.51 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
language: python
python:
- "2.7"
- "3.6"
sudo: false
addons:
apt:
packages:
libfftw3-dev
texlive-latex-base
texlive-latex-recommended
texlive-latex-extra
dvipng
# Enable cache for $HOME/.cache/pip (wheels and such)
cache: pip
# 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 https://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh;
else
wget 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
- conda update -q conda
# Useful for debugging any issues with conda
- conda info -a
# Install dependencies and enter test environment
- conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION "numpy<1.13" scipy future nomkl sphinx sphinx_rtd_theme pytest pytest-pep8 pytest-cov
- source activate test-environment
# Some packages which are only on PyPI, not on conda
- pip install pyfftw pywavelets travis-sphinx
# Install our package
- pip install -e .
before_script:
- pip install -r test_requirements.txt
script:
# Run tests, including PEP8 check, and produce a coverage report
- pytest --doctest-modules --cov --cov-report term-missing --pep8 $TRAVIS_BUILD_DIR/odl
# Invoke also the alternative way of running the unit tests
- python -c "import odl; odl.test()"
# Build the Sphinx doc (only for Python 3.6, master branch, no PR)
# To avoid clogging the logs, we redirect stderr to /dev/null
- if [[ "$TRAVIS_PYTHON_VERSION" == "3.6" && "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" ]]; then
cd $TRAVIS_BUILD_DIR/doc/source && python generate_doc.py && cd -;
travis-sphinx -n -s $TRAVIS_BUILD_DIR/doc/source build 2>/dev/null;
fi
after_success:
# Push coverage report to coveralls
- coveralls
# Deploy the Sphinx doc to gh-pages (only for Python 3.6, master branch, no PR)
# See https://github.com/Syntaf/travis-sphinx
- if [[ "$TRAVIS_PYTHON_VERSION" == "3.6" && "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" ]]; then
travis-sphinx deploy;
fi