Skip to content

Commit

Permalink
Merge pull request #27 from rasbt/setup-ci
Browse files Browse the repository at this point in the history
Continuous integration tests
  • Loading branch information
rasbt committed Apr 14, 2016
2 parents e072478 + 2845f2f commit 37668fa
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 36 deletions.
15 changes: 6 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,14 @@ virtualenv:
system_site_packages: true
env:
matrix:
- PYTHON_VERSION="2.7" LATEST="true"
- PYTHON_VERSION="3.4" LATEST="true"
- PYTHON_VERSION="3.5" LATEST="true"
- PYTHON_VERSION="3.5" COVERAGE="true" LATEST="true"
- PYTHON_VERSION="2.7" FROM="setup.py"
- PYTHON_VERSION="3.5" FROM="setup.py"
- PYTHON_VERSION="2.7" FROM="github"
- PYTHON_VERSION="3.5" FROM="github"
- PYTHON_VERSION="2.7" FROM="pypi"
- PYTHON_VERSION="3.5" FROM="pypi"
install: source ./ci/.travis_install.sh
script: bash ./ci/.travis_test.sh
after_success:
# Ignore coveralls failures as the coveralls server is not very reliable
# but we don't want travis to report a failure in the github UI just
# because the coverage report failed to be published.
- if [[ "$COVERAGE" == "true" ]]; then coveralls || echo "failed"; fi
cache: apt
sudo: false
notifications:
Expand Down
31 changes: 11 additions & 20 deletions ci/.travis_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
# The behavior of the script is controlled by environment variabled defined
# in the .travis.yml in the top level folder of the project.

# License: 3-clause BSD

set -e


# Deactivate the travis-provided virtual environment and setup a
# conda-based environment instead
Expand All @@ -21,23 +17,18 @@ chmod +x miniconda.sh && ./miniconda.sh -b
export PATH=/home/travis/miniconda/bin:$PATH
conda update --yes conda

# Configure the conda environment and put it in the path using the
# provided versions
if [[ "$LATEST" == "true" ]]; then
conda create -n testenv --yes python=$PYTHON_VERSION pip nose psutil
else
conda create -n testenv --yes python=$PYTHON_VERSION pip nose \
psutil=$PSUTIL_VERSION
fi
conda create -n testenv --yes python=$PYTHON_VERSION pip nose

source activate testenv

if [[ "$COVERAGE" == "true" ]]; then
pip install coverage coveralls
fi
pip install psutil

# Build pyprind in the install.sh script to collapse the verbose
# build output in the travis output when it succeeds.
python --version
python -c "import psutil; print('psutil%s' % psutil.__version__)"
python setup.py build_ext --inplace
if [[ "$FROM" == "github" ]]; then
pip install git+git://github.com/rasbt/pyprind.git#egg=pyprind

elif [[ "$FROM" == "pypi" ]]; then
pip install pyprind

else
python setup.py install
fi
9 changes: 2 additions & 7 deletions ci/.travis_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@
set -e

python --version
python -c "import pyprind; print('pyprind %s' % pyprind.__version__)"

if [[ "$COVERAGE" == "true" ]]; then
nosetests -s -v --with-coverage --cover-package=pyprind

else
nosetests -s -v pyprind
fi
#make test-doc test-sphinxext
nosetests -s -v

0 comments on commit 37668fa

Please sign in to comment.