summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiampaolo Rodola' <g.rodola@gmail.com>2015-08-03 23:35:19 +0200
committerGiampaolo Rodola' <g.rodola@gmail.com>2015-08-03 23:35:19 +0200
commit2d2bfe6de68bc375453247058776d9d92358eb8f (patch)
treeeb4a20dcb458d8a54838780b6105ac00776e0588
parent0641da7dbc5a0cde8fbfb66e021003ad0a516d90 (diff)
parent2303e8213156850e5dab564b633477f0069fe26a (diff)
downloadpsutil-2d2bfe6de68bc375453247058776d9d92358eb8f.tar.gz
Merge pull request #662 from mrjefftang/travis_osx
Test OSX Travis config
-rw-r--r--.travis.yml51
-rwxr-xr-x.travis/install.sh51
-rwxr-xr-x.travis/run.sh19
3 files changed, 98 insertions, 23 deletions
diff --git a/.travis.yml b/.travis.yml
index d126b9ba..e355449b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,28 +1,33 @@
-language: python
-os:
- - osx
- - linux
sudo: false
-python:
- - 2.6
- - 2.7
- - 3.2
- - 3.3
- - 3.4
- # - pypy
+
+language: python
+
+matrix:
+ include:
+ - python: 2.6
+ - python: 2.7
+ - python: 3.2
+ - python: 3.3
+ - python: 3.4
+ - language: generic
+ os: osx
+ env: PYVER=py26
+ - language: generic
+ os: osx
+ env: PYVER=py27
+ - language: generic
+ os: osx
+ env: PYVER=py32
+ - language: generic
+ os: osx
+ env: PYVER=py33
+ - language: generic
+ os: osx
+ env: PYVER=py34
+
install:
- - echo $TRAVIS_OS_NAME
- - if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then pip install -U ipaddress unittest2 mock==1.0.1; fi
- - if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then pip install -U ipaddress mock; fi
- - if [[ $TRAVIS_PYTHON_VERSION == '3.2' ]]; then pip install -U ipaddress mock; fi
- - if [[ $TRAVIS_PYTHON_VERSION == '3.3' ]]; then pip install -U ipaddress; fi
- - pip install coverage coveralls flake8 pep8
+ - ./.travis/install.sh
script:
- - python setup.py build
- - python setup.py install
- - coverage run test/test_psutil.py --include="psutil/*" --omit="test/*,*setup*"
- - python test/test_memory_leaks.py
- - flake8
- - pep8
+ - ./.travis/run.sh
after_success:
- coveralls # upload reports to coveralls.io
diff --git a/.travis/install.sh b/.travis/install.sh
new file mode 100755
index 00000000..23d9ce04
--- /dev/null
+++ b/.travis/install.sh
@@ -0,0 +1,51 @@
+#!/bin/bash
+
+set -e
+set -x
+
+if [[ "$(uname -s)" == 'Darwin' ]]; then
+ brew update || brew update
+ brew outdated pyenv || brew upgrade pyenv
+ brew install pyenv-virtualenv
+
+ if which pyenv > /dev/null; then
+ eval "$(pyenv init -)"
+ fi
+
+ case "${PYVER}" in
+ py26)
+ pyenv install 2.6.9
+ pyenv virtualenv 2.6.9 psutil
+ ;;
+ py27)
+ pyenv install 2.7.10
+ pyenv virtualenv 2.7.10 psutil
+ ;;
+ py32)
+ pyenv install 3.2.6
+ pyenv virtualenv 3.2.6 psutil
+ ;;
+ py33)
+ pyenv install 3.3.6
+ pyenv virtualenv 3.3.6 psutil
+ ;;
+ py34)
+ pyenv install 3.4.3
+ pyenv virtualenv 3.4.3 psutil
+ ;;
+ esac
+ pyenv rehash
+ pyenv activate psutil
+fi
+
+if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]] || [[ $PYVER == 'py26' ]]; then
+ pip install -U ipaddress unittest2 mock==1.0.1
+elif [[ $TRAVIS_PYTHON_VERSION == '2.7' ]] || [[ $PYVER == 'py27' ]]; then
+ pip install -U ipaddress mock
+elif [[ $TRAVIS_PYTHON_VERSION == '3.2' ]] || [[ $PYVER == 'py32' ]]; then
+ pip install -U ipaddress mock
+elif [[ $TRAVIS_PYTHON_VERSION == '3.3' ]] || [[ $PYVER == 'py33' ]]; then
+ pip install -U ipaddress
+fi
+
+pip install coverage coveralls flake8 pep8 \ No newline at end of file
diff --git a/.travis/run.sh b/.travis/run.sh
new file mode 100755
index 00000000..b12c0150
--- /dev/null
+++ b/.travis/run.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+set -e
+set -x
+
+if [[ "$(uname -s)" == 'Darwin' ]]; then
+ if which pyenv > /dev/null; then
+ eval "$(pyenv init -)"
+ fi
+
+ pyenv activate psutil
+fi
+
+python setup.py build
+python setup.py install
+coverage run test/test_psutil.py --include="psutil/*" --omit="test/*,*setup*"
+python test/test_memory_leaks.py
+flake8
+pep8 \ No newline at end of file