Skip to content

Commit 7c5ffcf

Browse files
committed
Fix Travis CI Python installations
Python 2.7 has been added by default in the Travis CI images, so no need to reinstall it. Need to add pip, but ensure the python installation picks the right site-packages. Python3 brew default is 3.6, which is not compatible with PyInstaller, so install 3.5 instead.
1 parent 9af8df9 commit 7c5ffcf

File tree

1 file changed

+33
-16
lines changed

1 file changed

+33
-16
lines changed

.travis.yml

Lines changed: 33 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,55 @@
1+
# Oldest OS X image in TravisCi at the moment is 10.10 Yosemite
12
os: osx
2-
osx_image: beta-xcode6.1
3+
osx_image: xcode6.4
34
language: node_js
45
node_js: '6'
56

67
before_install:
78
# OS extra info
89
- sw_vers
910
- uname -a
10-
- python --version
11-
- python -c "import struct; print(struct.calcsize('P') * 8)"
1211

13-
# Install Python 2 and 3 with pip and check versions
12+
# Install Python 2 pip, ensure pip installed packages are found first
13+
# Python 2 installation and path priority in Travis OS X is a bit of a mess
14+
# https://github.com/travis-ci/travis-ci/issues/4194
15+
- curl -O https://bootstrap.pypa.io/get-pip.py
16+
- sudo python get-pip.py
17+
- rm get-pip.py
18+
- sudo pip install --upgrade pip setuptools wheel
19+
# Original problem is old version of "six" package lingering around
20+
# https://github.com/testing-cabal/mock/issues/337
21+
- export PYTHONPATH=/Library/Python/2.7/site-packages:$PYTHONPATH
22+
- python -c "import sys; print(sys.path)"
23+
- python -c "from six import wraps"
24+
25+
# Install Python 3.5 with pip, and check versions
1426
- brew update
15-
- brew install python
16-
- brew unlink python && brew link python
17-
- brew install python3
18-
- brew unlink python3 && brew link python3
27+
- brew tap zoidbergwill/python
28+
- brew install python35
29+
- cp -R /usr/local/bin/pip3.5 /usr/local/bin/pip3
30+
- sudo pip3 install --upgrade pip
31+
1932
- brew install libcouchbase
2033
- PATH=/usr/local/bin:$PATH
2134
- echo $PATH
35+
36+
# Install Python packages (built with Python 3, tests for 2 and 3)
37+
- sudo python -m pip install mock
38+
- pip3 install mkdocs
39+
- pip3 install pyinstaller
40+
41+
# Check Python, pip and package versions
42+
- python -c "import sys; print(sys.executable)"
2243
- python --version
2344
- python -c "import struct; print(struct.calcsize('P') * 8)"
24-
- pip --version
45+
- python -m pip --version
46+
- python -m pip freeze
47+
- python3 -c "import sys; print(sys.executable)"
2548
- python3 --version
2649
- python3 -c "import struct; print(struct.calcsize('P') * 8)"
2750
- pip3 --version
28-
29-
# Install Python packages (built with Python 3, tests for 2 and 3)
30-
- pip install mock
31-
- pip3 install mkdocs
32-
- pip3 install pyinstaller
33-
- pyinstaller --version
34-
- pip freeze
3551
- pip3 freeze
52+
- pyinstaller --version
3653

3754
# Travis make takes > 10 minutes, so need to increase wait
3855
- brew unlink node

0 commit comments

Comments
 (0)