-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
94 lines (84 loc) · 3.65 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
# This following script attempts build dependible conda environments on linux
# numpy, pandas and matplotlib are required dependencies; care is needed
# in improving build time and reproducibilty.
sudo: false # works w/Docker
language: python
python:
- "2.7"
- "2.7.12"
- "3.3"
- "3.4"
- "3.5"
- "3.5.2"
notifications:
email:
on_success: never
on_failure: always
# Necessary packages for building numpy; turned off for now since conda adds it
#cache: apt
#addons:
# apt:
# packages:
# - libatlas-dev
# - libatlas-base-dev
# - liblapack-dev
# - gfortran
# Setup Miniconda
before_install:
# Do this conditionally since it saves download time if the version is the same.
- if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then
wget https://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh;
else
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
fi
##- chmod +x miniconda.sh # release permissions
- bash miniconda.sh -b -p $HOME/miniconda # assign conda program to HOME dir
- export PATH="$HOME/miniconda/bin:$PATH" # enable `conda` command
- hash -r # reset links
- conda config --set always_yes yes --set changeps1 no # say yes to prompts
- conda update -q conda # update since mini lags behind conda; say "yes"
# Useful for debugging any issues with conda
- conda info -a
# The next couple lines fix a crash with multiprocessing on Travis and are not specific to Miniconda
##- rm -rf /dev/shm
##- ln -s /run/shm /dev/shm
install:
# Pre-build major dependencies with conda (much faster and easier)
# Ensure `pip` and `nose` will install within the conda env
- conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION pip nose numpy matplotlib pandas
- source activate test-environment
- pip install coverage codecov nose-cov # code coverage; see other projects on how to install w/Miniconda
##- python setup.py install
- conda list
# Uses conda's `pip` instead of Travis' `pip`
- pip install -r dev_requirements.txt # pre-install pinned dependencies; includes reg. test deps
- pip install . # install source and build/install wheels
#- "pip install wheel"
#- "python setup.py bdist_wheel"
#- "pip install dist/*.whl"
- pip list
# Commands to run tests, coverage and nbval regression tests
script:
- nosetests --with-cov --cov lamana
- ls -al
- coverage combine
- coverage xml
- which coverage
# - cd docs
# - py.test --nbval _demo_pinned.ipynb --sanitize-with nbval_sanitize.cfg
# Interact with codecov
after_success:
- codecov
# Whitelist
# branches:
# only:
# - master
# - develop
# References
# ----- --------- -------------
# (001) Conda and coverage on Travis http://dan-blanchard.roughdraft.io/7045057-quicker-travis-builds-that-rely-on-numpy-and-scipy-using-miniconda
# (002) Travis and conda http://conda.pydata.org/docs/travis.html
# (003) Conda on Travis w/details http://lmjohns3.com/2015/06/using-travis-ci-with-miniconda-scipy-and-nose.html
# (004) Example yaml https://github.com/lmjohns3/theanets/blob/master/.travis.yml
# (005) Example 2 yaml http://samueljackson.me/2015/12/12/better-python-travis-config.html
# (006) Sample codecov w/miniconda https://github.com/JIC-CSB/jicbioimage.illustrate/blob/master/.travis.yml#L31