diff --git a/.travis.yml b/.travis.yml index 857008eb8..779d881ce 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,23 +24,56 @@ python: # # We also want to test with and without slycot env: - - SCIPY=scipy SLYCOT=slycot # default, with slycot + - 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 -# Exclude combinations that are very unlikely (and don't work) +# Add optional builds that test against latest version of slycot +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 + matrix: + # 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 + # 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) - - if [[ "$SLYCOT" != "" ]]; then + # 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 @@ -57,9 +90,8 @@ before_install: - conda info -a - conda create -q -n test-environment python="$TRAVIS_PYTHON_VERSION" pip coverage - source activate test-environment - # Install openblas if slycot is being used - # also install scikit-build for the build process - - if [[ "$SLYCOT" != "" ]]; then + # 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 @@ -72,13 +104,15 @@ before_install: install: # Install packages needed by python-control - conda install $SCIPY matplotlib - # Build slycot from source - # For python 3, need to provide pointer to python library - # Use "Unix Makefiles" as generator, because Ninja cannot handle Fortran - #! git clone https://github.com/repagh/Slycot.git slycot; - - if [[ "$SLYCOT" != "" ]]; then + + # 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