1
+ dist : xenial # required for python-3.7
2
+
1
3
language : python
4
+
2
5
python :
3
6
- " 2.7"
4
7
- " 3.6"
@@ -16,36 +19,48 @@ branches:
16
19
only :
17
20
- master
18
21
22
+ # conda installation is cached to avoid redowloading again and again
23
+ # miniconda and Python dependencies
24
+ cache :
25
+ directories :
26
+ - $HOME/miniconda
27
+
28
+ # exclude some directories from cache (packaged archives and temp
29
+ # directories)
30
+ before_cache :
31
+ - rm -rf $HOME/miniconda/locks
32
+ - rm -rf $HOME/miniconda/pkgs
33
+ - rm -rf $HOME/miniconda/var
34
+ - rm -rf $HOME/miniconda/conda-meta/history
35
+
19
36
before_install :
20
- # Setup anaconda
37
+ # setup Python version
21
38
- if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then
22
- export PYTHON_MAJOR=2
39
+ export PYTHON_MAJOR=2;
23
40
else
24
- export PYTHON_MAJOR=3
41
+ export PYTHON_MAJOR=3;
42
+ fi
43
+ # setup conda (if not already cached)
44
+ - if test -e $HOME/miniconda/bin; then
45
+ echo "miniconda already installed.";
46
+ else
47
+ wget https://repo.continuum.io/miniconda/Miniconda${PYTHON_MAJOR}-latest-Linux-x86_64.sh -O miniconda.sh;
48
+ bash miniconda.sh -b -u -p $HOME/miniconda;
25
49
fi
26
- - wget https://repo.continuum.io/miniconda/Miniconda${PYTHON_MAJOR}-latest-Linux-x86_64.sh -O miniconda.sh
27
- - bash miniconda.sh -b -p $HOME/miniconda
28
50
- export PATH="$HOME/miniconda/bin:$PATH"
29
51
- conda update -q --yes conda
30
52
31
- # Useful for debugging any issues with conda
32
- - conda info -a
33
-
34
- # The next line fix a crash with multiprocessing on Travis
35
- # and are not specific to using Miniconda
36
- - sudo rm -rf /dev/shm && sudo ln -s /run/shm /dev/shm
37
-
38
53
install :
39
54
- if [[ "$PYTHON_MAJOR" == 2 ]]; then
40
- sed -i -r 's/python.+/python=2.7/' environment.yml
55
+ sed -i -r 's/python.+/python=2.7/' environment.yml;
41
56
fi
42
- - conda env create -n test-environment --yes -f environment.yml
43
- - source activate test-environment
57
+ - conda env create -n test -f environment.yml
58
+ - source activate test
44
59
- pip install codecov
45
- - make install
60
+ - python setup.py install
46
61
47
62
script :
48
- - make test
63
+ - python setup.py test
49
64
50
65
after_success :
51
66
- codecov
0 commit comments