Skip to content

Commit

Permalink
Merge pull request #94 from wkerzendorf/general/fix_coveralls
Browse files Browse the repository at this point in the history
Fix coveralls
  • Loading branch information
ssim committed Mar 12, 2014
2 parents fe6723a + 6b27262 commit e7fa1d5
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 13 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,7 @@ tardis/*.html
_build
_generated
docs/gui.rst.*

#coveralls related ignores
htmlcov
.coverage
23 changes: 11 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ virtualenv:

env:
# try all python versions with the latest stable numpy and astropy
- NUMPY_VERSION=1.7.1 SETUP_CMD='test'
- CYTHON_VERSION=0.20.1 NUMPY_VERSION=1.8.0 PANDAS_VERSION=0.12 ASTROPY_VERSION=0.3 SETUP_CMD='test'
- CYTHON_VERSION=0.20.1 NUMPY_VERSION=1.8.0 PANDAS_VERSION=latest ASTROPY_VERSION=0.3 SETUP_CMD='test'
- CYTHON_VERSION=0.20.1 NUMPY_VERSION=1.8.0 PANDAS_VERSION=0.12 ASTROPY_VERSION=development SETUP_CMD='test --coverage --skip-docs'


before_install:
Expand All @@ -19,19 +21,16 @@ before_install:
install:
- export PYTHONIOENCODING=UTF8 # just in case
#- pip install --upgrade "numpy==$NUMPY_VERSION" --use-mirrors
- pip install -q --upgrade Cython --use-mirrors
- pip install -q --upgrade pandas --use-mirrors
- pip install -q --upgrade "Cython==$CYTHON_VERSION"
- if [[ $PANDAS_VERSION == 'latest' ]]; then pip install -q --upgrade pandas; else pip install -q --upgrade "pandas==$PANDAS_VERSION"; fi
- if [[ $ASTROPY_VERSION == 'development' ]]; then pip -q install git+http://github.com/astropy/astropy.git#egg=astropy; else pip install -q --upgrade "astropy==$ASTROPY_VERSION"; fi
- pip install -q pytest


#- pip install --upgrade scipy --use-mirrors
- pip install -q astropy --use-mirrors
- pip install -q coveralls --use-mirrors
- pip install -q pytest --use-mirrors
#- pip -q install --upgrade h5py --use-mirrors
- python setup.py build_ext --inplace
- if [[ $SETUP_CMD == 'test --coverage --skip-docs' ]]; then pip install -q coveralls; fi
- if [[ $SETUP_CMD == 'test --coverage --skip-docs' ]]; then pip install -q pytest-cov; fi

script:
coverage run --source=tardis -m py.test
- python setup.py $SETUP_CMD

after_success:
coveralls
- if [[ $SETUP_CMD == 'test --coverage --skip-docs' ]]; then coveralls; fi
6 changes: 5 additions & 1 deletion tardis/setup_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,8 @@
def get_extensions():
return [Extension('tardis.montecarlo',
['tardis/montecarlo.pyx'] + randomkit_files)]
#return {'tardis.montecarlo_multizone':['randomkit/*.c']}
#return {'tardis.montecarlo_multizone':['randomkit/*.c']}

def get_package_data():
return {
'tardis.tests': ['coveragerc']}
1 change: 1 addition & 0 deletions tardis/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# file for setting up tests
20 changes: 20 additions & 0 deletions tardis/tests/coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[run]
source = tardis

[report]
exclude_lines =
# Have to re-enable the standard pragma
pragma: no cover

# Don't complain about packages we have installed
except ImportError

# Don't complain if tests don't hit assertions
raise AssertionError
raise NotImplementedError

# Don't complain about script hooks
def main\(.*\):

# Ignore branches that don't pertain to this version of Python
pragma: py{ignore_python_version}

0 comments on commit e7fa1d5

Please sign in to comment.