1 | language: python |
---|
2 | virtualenv: |
---|
3 | system_site_packages: true |
---|
4 | env: |
---|
5 | matrix: |
---|
6 | - PYTHON_VERSION="2.7" PARALLEL="mpich2" |
---|
7 | - PYTHON_VERSION="2.7" PARALLEL="false" |
---|
8 | - PYTHON_VERSION="2.6" PARALLEL="false" |
---|
9 | install: |
---|
10 | - sudo apt-get update |
---|
11 | - sudo apt-get install gfortran |
---|
12 | |
---|
13 | - if [[ "$PARALLEL" == "mpich2" ]]; then |
---|
14 | sudo apt-get install mpich2; |
---|
15 | mpirun -np 4 pwd; |
---|
16 | fi |
---|
17 | |
---|
18 | # Deactivate the travis-provided virtual environment and setup a |
---|
19 | # conda-based environment instead |
---|
20 | - deactivate |
---|
21 | - wget http://repo.continuum.io/miniconda/Miniconda-3.8.3-Linux-x86_64.sh -O miniconda.sh |
---|
22 | - chmod +x miniconda.sh && ./miniconda.sh -b |
---|
23 | - export PATH=/home/travis/miniconda/bin:$PATH |
---|
24 | - conda config --set always_yes yes --set changeps1 no |
---|
25 | - conda update -q conda |
---|
26 | |
---|
27 | # Useful for debugging any issues with conda |
---|
28 | - conda info -a |
---|
29 | |
---|
30 | # Conda dependencies |
---|
31 | - conda create -n testenv --yes python=$PYTHON_VERSION pip numpy scipy netcdf4 nose matplotlib |
---|
32 | - source activate testenv |
---|
33 | |
---|
34 | - python --version |
---|
35 | |
---|
36 | # Get GDAL from the PinguCarsti binstar channel for python 2.7 |
---|
37 | # On osx get GDAL from jjhelmus binstar channel |
---|
38 | - if [[ "$PYTHON_VERSION" == "2.7" ]]; then |
---|
39 | conda install -c pingucarsti gdal-data; |
---|
40 | export GDAL_DATA=`gdal-config --datadir`; |
---|
41 | fi |
---|
42 | |
---|
43 | - if [[ "$PYTHON_VERSION" == "2.6" ]]; then conda install gdal; fi |
---|
44 | |
---|
45 | # Install more software to deal with geographical projections |
---|
46 | - pip install pyproj |
---|
47 | |
---|
48 | # python 2.6 doesn't have argparse by default |
---|
49 | - if [[ "$PYTHON_VERSION" == "2.6" ]]; then conda install argparse; fi |
---|
50 | |
---|
51 | |
---|
52 | # Install pypar if parallel |
---|
53 | - if [[ "$PARALLEL" == "mpich2" ]]; then |
---|
54 | svn checkout http://pypar.googlecode.com/svn/ pypar; |
---|
55 | cd pypar/source; |
---|
56 | python setup.py install; |
---|
57 | cd ../..; |
---|
58 | fi |
---|
59 | |
---|
60 | # More debugging |
---|
61 | - printenv |
---|
62 | - conda list |
---|
63 | |
---|
64 | - python setup.py install |
---|
65 | |
---|
66 | script: |
---|
67 | # Your test script goes here |
---|
68 | - python runtests.py |
---|