summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Bradbury <chris@binaryspanner.com>2018-07-30 19:33:49 +0100
committerGitHub <noreply@github.com>2018-07-30 19:33:49 +0100
commitf56049b0d9e0ab93adee0e31f787b5b592dc0911 (patch)
tree30be39911afdfd0b281c167ed9d93b8cc0d9416f
parente9d3221ecd0b6e0782cd682fad9deba665a14ea6 (diff)
parent1afc8859200dde3a07571d6a7e64dfe95d4fea56 (diff)
downloadxattr-f56049b0d9e0ab93adee0e31f787b5b592dc0911.tar.gz
Merge pull request #74 from chrBrd/travis-fixes
Travis fixes.
-rw-r--r--.travis.yml34
-rwxr-xr-x.travis/install.sh36
-rwxr-xr-x.travis/run.sh12
3 files changed, 57 insertions, 25 deletions
diff --git a/.travis.yml b/.travis.yml
index 717e517..e995af5 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -5,21 +5,37 @@ cache:
- "$HOME/.pyenv"
matrix:
include:
- - os: osx
+ - name: "Ubuntu: 3.6"
+ os: linux
+ python: 3.6
+ - name: "Ubuntu: 3.5"
+ os: linux
+ python: 3.5
+ - name: "Ubuntu: 2.7"
+ os: linux
+ python: 2.7
+ - name: "Ubuntu: PyPy 3.5"
+ os: linux
+ env: PYPY_URL=https://bitbucket.org/pypy/pypy/downloads/pypy3-v6.0.0-linux64.tar.bz2
+ - name: "Ubuntu: PyPy 2.7"
+ os: linux
+ env: PYPY_URL=https://bitbucket.org/pypy/pypy/downloads/pypy2-v6.0.0-linux64.tar.bz2
+ # Travis Python images are broken in OSX - see https://github.com/travis-ci/travis-ci/issues/9744.
+ # Will have to rely on pyenv until the issue is fixed.
+ - name: "OSX: 3.7"
+ os: osx
language: generic
- env: PYENV_VERSION=3.7.0 BUILD_SDIST=true
+ env: PYENV_VERSION=3.7.0
osx_image: xcode_9.4
- - os: osx
- language: generic
- env: PYENV_VERSION=2.7.15
- osx_image: xcode_9.4
- - os: osx
+ - name: "OSX: 3.6"
+ os: osx
language: generic
env: PYENV_VERSION=3.6.5
osx_image: xcode_9.4
- - os: osx
+ - name: "OSX: 2.7"
+ os: osx
language: generic
- env: PYENV_VERSION=pypy3.5-6.0.0-src
+ env: PYENV_VERSION=2.7.15
osx_image: xcode_9.4
install:
- "./.travis/install.sh"
diff --git a/.travis/install.sh b/.travis/install.sh
index 9ea4c8f..1ff4a03 100755
--- a/.travis/install.sh
+++ b/.travis/install.sh
@@ -3,21 +3,31 @@
set -e
set -x
-if [[ -n "$PYENV_VERSION" ]]; then
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then
- brew update
- brew upgrade readline openssl
- brew install expat xz
- brew upgrade pyenv
+install_pypy() {
+ pypy_dir="/home/travis/pypy"
+ curl -L "$PYPY_URL" -o "pypy.tar.bz2"
+ mkdir "$pypy_dir"
+ tar xf "pypy.tar.bz2" -C "$pypy_dir" --strip-components=1
+ if [ -f "$pypy_dir/bin/pypy" ]; then
+ ln -s "$pypy_dir/bin/pypy" "pypy"
+ elif [ -f "$pypy_dir/bin/pypy3" ]; then
+ ln -s "$pypy_dir/bin/pypy3" "pypy"
fi
+ ./pypy -m ensurepip
+}
+
+install_pyenv() {
+ brew update > /dev/null
+ brew upgrade readline openssl pyenv
eval "$(pyenv init -)"
- pyenv install --list
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then
- CFLAGS="-I$(xcrun --show-sdk-path)/usr/include /usr/local/opt/expat/include $CFLAGS" \
- pyenv install -s "$PYENV_VERSION"
- else
- pyenv install -s "$PYENV_VERSION"
- fi
+ pyenv install -sv "$PYENV_VERSION"
+ pip install --upgrade pip
pyenv rehash
python -m pip install wheel
+}
+
+if [[ -n "$PYPY_URL" ]]; then
+ install_pypy
+elif [[ -n "$PYENV_VERSION" && "$TRAVIS_OS_NAME" == "osx" ]]; then
+ install_pyenv
fi
diff --git a/.travis/run.sh b/.travis/run.sh
index 7f5b6bf..25cbf7d 100755
--- a/.travis/run.sh
+++ b/.travis/run.sh
@@ -7,9 +7,15 @@ if [[ -n "$PYENV_VERSION" ]]; then
eval "$(pyenv init -)"
fi
-python setup.py build_ext -i
-python -m compileall -f .
-python setup.py test
+if [[ -n "$PYPY_URL" ]]; then
+ cmd=./pypy
+else
+ cmd=python
+fi
+
+"$cmd" setup.py build_ext -i
+"$cmd" -m compileall -f .
+"$cmd" setup.py test
if [[ -n "$PYENV_VERSION" && $TRAVIS_OS_NAME == 'osx' ]]; then
python setup.py bdist_wheel