|
1 | | -# The test matrix includes OSX and Linux |
2 | | - |
3 | | -# Don't know how to do non-Conda builds on OSX |
4 | | - |
5 | | -# Linux builds needs extra settings (see "dist" and "services" below) |
6 | | - |
7 | | -matrix: |
8 | | - allow_failures: |
9 | | - - name: "OSX, Python 2.7, TEST_CONDA=1" |
10 | | - os: osx |
11 | | - env: SLYCOT_PYTHON_VERSION=2.7 TEST_CONDA=1 |
12 | | - |
13 | | - - name: "OSX, Python 3.5, TEST_CONDA=1" |
14 | | - os: osx |
15 | | - env: SLYCOT_PYTHON_VERSION=3.5 TEST_CONDA=1 |
16 | | - |
17 | | - - name: "OSX, Python 3.6, TEST_CONDA=1" |
18 | | - os: osx |
19 | | - env: SLYCOT_PYTHON_VERSION=3.6 TEST_CONDA=1 |
20 | | - |
21 | | - - name: "OSX, Python 3.7, TEST_CONDA=1" |
22 | | - os: osx |
23 | | - env: SLYCOT_PYTHON_VERSION=3.7 TEST_CONDA=1 |
24 | | - |
| 1 | +# Default entries for matrix jobs |
| 2 | +os: linux |
| 3 | +language: python |
| 4 | +dist: bionic |
| 5 | +services: xvfb # needed for the python-control tests |
| 6 | + |
| 7 | +# Start with a 2x4 matrix of Linux builds |
| 8 | +python: |
| 9 | + - "3.8" |
| 10 | + - "3.7" |
| 11 | +env: |
| 12 | + - TEST_PKG="conda" BLA_VENDOR="OpenBLAS" |
| 13 | + - TEST_PKG="conda" BLA_VENDOR="Intel10_64lp" # MKL |
| 14 | + - TEST_PKG="dist" BLA_VENDOR="OpenBLAS" |
| 15 | + - TEST_PKG="dist" BLA_VENDOR="Generic" # reference BLAS/LAPACK |
| 16 | + |
| 17 | +jobs: |
| 18 | + # additional single Linux and OSX jobs |
25 | 19 | include: |
26 | | - - name: "OSX, Python 2.7, TEST_CONDA=1" |
| 20 | + - name: "Linux, Conda Python 3.6" |
| 21 | + python: "3.6" |
| 22 | + env: TEST_PKG="conda" BLA_VENDOR="OpenBLAS" |
| 23 | + - name: "Linux, Conda Python 3.5" |
| 24 | + python: "3.5" |
| 25 | + env: TEST_PKG="conda" BLA_VENDOR="OpenBLAS" |
| 26 | + - name: "Linux, Ubuntu 16.04, System Python 2.7" |
| 27 | + python: "2.7" |
| 28 | + dist: xenial |
| 29 | + env: TEST_PKG="dist" BLA_VENDOR="OpenBLAS" |
| 30 | + # (Conda Python 2 is broken due to pytest-cov dependencies) |
| 31 | + - name: "MacOSX, Conda Python 3" |
27 | 32 | os: osx |
28 | | - env: SLYCOT_PYTHON_VERSION=2.7 TEST_CONDA=1 |
29 | | - |
30 | | - - name: "OSX, Python 3.5, TEST_CONDA=1" |
| 33 | + language: shell |
| 34 | + env: TEST_PKG="conda" BLA_VENDOR="Apple" |
| 35 | + - name: "MacOSX, System Python 3" |
31 | 36 | os: osx |
32 | | - env: SLYCOT_PYTHON_VERSION=3.5 TEST_CONDA=1 |
33 | | - |
34 | | - - name: "OSX, Python 3.6, TEST_CONDA=1" |
| 37 | + language: shell |
| 38 | + env: TEST_PKG="dist" BLA_VENDOR="Apple" |
| 39 | + - name: "MacOSX, pyenv 3.8.0" |
35 | 40 | os: osx |
36 | | - env: SLYCOT_PYTHON_VERSION=3.6 TEST_CONDA=1 |
37 | | - |
38 | | - - name: "OSX, Python 3.7, TEST_CONDA=1" |
| 41 | + language: shell |
| 42 | + env: TEST_PKG="dist" BLA_VENDOR="Apple" SLYCOT_PYTHON_VERSION=3.8.0 |
| 43 | + - name: "MacOSX, pyenv 2.7.17" |
39 | 44 | os: osx |
40 | | - env: SLYCOT_PYTHON_VERSION=3.7 TEST_CONDA=1 |
41 | | - |
42 | | - - name: "Ubuntu 16.04, Python 2.7, TEST_CONDA=0" |
43 | | - os: linux |
44 | | - dist: xenial |
45 | | - services: xvfb |
46 | | - env: SLYCOT_PYTHON_VERSION=2.7 TEST_CONDA=0 |
47 | | - |
48 | | - - name: "Ubuntu 16.04, Python 2.7, TEST_CONDA=1" |
49 | | - os: linux |
50 | | - dist: xenial |
51 | | - services: xvfb |
52 | | - env: SLYCOT_PYTHON_VERSION=2.7 TEST_CONDA=1 |
53 | | - |
54 | | - - name: "Ubuntu 16.04, Python 3.5, TEST_CONDA=0" |
55 | | - os: linux |
56 | | - dist: xenial |
57 | | - services: xvfb |
58 | | - env: SLYCOT_PYTHON_VERSION=3.5 TEST_CONDA=0 |
59 | | - |
60 | | - - name: "Ubuntu 16.04, Python 3.5, TEST_CONDA=1" |
61 | | - os: linux |
62 | | - dist: xenial |
63 | | - services: xvfb |
64 | | - env: SLYCOT_PYTHON_VERSION=3.5 TEST_CONDA=1 |
65 | | - |
66 | | - - name: "Ubuntu 16.04, Python 3.6, TEST_CONDA=0" |
67 | | - os: linux |
68 | | - dist: xenial |
69 | | - services: xvfb |
70 | | - env: SLYCOT_PYTHON_VERSION=3.6 TEST_CONDA=0 |
71 | | - |
72 | | - - name: "Ubuntu 16.04, Python 3.6, TEST_CONDA=1" |
73 | | - os: linux |
74 | | - dist: xenial |
75 | | - services: xvfb |
76 | | - env: SLYCOT_PYTHON_VERSION=3.6 TEST_CONDA=1 |
77 | | - |
78 | | - - name: "Ubuntu 16.04, Python 3.7, TEST_CONDA=0" |
79 | | - os: linux |
80 | | - dist: xenial |
81 | | - services: xvfb |
82 | | - env: SLYCOT_PYTHON_VERSION=3.7 TEST_CONDA=0 |
83 | | - |
84 | | - - name: "Ubuntu 16.04, Python 3.7, TEST_CONDA=1" |
85 | | - os: linux |
86 | | - dist: xenial |
87 | | - services: xvfb |
88 | | - env: SLYCOT_PYTHON_VERSION=3.7 TEST_CONDA=1 |
| 45 | + language: shell |
| 46 | + env: TEST_PKG="dist" BLA_VENDOR="Apple" SLYCOT_PYTHON_VERSION=2.7.17 |
89 | 47 |
|
90 | 48 |
|
91 | 49 | before_install: |
92 | | - - if [[ $TEST_CONDA == 0 && $TRAVIS_OS_NAME != linux ]]; then |
93 | | - echo "Only Linux supported for non-Conda builds"; |
94 | | - exit 1; |
| 50 | + - | |
| 51 | + # Install Ubuntu packages |
| 52 | + if [[ $TEST_PKG == "dist" && $TRAVIS_OS_NAME == linux ]]; then |
| 53 | + sudo apt-get update |
| 54 | + sudo apt-get -y install gfortran cmake |
| 55 | + if [[ $BLA_VENDOR == "OpenBLAS" ]]; then |
| 56 | + sudo apt-get -y install libopenblas-dev |
| 57 | + elif [[ $BLA_VENDOR == "Generic" ]]; then |
| 58 | + sudo apt-get -y install libblas-dev liblapack-dev |
| 59 | + else |
| 60 | + echo "Unsupported BLAS Vendor: '$BLA_VENDOR'" |
| 61 | + exit 2 |
| 62 | + fi |
95 | 63 | fi |
96 | | - # from here on assume $TEST_CONDA == 0 implies $TRAVIS_OS_NAME == linux |
97 | | - |
98 | | - - if [[ $TEST_CONDA == 0 ]]; then |
99 | | - sudo apt-get install liblapack-dev libblas-dev; |
100 | | - sudo apt-get install gfortran; |
101 | | - sudo apt-get install cmake; |
| 64 | + - | |
| 65 | + # Install MacOSX packages |
| 66 | + if [[ $TEST_PKG == "dist" && $TRAVIS_OS_NAME == osx ]]; then |
| 67 | + if [ -n "$SLYCOT_PYTHON_VERSION" ]; then |
| 68 | + pyenv install $SLYCOT_PYTHON_VERSION |
| 69 | + pyenv global $SLYCOT_PYTHON_VERSION |
| 70 | + eval "$(pyenv init -)" |
| 71 | + export MPLBACKEND="TkAgg" |
| 72 | + else |
| 73 | + mkdir -p ~/.local/bin |
| 74 | + ln -s $(which python3) ~/.local/bin/python |
| 75 | + ln -s $(which pip3) ~/.local/bin/pip |
| 76 | + fi |
102 | 77 | fi |
103 | 78 |
|
104 | | - |
105 | 79 | install: |
106 | | - # |
107 | | - # Install miniconda to allow quicker installation of dependencies |
108 | | - # See https://conda.io/docs/user-guide/tasks/use-conda-with-travis-ci.html |
109 | | - # |
110 | | - - if [[ $TRAVIS_OS_NAME == linux ]]; then |
111 | | - wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh; |
112 | | - else |
113 | | - wget https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh; |
114 | | - fi |
115 | | - - bash miniconda.sh -b -p $HOME/miniconda |
116 | | - - export PATH="$HOME/miniconda/bin:$PATH" |
117 | | - - hash -r |
118 | | - - conda config --set always_yes yes --set changeps1 no |
119 | | - - conda update -q --all |
120 | | - - if [[ $TEST_CONDA == 1 ]]; then |
121 | | - conda install conda-build; |
122 | | - conda install conda-verify; |
123 | | - fi |
124 | | - - conda info -a |
125 | | - # |
126 | | - # Set up a test environment for testing everything out |
127 | | - - conda create -q -n test-environment python="$SLYCOT_PYTHON_VERSION" pip coverage nose numpy openblas |
128 | | - - source activate test-environment |
129 | | - |
130 | | - # |
131 | | - # Make sure that fortran compiler can find conda libraries |
132 | | - # |
133 | | - - export LIBRARY_PATH="$HOME/miniconda/envs/test-environment/lib"; |
134 | | - |
135 | | - # install scikit-build |
136 | | - - if [[ $TEST_CONDA == 0 ]]; then |
137 | | - conda config --append channels conda-forge; |
138 | | - conda install -c conda-forge scikit-build >=0.8.0 ; |
139 | | - fi |
140 | | - # |
141 | | - # Install the slycot package (two ways, to improve robustness). For the |
142 | | - # conda version, need to install lapack from conda-forge (no way to specify |
143 | | - # this in the recipe). |
144 | | - # add the conda-forge channel to the config, otherwise openblas or |
145 | | - # lapack cannot be found in the check |
146 | | - # with --override-channels to make sure the locally built slycot is installed |
147 | | - # |
148 | | - - if [[ $TEST_CONDA == 1 ]]; then |
| 80 | + - | |
| 81 | + # compile using conda environment or distribution libraries |
| 82 | + echo "Python Version: ${SLYCOT_PYTHON_VERSION:=${TRAVIS_PYTHON_VERSION:-3.8}}" |
| 83 | + if [[ $TEST_PKG == conda ]]; then |
| 84 | + # |
| 85 | + # Install miniconda to allow quicker installation of dependencies |
| 86 | + # See https://conda.io/projects/conda/en/latest/user-guide/tasks/use-conda-with-travis-ci.html |
| 87 | + # |
| 88 | + if [[ $TRAVIS_OS_NAME == linux ]]; then |
| 89 | + wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh |
| 90 | + elif [[ $TRAVIS_OS_NAME == osx ]]; then |
| 91 | + wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh |
| 92 | + wget https://github.com/phracker/MacOSX-SDKs/releases/download/10.15/MacOSX10.9.sdk.tar.xz |
| 93 | + sudo tar -C /opt -xJf MacOSX10.9.sdk.tar.xz |
| 94 | + else |
| 95 | + echo "Unsupported OS for conda builds: $TRAVIS_OS_NAME" |
| 96 | + exit 4 |
| 97 | + fi |
| 98 | + bash miniconda.sh -b -p $HOME/miniconda |
| 99 | + source "$HOME/miniconda/etc/profile.d/conda.sh" |
| 100 | + hash -r |
| 101 | + conda config --set always_yes yes --set changeps1 no |
| 102 | + conda update -q --all |
| 103 | + conda install conda-build |
| 104 | + conda install conda-verify |
149 | 105 | conda config --append channels conda-forge; |
150 | | - conda build --python "$SLYCOT_PYTHON_VERSION" conda-recipe-openblas; |
151 | | - conda install conda-forge::openblas>=0.3.0; |
152 | | - conda install local::slycot; |
| 106 | + conda info -a; |
| 107 | + if [[ $BLA_VENDOR == "OpenBLAS" ]]; then |
| 108 | + conda_blas=openblas |
| 109 | + conda_recipe=conda-recipe-openblas |
| 110 | + elif [[ $BLA_VENDOR == "Intel10_64lp" ]]; then |
| 111 | + conda_blas=mkl |
| 112 | + conda_recipe=conda-recipe-mkl |
| 113 | + elif [[ $BLA_VENDOR == "Apple" ]]; then |
| 114 | + conda_blas= |
| 115 | + conda_recipe=conda-recipe-apple |
| 116 | + else |
| 117 | + echo "Unsupported BLA_VENDOR for conda builds: $BLA_VENDOR" |
| 118 | + exit 3 |
| 119 | + fi |
| 120 | + conda create -q -n test-environment \ |
| 121 | + python="$SLYCOT_PYTHON_VERSION" \ |
| 122 | + pip coverage pytest-cov \ |
| 123 | + numpy scipy matplotlib \ |
| 124 | + $conda_blas |
| 125 | + conda activate test-environment |
| 126 | + export LIBRARY_PATH="$HOME/miniconda/envs/test-environment/lib" |
| 127 | + conda build --python "$SLYCOT_PYTHON_VERSION" $conda_recipe |
| 128 | + conda install local::slycot |
| 129 | + elif [[ $TEST_PKG == dist ]]; then |
| 130 | + pip install scikit-build pytest-cov matplotlib scipy; |
| 131 | + CMAKE_GENERATOR="Unix Makefiles" python setup.py install; |
153 | 132 | else |
154 | | - CMAKE_GENERATOR="Unix Makefiles" BLA_VENDOR="OpenBLAS" python setup.py install; |
| 133 | + echo "Wrong TEST_PKG '$TEST_PKG'" |
| 134 | + exit 1 |
155 | 135 | fi |
156 | | - # |
157 | | - # coveralls not in conda repos :-( |
158 | | - - pip install coveralls |
159 | | - |
| 136 | + # coveralls not in ubuntu or conda repos |
| 137 | + pip install coveralls |
160 | 138 |
|
161 | 139 | script: |
162 | | - # Local unit tests |
163 | | - # TODO: replace with nose? |
| 140 | + # slycots own unit tests as installed, not those from source dir |
164 | 141 | - cd .. |
165 | | - - python Slycot/runtests.py --coverage --no-build |
| 142 | + - slycot_dir=$(python -c "import slycot; print(slycot.__path__[0])") |
| 143 | + - pytest --pyargs slycot --cov=$slycot_dir --cov-config=Slycot/.coveragerc |
166 | 144 | # |
167 | 145 | # As a deeper set of tests, get test against python-control as well |
168 | 146 | # |
169 | | - # Additional packages required for python-control |
170 | | - - conda install scipy matplotlib |
171 | 147 | # Get python-control from source and install |
172 | 148 | - git clone --depth 1 https://github.com/python-control/python-control.git control |
173 | 149 | - cd control |
174 | 150 | - python setup.py test |
175 | 151 |
|
176 | | - |
177 | 152 | after_success: |
178 | 153 | - coveralls |
0 commit comments