-
Notifications
You must be signed in to change notification settings - Fork 105
/
.travis.yml
103 lines (86 loc) · 3.83 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
94
95
96
97
98
99
100
101
102
103
language: python
matrix:
include:
# Note: NumPy 1.16 is the last one that supports Python 2.7
- python: 2.7
env: NUMPY_VERSION='1.16.*'
# Using Python 3.6 as main version due to availability of wheels (SciPy, NumPy, ...)
- python: 3.6
env: NUMPY_VERSION='1.13.3' PIP_2020_DEPENDENCY_RESOLVER_FLAG='--use-feature=2020-resolver'
- python: 3.6
env: NUMPY_VERSION='1.14.*'
- python: 3.6
env: NUMPY_VERSION='1.15.*'
- python: 3.6
env: NUMPY_VERSION='1.16.*'
- python: 3.6
env: NUMPY_VERSION='1.17.*'
- python: 3.6
env: NUMPY_VERSION='1.16.*' COVERALLS=true
- python: 3.6
env: NUMPY_VERSION='1.16.*' 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/Miniconda2-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
- source activate testenv
# Install packages with pip if possible, it's way faster
- pip install $PIP_2020_DEPENDENCY_RESOLVER_FLAG "numpy==$NUMPY_VERSION" scipy future packaging scikit-image pywavelets;
# Building pyfftw wheels sometimes fails, using a conda-forge version instead;
# To avoid a lower version of NumPy being installed over the pip one, we exclude all dependencies
# (PyFFTW only depends on NumPy)
- conda install -c conda-forge --no-deps 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 .[testing]
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 $TRAVIS_BUILD_DIR/odl || exit -1;
echo "import odl; odl.test(['--doctest-modules'])" > $TRAVIS_BUILD_DIR/_run_tests.py;
coverage run $TRAVIS_BUILD_DIR/_run_tests.py;
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