-
Notifications
You must be signed in to change notification settings - Fork 95
/
.travis.yml
96 lines (96 loc) · 5.5 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
sudo: false
language: python
python:
- "2.7"
- "3.5"
env: #split tests
global:
- REQUIRES_PYNBODY=false
- REQUIRES_ASTROPY=false
matrix:
- TEST_FILES='tests/ --ignore=tests/test_qdf.py --ignore=tests/test_pv2qdf.py --ignore=tests/test_diskdf.py --ignore=tests/test_orbit.py --ignore=tests/test_streamdf.py --ignore=tests/test_streamgapdf.py --ignore=tests/test_evolveddiskdf.py --ignore=tests/test_quantity.py --ignore=tests/test_nemo.py --ignore=tests/test_coords.py' REQUIRES_PYNBODY=true
- TEST_FILES='tests/test_quantity.py tests/test_coords.py' REQUIRES_ASTROPY=true # needs to be separate for different config
- TEST_FILES='tests/test_orbit.py' REQUIRES_PYNBODY=true REQUIRES_ASTROPY=true
- TEST_FILES='tests/test_evolveddiskdf.py'
- TEST_FILES='tests/test_diskdf.py'
- TEST_FILES='tests/test_qdf.py tests/test_pv2qdf.py tests/test_streamgapdf.py'
- TEST_FILES='tests/test_streamdf.py'
matrix: # only run crucial tests for python 3.4
include:
- python: "3.4"
env: TEST_FILES='tests/test_orbit.py' REQUIRES_PYNBODY=true REQUIRES_ASTROPY=true
addons:
apt:
packages:
- libgsl0-dev
# - lcov # leave for when they approve its use
before_install:
# Install lcov
- wget http://ftp.de.debian.org/debian/pool/main/l/lcov/lcov_1.11.orig.tar.gz
- tar xf lcov_1.11.orig.tar.gz
- mkdir $HOME/usr
- export PATH=$HOME/usr/bin:$PATH
- make -C lcov-1.11/ install PREFIX=$HOME
# Install GSLv2
- if [[ $TRAVIS_PYTHON_VERSION == 3.5 ]]; then wget ftp://ftp.gnu.org/gnu/gsl/gsl-2.2.tar.gz; fi
- if [[ $TRAVIS_PYTHON_VERSION == 3.5 ]]; then tar xf gsl-2.2.tar.gz; fi
- if [[ $TRAVIS_PYTHON_VERSION == 3.5 ]]; then cd gsl-2.2; fi
- if [[ $TRAVIS_PYTHON_VERSION == 3.5 ]]; then ./configure --prefix=$HOME/usr; fi
- if [[ $TRAVIS_PYTHON_VERSION == 3.5 ]]; then make; fi
- if [[ $TRAVIS_PYTHON_VERSION == 3.5 ]]; then make install; fi
- if [[ $TRAVIS_PYTHON_VERSION == 3.5 ]]; then cd -; fi
- if [[ $TRAVIS_PYTHON_VERSION == 3.5 ]]; then export CFLAGS=-I$HOME/usr/include; fi
- if [[ $TRAVIS_PYTHON_VERSION == 3.5 ]]; then export LDFLAGS=-L$HOME/usr/lib; fi
- if [[ $TRAVIS_PYTHON_VERSION == 3.5 ]]; then export LD_LIBRARY_PATH=$HOME/usr/lib; fi
#Setup conda for faster installs
- wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- hash -r
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda
- conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION numpy scipy matplotlib setuptools pip cython>=0.20 pytest
- source activate test-environment
- export DISPLAY=:99.0 #For plotting tests, courtesy Ryan Varley
- sh -e /etc/init.d/xvfb start $For plotting tests
#Download corrections for some tests
- curl -O https://cloud.github.com/downloads/jobovy/galpy/galpy-dfcorrections.tar.gz
- tar xvzf galpy-dfcorrections.tar.gz -C ./galpy/df_src/data/
# command to install dependencies
install:
- pip install 'coverage==4.1' --force-reinstall # necessary bc of backward incompatible change in 4.2 about combining reports
- pip install pytest-cov
- pip install coveralls-merge
- gem install coveralls-lcov
- easy_install --upgrade requests
- easy_install --upgrade coveralls
- if $REQUIRES_PYNBODY; then pip install git+git://github.com/pynbody/pynbody.git; fi
# clone my version of the torus code, don't do this for one test, to make sure the code installs without the torus code
- if [[ $TEST_FILES != 'tests/test_evolveddiskdf.py' ]]; then git clone https://github.com/jobovy/Torus.git galpy/actionAngle_src/actionAngleTorus_c_ext/torus; fi
- if [[ $TEST_FILES != 'tests/test_evolveddiskdf.py' ]]; then cd galpy/actionAngle_src/actionAngleTorus_c_ext/torus; fi
- if [[ $TEST_FILES != 'tests/test_evolveddiskdf.py' ]]; then git checkout galpy; fi
- if [[ $TEST_FILES != 'tests/test_evolveddiskdf.py' ]]; then cd -; fi
- if $REQUIRES_ASTROPY; then conda install astropy; fi
- python setup.py build_ext --coverage --single_ext --inplace
- python setup.py develop --single_ext
# Following tests that we can start from an incomplete configuration file
- if [[ $TEST_FILES == 'tests/test_evolveddiskdf.py' ]]; then echo -e '[normalization]' > $HOME/.galpyrc && echo -e 'ro = 8.' >> $HOME/.galpyrc; fi
- if [[ $TEST_FILES == 'tests/test_diskdf.py' ]]; then echo -e '[normalization]' > $HOME/.galpyrc && echo -e 'ro = 8.' >> $HOME/.galpyrc && echo -e '[astropy]' >> $HOME/.galpyrc && echo -e 'astropy-units = False' >> $HOME/.galpyrc && echo -e '[plot]' >> $HOME/.galpyrc && echo -e 'seaborn-bovy-defaults = True' >> $HOME/.galpyrc; fi
script:
# only wait longer for orbit integrations
- if [[ $TEST_FILES == 'tests/test_orbit.py' ]]; then travis_wait 40 pytest -v $TEST_FILES --cov galpy --cov-config .coveragerc_travis --disable-pytest-warnings; else pytest -v $TEST_FILES --cov galpy --cov-config .coveragerc_travis --disable-pytest-warnings; fi
after_success:
# Generate lcov output
- lcov --capture --base-directory . --directory build/temp.linux-x86_64-2.7/galpy/ --no-external --output-file coverage_full.info
- lcov --remove coverage_full.info 'galpy/actionAngle_src/actionAngleTorus_c_ext/torus/*' -o coverage.info
# Codecov
- if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then bash <(curl -s https://codecov.io/bash); fi
# coveralls: combine, generate json, and upload
- coveralls-lcov -v -n coverage.info > coverage.c.json
- coveralls-merge coverage.c.json
notifications:
email:
recipients:
- jo.bovy@gmail.com
on_success: change
on_failure: change