Skip to content

Commit

Permalink
added CI
Browse files Browse the repository at this point in the history
  • Loading branch information
JohannesBuchner committed Nov 27, 2017
1 parent a6430f2 commit 8019f60
Show file tree
Hide file tree
Showing 6 changed files with 91 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .coveragerc
@@ -0,0 +1,23 @@
#
# .coveragerc to control coverage.py
#

[run]
branch = True
omit =
test*


[report]
exclude_lines =
pragma: no cover
def __repr__
if __name__ == .__main__.
omit =
.eggs/*
/home/travis/.local/lib/*
test*.py
setup.py
__init__.py


60 changes: 60 additions & 0 deletions .travis.yml
@@ -0,0 +1,60 @@
language: python

python:
- "2.7"
- "3.5"

compiler:
- gcc

install:
# Fetch and install conda
# -----------------------
- export CONDA_BASE="http://repo.continuum.io/miniconda/Miniconda"
- if [[ "${TRAVIS_PYTHON_VERSION}" == 2* ]]; then
wget ${CONDA_BASE}2-latest-Linux-x86_64.sh -O miniconda.sh;
else
wget ${CONDA_BASE}3-latest-Linux-x86_64.sh -O miniconda.sh;
fi
- bash miniconda.sh -b -p ${HOME}/miniconda
- export PATH="${HOME}/miniconda/bin:${PATH}"
- hash -r

# Create the testing environment
# ------------------------------
- conda config --set always_yes yes
- conda config --set changeps1 no
- conda config --set show_channel_urls true
- conda config --add channels conda-forge
- conda update --quiet conda
- ENV_NAME="test-environment"
- conda create --quiet -n ${ENV_NAME} python=${TRAVIS_PYTHON_VERSION}
- source activate ${ENV_NAME}

# Customise the testing environment
# ---------------------------------
- conda install --quiet --file conda-requirements.txt
- pip install --user coveralls
- pip install --user codecov

# Summerise environment
# ---------------------
- conda list
- conda info -a

# Install and test
- git clone https://github.com/JohannesBuchner/MultiNest.git
- pushd MultiNest/build && cmake .. && make && popd
- test -e MultiNest/lib/libmultinest.so
- python setup.py install --user

- git clone https://github.com/JohannesBuchner/cuba.git
- pushd cuba && ./configure && ./makeshared.sh && popd

script:
- LD_LIBRARY_PATH=MultiNest/lib/:${LD_LIBRARY_PATH} python -c 'import pymultinest'
- LD_LIBRARY_PATH=MultiNest/lib/:${LD_LIBRARY_PATH} coverage run setup.py test

after_success: coveralls


3 changes: 3 additions & 0 deletions conda-requirements.txt
@@ -0,0 +1,3 @@
numpy
scipy
matplotlib
1 change: 1 addition & 0 deletions pymultinest/run.py
Expand Up @@ -246,6 +246,7 @@ def dumper(nSamples,nlive,nPar,
sb, seed, wraps,
verbose, resume, write_output, init_MPI,
log_zero, max_iter, loglike, dumper, context]
print(args)
args_converted = [converter(v) for v, converter in zip(args, argtypes)]
lib.run(*args_converted)
signal.signal(signal.SIGINT, prev_handler)
Expand Down
2 changes: 2 additions & 0 deletions setup.cfg
@@ -0,0 +1,2 @@
[aliases]
test=pytest
2 changes: 2 additions & 0 deletions setup.py
Expand Up @@ -25,5 +25,7 @@
requires = ["ctypesGsl", "numpy (>=1.5)", "matplotlib", "scipy"],
scripts=['multinest_marginals.py'],
long_description=long_description,
setup_requires=['pytest-runner'],
tests_require=['pytest'],
)

0 comments on commit 8019f60

Please sign in to comment.