forked from dit/dit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
152 lines (138 loc) · 4.4 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# After changing this file, check it on:
# http://lint.travis-ci.org/
#
language: python
python:
# We don't actually use the Travis Python, but this keeps it organized.
- "3.5"
- "3.6"
- "3.7"
- "3.8"
- "nightly"
os:
- linux
matrix:
fast_finish: true
include:
- os: osx
language: generic
python: "3.8"
env: OPTIONAL_DEPS=true TRAVIS_PYTHON_VERSION="3.8" SLOW=true
- os: osx
language: generic
python: "3.8"
env: OPTIONAL_DEPS=false TRAVIS_PYTHON_VERSION="3.8" SLOW=true
- os: osx
language: generic
python: "pypy3"
env: OPTIONAL_DEPS=false TRAVIS_PYTHON_VERSION="pypy3"
allow_failures:
# pypy Wheels are not yet available.
- python: "pypy3"
- python: "nightly"
- env: OPTIONAL_DEPS=false TRAVIS_PYTHON_VERSION="pypy3"
env:
matrix:
- OPTIONAL_DEPS=true
- OPTIONAL_DEPS=false
before_install:
### Prepare the system to install prerequisites or dependencies
- uname -a
- printenv
- echo $TRAVIS_OS_NAME
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
sudo apt-get update -qq;
elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
brew update;
if [[ "$TRAVIS_PYTHON_VERSION" =~ pypy.* ]]; then
brew install $TRAVIS_PYTHON_VERSION;
fi;
fi
# We do this conditionally because it saves us some downloading if the
# version is the same.
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
echo "On linux";
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
echo "On OSX";
wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh;
fi
- if [[ "$TRAVIS_PYTHON_VERSION" =~ (2|3)\..* ]]; then
bash miniconda.sh -b -p $HOME/miniconda;
export PATH="$HOME/miniconda/bin:$PATH";
hash -r;
conda config --set always_yes yes --set changeps1 no;
true; %conda update -q conda;
conda info -a;
fi
install:
### Install any prerequisites or dependencies necessary to run the build.
- if [[ "$TRAVIS_PYTHON_VERSION" =~ (2|3)\..* ]]; then
conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION pip numpy;
if [ "${OPTIONAL_DEPS}" == "true" ]; then
conda install -n test-environment Cython;
fi;
source activate test-environment;
else
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
sudo apt-get build-dep python-numpy python-scipy python-cvxopt;
fi;
if [[ "$TRAVIS_PYTHON_VERSION" =~ pypy.* ]]; then
sudo $TRAVIS_PYTHON_VERSION -m pip install git+https://bitbucket.org/pypy/numpy.git;
else
pip install --ignore-installed --upgrade pip numpy;
fi;
if [ "${OPTIONAL_DEPS}" == "true" ]; then
pip install --upgrade Cython;
fi;
fi;
before_script:
### Use this to prepare your build for testing
- if [[ "$TRAVIS_PYTHON_VERSION" =~ (2|3)\..* ]]; then
conda install scipy cvxopt;
pip install --upgrade --ignore-installed -r requirements_testing.txt;
elif [[ "$TRAVIS_PYTHON_VERSION" == "nightly" ]]; then
pip install scipy cvxopt;
pip install --upgrade --ignore-installed -r requirements_testing.txt;
elif [[ "$TRAVIS_PYTHON_VERSION" =~ pypy.* ]]; then
sudo $TRAVIS_PYTHON_VERSION -m pip install --ignore-installed -r requirements_testing.txt;
fi;
script:
- printenv PWD
- if ! [[ "$TRAVIS_PYTHON_VERSION" =~ pypy.* ]]; then
pip install .;
else
sudo $TRAVIS_PYTHON_VERSION -m pip install .;
fi
- if ! [[ "$TRAVIS_PYTHON_VERSION" =~ pypy.* ]]; then
if [ "${OPTIONAL_DEPS}" == "true" ]; then
pip install -r requirements_optional.txt;
fi;
fi;
# Run pytest.
- if [[ "$TRAVIS_PYTHON_VERSION" =~ pypy.* ]]; then
if [ "${OPTIONAL_DEPS}" == "true" ]; then
sudo $TRAVIS_PYTHON_VERSION -m pytest .;
else
sudo $TRAVIS_PYTHON_VERSION -m pytest -m "not cython" .;
fi
else
if [ "${OPTIONAL_DEPS}" == "true" ]; then
if [ "${SLOW}" == "true" ]; then
pytest -m "not slow" .;
else
pytest .;
fi
else
if [ "${SLOW}" == "true" ]; then
pytest -m "not cython and not slow" .;
else
pytest -m "not cython" .;
fi
fi
fi
after_success:
- python fixcoverage.py ".*/dit/" "$TRAVIS_BUILD_DIR/dit/"
- codecov
notifications:
email: false