Skip to content

Commit

Permalink
Sync travis.yml with keras. (keras-team#333)
Browse files Browse the repository at this point in the history
* Sync travis.yml with keras.

* Removed pil

* Removed trash file
  • Loading branch information
gabrieldemarmiesse authored Dec 15, 2018
1 parent 46fcdb9 commit 83315f6
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 27 deletions.
4 changes: 4 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@ exclude_lines =
if original_keras_version == '1':

show_missing = True
omit =
keras_contrib/backend/theano_backend.py
keras_contrib/backend/tensorflow_backend.py
keras_contrib/backend/cntk_backend.py
43 changes: 16 additions & 27 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
sudo: required
dist: trusty
language: python
cache:
directories:
- $HOME/.theano
matrix:
include:
- python: 2.7
- python: 3.6
env: KERAS_BACKEND=tensorflow TEST_MODE=PEP8
- python: 2.7
env: KERAS_BACKEND=tensorflow
Expand Down Expand Up @@ -34,51 +37,37 @@ install:
# Useful for debugging any issues with conda
- conda info -a

- conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION pytest pandas
- travis_retry conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION
- source activate test-environment
- pip install --only-binary=numpy,scipy numpy nose scipy matplotlib h5py theano
- pip install keras_applications keras_preprocessing
- conda install mkl mkl-service
- travis_retry pip install --only-binary=numpy,scipy,pandas numpy nose scipy h5py theano pytest pytest-pep8 pandas --progress-bar off
- pip install keras==2.2.4 --progress-bar off

# set library path
- export LD_LIBRARY_PATH=$HOME/miniconda/envs/test-environment/lib/:$LD_LIBRARY_PATH

# install PIL for preprocessing tests
- if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then
conda install pil;
elif [[ "$TRAVIS_PYTHON_VERSION" == "3.6" ]]; then
conda install Pillow;
- if [[ "$KERAS_BACKEND" == "theano" ]]; then
travis_retry conda install -q mkl mkl-service
fi

- pip install -e .[tests]
- pip install -e .[tests] --progress-bar off

# install TensorFlow (CPU version).
- pip install tensorflow==1.7

- pip install tensorflow==1.9 --progress-bar off
# install cntk
- if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then
pip install https://cntk.ai/PythonWheel/CPU-Only/cntk-2.5.1-cp27-cp27mu-linux_x86_64.whl;
elif [[ "$TRAVIS_PYTHON_VERSION" == "3.6" ]]; then
pip install https://cntk.ai/PythonWheel/CPU-Only/cntk-2.5.1-cp36-cp36m-linux_x86_64.whl;
- if [[ "$KERAS_BACKEND" == "cntk" ]] || [[ "$TEST_MODE" == "PEP8" ]]; then
./.travis/install_cntk.sh;
fi

# install pydot for visualization tests
- conda install pydot graphviz
# Remove the current backend from the coverage exclusion.
- sed -i "\/keras\/backend\/${KERAS_BACKEND}_backend.py/d" .coveragerc

# detect whether core files are changed or not
- export CORE_CHANGED=False;
- for entry in `git diff --name-only HEAD~1`; do if [[ "$entry" == "keras/backend/"* ]] || [[ "$entry" == "keras/engine/"* ]] || [[ "$entry" == "keras/layers/"* ]]; then export CORE_CHANGED=True; fi; done
- export APP_CHANGED=False;
- for entry in `git diff --name-only HEAD~1`; do if [[ "$entry" == "keras/applications/"* ]]; then export APP_CHANGED=True; fi; done

#install open mpi
- rm -rf ~/mpi
- mkdir ~/mpi
- pushd ~/mpi
- wget http://cntk.ai/PythonWheel/ForKeras/depends/openmpi_1.10-3.zip
- unzip ./openmpi_1.10-3.zip
- sudo dpkg -i openmpi_1.10-3.deb
- popd

# command to run tests
script:
Expand Down
11 changes: 11 additions & 0 deletions .travis/install_cntk.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
set -e
pip install cntk

# open mpi is needed for cntk
rm -rf ~/mpi
mkdir ~/mpi
pushd ~/mpi
wget http://cntk.ai/PythonWheel/ForKeras/depends/openmpi_1.10-3.zip
unzip ./openmpi_1.10-3.zip
sudo dpkg -i openmpi_1.10-3.deb
popd

0 comments on commit 83315f6

Please sign in to comment.