aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Hahler <git@thequod.de>2019-06-18 20:13:47 +0200
committerGitHub <noreply@github.com>2019-06-18 20:13:47 +0200
commitc6ce40bf37c31d1db502e0df1d37e47316a1ddbd (patch)
treea413419e3ada9daf0e02454977b73caf0806abca
parent149dcbf2c762abaa71d78c5684c7a7a4bb0fd567 (diff)
downloadrneovim-c6ce40bf37c31d1db502e0df1d37e47316a1ddbd.tar.gz
rneovim-c6ce40bf37c31d1db502e0df1d37e47316a1ddbd.tar.bz2
rneovim-c6ce40bf37c31d1db502e0df1d37e47316a1ddbd.zip
ci: Travis: simplify/improve Python/pip setup (#10228)
* ci/before_install.sh: do not (try to) upgrade pip It is not necessary usually (for our use case(s)), and rather good to have this (implicitly) pinned. * Simplify/improve Python info output * Use pyenv-global to activate/use Python 2.7/7.7 * simplify pip-install of neovim, also for osx
-rwxr-xr-xci/before_install.sh48
-rwxr-xr-xci/install.sh15
2 files changed, 31 insertions, 32 deletions
diff --git a/ci/before_install.sh b/ci/before_install.sh
index d8cf38d314..79738d8bbf 100755
--- a/ci/before_install.sh
+++ b/ci/before_install.sh
@@ -7,28 +7,34 @@ if [[ "${CI_TARGET}" == lint ]]; then
exit
fi
-echo 'python info:'
+echo 'Python info:'
(
- 2>&1 python --version || true
- 2>&1 python2 --version || true
- 2>&1 python3 --version || true
- 2>&1 pip --version || true
- 2>&1 pip2 --version || true
- 2>&1 pip3 --version || true
- echo 'pyenv versions:'
- 2>&1 pyenv versions || true
-) | sed 's/^/ /'
-
-if [[ "${TRAVIS_OS_NAME}" == osx ]]; then
- echo "Upgrade Python 3 pip"
- python3 -m pip -q install --user --upgrade pip
-else
- echo "Upgrade Python 2 pip"
- python2.7 -m pip -q install --user --upgrade pip
- echo "Upgrade Python 3 pip"
- # Allow failure. pyenv pip3 on travis is broken:
- # https://github.com/travis-ci/travis-ci/issues/8363
- python3 -m pip -q install --user --upgrade pip || true
+ set -x
+ python3 --version
+ python2 --version
+ python --version
+ pip3 --version
+ pip2 --version
+ pip --version
+ pyenv versions
+) 2>&1 | sed 's/^/ /' || true
+
+# Use pyenv, but not for OSX on Travis, where it only has the "system" version.
+if [[ "${TRAVIS_OS_NAME}" != osx ]] && command -v pyenv; then
+ echo 'Setting Python versions via pyenv'
+ # Prefer python2 as python for /usr/bin/asan_symbolize-4.0.
+ pyenv global 2.7.15:3.7
+
+ echo 'Updated Python info:'
+ (
+ set -x
+ python3 --version
+ python2 --version
+ python --version
+
+ pip3 --version
+ pip2 --version
+ ) 2>&1 | sed 's/^/ /'
fi
echo "Install node (LTS)"
diff --git a/ci/install.sh b/ci/install.sh
index 12985098cd..27a8aa05c1 100755
--- a/ci/install.sh
+++ b/ci/install.sh
@@ -11,18 +11,11 @@ if [[ "${TRAVIS_OS_NAME}" == osx ]]; then
export PATH="/usr/local/opt/ccache/libexec:$PATH"
fi
+# Use default CC to avoid compilation problems when installing Python modules.
echo "Install neovim module for Python 3."
-# Allow failure. pyenv pip3 on travis is broken:
-# https://github.com/travis-ci/travis-ci/issues/8363
-CC=cc python3 -m pip -q install --user --upgrade neovim || true
-
-if ! [ "${TRAVIS_OS_NAME}" = osx ] ; then
- # Update PATH for pip.
- export PATH="$(python2.7 -c 'import site; print(site.getuserbase())')/bin:$PATH"
- # Use default CC to avoid compilation problems when installing Python modules.
- echo "Install neovim module for Python 2."
- CC=cc python2.7 -m pip -q install --user --upgrade neovim
-fi
+CC=cc pip3 -q install --user --upgrade neovim
+echo "Install neovim module for Python 2."
+CC=cc pip2 -q install --user --upgrade neovim
echo "Install neovim RubyGem."
gem install --no-document --version ">= 0.8.0" neovim