diff --git a/.travis.yml b/.travis.yml index 06ca91d..6a8aace 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 @@ -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: - | @@ -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 @@ -61,10 +79,6 @@ script: ./release/test_integr integr.log cd .. fi - cd python_bindings - python setup.py test - flake8 - cd .. cache: - apt