At Travis CI, CVXOPT, NumPy, [SciPy] I want to test a Python program using (http://www.scipy.org/). Since these libraries could not be installed by pip alone, we will summarize other necessary packages.
** Fixed by CVXOPT not including SuiteSparse (February 5, 2017) **
It is assumed that the libraries required to execute the test are written in requirements.txt
.
At this time, Travis will automatically perform pip install -r requirements.txt
, so the install step is unnecessary.
.travis.yml
In summary, libblas-dev
and liblapack-dev
are used to install CVXOPT.
Since gfortran
is required to install SciPy, prepare it using ʻaddons.apt.packages of
.travis.yml`.
Also, since CVXOPT has stopped including Suite Sparse, you need to prepare it yourself. This procedure is described in before_install.
yaml:.travis.yml
language: python
python:
- 2.7
addons:
apt:
packages:
- libblas-dev
- liblapack-dev
- gfortran
before_install:
- wget http://faculty.cse.tamu.edu/davis/SuiteSparse/SuiteSparse-4.5.3.tar.gz
- tar -xf SuiteSparse-4.5.3.tar.gz
- export CVXOPT_SUITESPARSE_SRC_DIR=$(pwd)/SuiteSparse
script:
- ./unittest_script.py
In older versions, it seems that sudo apt-get install
was used for before_install
, but in the case of container base, sudo
cannot be used and ʻaddons.apt` seems to be used.
By the way, this time requirements.txt
is
requirements.txt
cvxcanon>=0.1.1 # via cvxpy
cvxopt>=1.1.9
cvxpy>=0.4.8
cycler>=0.10.0 # via matplotlib
ecos>=2.0.4 # via cvxpy
fastcache>=1.0.2 # via cvxpy
functools32>=3.2.3.post2 # via matplotlib
matplotlib>=2.0.0
multiprocess>=0.70.4 # via cvxpy
numpy>=1.12.0
pyparsing>=2.1.10 # via matplotlib
python-dateutil>=2.6.0 # via matplotlib
pytz>=2016.10 # via matplotlib
scipy>=0.18.1
scs>=1.2.6 # via cvxpy
six>=1.10.0 # via cvxpy, cycler, matplotlib, python-dateutil
subprocess32>=3.2.7 # via matplotlib
toolz>=0.8.2 # via cvxpy
Is.
Recommended Posts