|
1 | | -language: generic |
2 | | - |
3 | | -env: |
4 | | - matrix: |
5 | | - - PYTHON_EXE="`pyenv install -s 2.7.14 && pyenv local 2.7.14`" |
6 | | - - PYTHON_EXE="`pyenv install -s 3.6.1 && pyenv local 3.6.1`" |
7 | | - |
8 | | - |
9 | | -# Travis does not offer OSX with arbitrary python versions (like 2.7.13 above) |
10 | | -# So, you cannot simply have the following section in your build matrix: |
11 | | -# os: |
12 | | -# - linux |
13 | | -# - osx |
14 | | -# Instead, you have to include OSX entries into the build matrix manually. |
15 | | -# In particular, this means specifying the environment variables again. |
16 | | - |
17 | | -# The following was adapted from here: |
18 | | -# https://docs.travis-ci.com/user/multi-os/ |
19 | | -# Set `language: generic` to clear `language: python` from above |
20 | | -# Set `python:` (to empty) to clear it from the travis-ci web interface |
21 | | -# Set `osx_image: xcode7.3` to pin OSX version see here: |
22 | | -# https://docs.travis-ci.com/user/osx-ci-environment/ |
23 | | - |
24 | 1 | matrix: |
25 | 2 | include: |
26 | 3 | - os: osx |
27 | 4 | language: generic |
28 | | - python: |
29 | | - osx_image: xcode7.3 |
30 | | - env: PYTHON_EXE="`pyenv install -s 2.7.14 && pyenv local 2.7.14`" |
| 5 | + env: |
| 6 | + - PYENV_PYTHON="2.7.14" |
| 7 | + |
31 | 8 | - os: osx |
32 | 9 | language: generic |
33 | | - python: |
34 | | - osx_image: xcode7.3 |
35 | | - env: PYTHON_EXE="`pyenv install -s 3.6.1 && pyenv local 3.6.1`" |
| 10 | + env: |
| 11 | + - PYENV_PYTHON="3.6.1" |
| 12 | + |
| 13 | + - os: linux |
| 14 | + language: generic |
| 15 | + env: |
| 16 | + - PYENV_PYTHON="2.7.14" |
| 17 | + |
| 18 | + - os: linux |
| 19 | + language: generic |
| 20 | + env: |
| 21 | + - PYENV_PYTHON="3.6.1" |
36 | 22 |
|
37 | 23 |
|
38 | 24 | install: |
| 25 | + - | |
| 26 | + if [[ $TRAVIS_OS_NAME == 'osx' ]]; then |
| 27 | + rm -rf ~/.pyenv |
| 28 | + git clone https://github.com/pyenv/pyenv.git ~/.pyenv |
| 29 | + echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile |
| 30 | + echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile |
| 31 | + echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi' >> ~/.bash_profile |
| 32 | + exec "$SHELL" |
| 33 | + fi |
| 34 | + - which pyenv |
39 | 35 | - pyenv install --list |
40 | | - - echo $PYTHON_EXE |
| 36 | + - python --version |
| 37 | + - pyenv install "$PYENV_PYTHON" |
| 38 | + - pyenv global "$PYENV_PYTHON" |
41 | 39 | - python --version |
42 | 40 | - ./configure |
43 | 41 |
|
44 | | -before_script: |
45 | | - - bin/about-code check --verbose . |
46 | 42 |
|
47 | 43 | script: |
| 44 | + - bin/about-code check --verbose . |
48 | 45 | - "bin/py.test -vvs" |
49 | 46 |
|
| 47 | + |
50 | 48 | notifications: |
51 | 49 | irc: |
52 | 50 | channels: |
|
0 commit comments