Skip to content

Commit

Permalink
fix OSX travis CI
Browse files Browse the repository at this point in the history
Minor tweaks to fix OSX ci. Also test out python 2.7 in addition to 3.7.
  • Loading branch information
Ben Frederickson committed Jul 2, 2018
1 parent 4a8026a commit c82195f
Showing 1 changed file with 29 additions and 15 deletions.
44 changes: 29 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ matrix:
- os: linux
env: PYTHON=3
- os: osx
env: PYTHON=3.6
env: PYTHON=3
osx_image: xcode9.3
python: 3.7.0
- os: osx
env: PYTHON=2
osx_image: xcode9.3
python: 2.7.14
allow_failures:
- os: osx

Expand All @@ -29,17 +35,27 @@ addons:

before_install:
- |
if [ "$TRAVIS_OS_NAME" = "linux" ]; then export CXX=g++-4.8 CC=gcc-4.8; fi
if [ "$TRAVIS_OS_NAME" = "osx" ] && [ "${PYTHON:0:1}" = "3" ]; then
brew update
brew upgrade python
command curl -sSL https://rvm.io/mpapis.asc | gpg --import -;
rvm get stable
else
PIP=pip
PY=python
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
export CXX=g++-4.8 CC=gcc-4.8;
pip install --user --upgrade pip virtualenv
virtualenv -p python$PYTHON venv
source venv/bin/activate
fi
fi
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
brew update
brew install gcc
PIP=pip2
PY=python2
if [ "${PYTHON:0:1}" = "3" ]; then
brew upgrade python
brew install python3
PIP=pip3
PY=python3
fi
fi
install:
- |
Expand All @@ -49,10 +65,12 @@ install:
cmake similarity_search
fi
make -j 4
travis_wait travis_retry pip install -r python_bindings/requirements.txt scipy six flake8
travis_retry cd python_bindings && python setup.py build install && cd ..
travis_wait travis_retry $PIP install -r python_bindings/requirements.txt scipy six flake8
travis_retry cd python_bindings && $PY setup.py build install && cd ..
script:
- $PY --version
- cd python_bindings && $PY setup.py test && flake8 && cd ..
- |
set -e
if [ "$TRAVIS_OS_NAME" = "linux" -o "$TRAVIS_OS_NAME" = "osx" ] ; then
Expand All @@ -61,10 +79,6 @@ script:
./release/test_integr integr.log
cd ..
fi
cd python_bindings
python setup.py test
flake8
cd ..
cache:
- apt
Expand Down

0 comments on commit c82195f

Please sign in to comment.