diff --git a/.travis.yml b/.travis.yml index 1a985bac3..f74db7f13 100644 --- a/.travis.yml +++ b/.travis.yml @@ -50,18 +50,23 @@ stage_osx: &stage_osx os: osx osx_image: xcode9.2 language: generic - addons: - homebrew: - packages: - - pyenv - update: true + cache: + pip: true + directories: + - ~/python-interpreters/ before_install: # Travis does not provide support for Python 3 under osx - it needs to be # installed manually. | if [ ${TRAVIS_OS_NAME} = "osx" ]; then - pyenv install 3.6.5 - virtualenv --python ~/.pyenv/versions/3.6.5/bin/python venv + if [[ ! -d ~/python-interpreters/$PYTHON_VERSION ]]; then + git clone git://github.com/pyenv/pyenv.git + cd pyenv/plugins/python-build + ./install.sh + cd ../../.. + python-build $PYTHON_VERSION ~/python-interpreters/$PYTHON_VERSION + fi + virtualenv --python ~/python-interpreters/$PYTHON_VERSION/bin/python venv source venv/bin/activate fi @@ -110,20 +115,26 @@ jobs: python: 3.7 sudo: true + # OSX, Python 3.5.6 (via pyenv) + - stage: test + <<: *stage_osx + env: + - MPLBACKEND=ps + - PYTHON_VERSION=3.5.6 + # OSX, Python 3.6.5 (via pyenv) - stage: test <<: *stage_osx + env: + - MPLBACKEND=ps + - PYTHON_VERSION=3.6.5 - # OSX, Python 3.7 (via pyenv) + # OSX, Python 3.7.2 (via pyenv) - stage: test <<: *stage_osx - before_install: - | - if [ ${TRAVIS_OS_NAME} = "osx" ]; then - pyenv install 3.7.0 - virtualenv --python ~/.pyenv/versions/3.7.0/bin/python venv - source venv/bin/activate - fi + env: + - MPLBACKEND=ps + - PYTHON_VERSION=3.7.2 # "ibmq" stage ###########################################################################