forked from python-control/python-control
-
Notifications
You must be signed in to change notification settings - Fork 3
/
.travis.yml
146 lines (133 loc) · 4.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
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
sudo: false
language: python
dist: xenial
services:
- xvfb
cache:
apt: true
pip: true
directories:
- $HOME/.cache/pip
- $HOME/.local
python:
- "3.7"
- "3.6"
- "2.7"
# Test against multiple version of SciPy, with and without slycot
#
# Because there were significant changes in SciPy between v0 and v1, we
# test against both of these using the Travis CI environment capability
#
# We also want to test with and without slycot
env:
- SCIPY=scipy SLYCOT=conda # default, with slycot via conda
- SCIPY=scipy SLYCOT= # default, w/out slycot
- SCIPY="scipy==0.19.1" SLYCOT= # legacy support, w/out slycot
# Add optional builds that test against latest version of slycot, python
jobs:
include:
- name: "linux, Python 2.7, slycot=source"
os: linux
dist: xenial
services: xvfb
python: "2.7"
env: SCIPY=scipy SLYCOT=source
- name: "linux, Python 3.7, slycot=source"
os: linux
dist: xenial
services: xvfb
python: "3.7"
env: SCIPY=scipy SLYCOT=source
- name: "linux, Python 3.8, slycot=source"
os: linux
dist: xenial
services: xvfb
python: "3.8"
env: SCIPY=scipy SLYCOT=source
# Exclude combinations that are very unlikely (and don't work)
exclude:
- python: "3.7" # python3.7 should use latest scipy
env: SCIPY="scipy==0.19.1" SLYCOT=
allow_failures:
- name: "linux, Python 2.7, slycot=source"
os: linux
dist: xenial
services: xvfb
python: "2.7"
env: SCIPY=scipy SLYCOT=source
- name: "linux, Python 3.7, slycot=source"
os: linux
dist: xenial
services: xvfb
python: "3.7"
env: SCIPY=scipy SLYCOT=source
- name: "linux, Python 3.8, slycot=source"
os: linux
dist: xenial
services: xvfb
python: "3.8"
env: SCIPY=scipy SLYCOT=source
# install required system libraries
before_install:
# Install gfortran for testing slycot; use apt-get instead of conda in
# order to include the proper CXXABI dependency (updated in GCC 4.9)
# Note: these commands should match the slycot .travis.yml configuration
- if [[ "$SLYCOT" = "source" ]]; then
sudo apt-get update -qq;
sudo apt-get install liblapack-dev libblas-dev;
sudo apt-get install gfortran;
sudo apt-get install cmake;
fi
# use miniconda to install numpy/scipy, to avoid lengthy build from source
- 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
- conda config --add channels python-control
- conda info -a
- conda create -q -n test-environment python="$TRAVIS_PYTHON_VERSION" pip coverage
- source activate test-environment
# Install scikit-build for the build process if slycot is being used
- if [[ "$SLYCOT" = "source" ]]; then
conda install openblas;
conda install -c conda-forge scikit-build;
fi
# Make sure to look in the right place for python libraries (for slycot)
- export LIBRARY_PATH="$HOME/miniconda/envs/test-environment/lib"
- conda install pytest
# coveralls not in conda repos => install via pip instead
- pip install coveralls
# Install packages
install:
# Install packages needed by python-control
- conda install $SCIPY matplotlib
# Figure out how to build slycot
# source: use "Unix Makefiles" as generator; Ninja cannot handle Fortran
# conda: use pre-compiled version of slycot on conda-forge
- if [[ "$SLYCOT" = "source" ]]; then
git clone https://github.com/python-control/Slycot.git slycot;
cd slycot; python setup.py install -G "Unix Makefiles"; cd ..;
elif [[ "$SLYCOT" = "conda" ]]; then
conda install -c conda-forge slycot;
fi
# command to run tests
script:
- 'if [ $SLYCOT != "" ]; then python -c "import slycot"; fi'
- coverage run -m pytest --disable-warnings control/tests
# only run examples if Slycot is install
# set PYTHONPATH for examples
# pmw needed for examples/tfvis.py
# future is needed for Python 2, also for examples/tfvis.py
- if [[ "$SLYCOT" != "" ]]; then
export PYTHONPATH=$PWD;
conda install -c conda-forge pmw future;
(cd examples; bash run_examples.sh);
fi
after_success:
- coveralls