forked from SciTools/iris
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
143 lines (119 loc) · 6.82 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
#
# Based on pelson's travis work for cartopy.
#
# Please update the cartopy, test data, and sample data git references below if appropriate.
#
# Note: Contrary to the travis documentation,
# http://about.travis-ci.org/docs/user/languages/python/#Travis-CI-Uses-Isolated-virtualenvs
# we will use the system python because it takes too long to install scipy from source.
#
language: python
python:
- 2.7
git:
depth: 10000
install:
- export BIGGUS_REF="da8f19f197adff77e8071b0e04269c8b888a1fbf"
- export BIGGUS_SUFFIX=$(echo "${BIGGUS_REF}" | sed "s/^v//")
- export CARTOPY_REF="0a0b548a08d445427bef834cf5bdb19cbee4202a"
- export CARTOPY_SUFFIX=$(echo "${CARTOPY_REF}" | sed "s/^v//")
- export IRIS_TEST_DATA_REF="3378fe68c00ca7f31895ab6630a59a39ccef94e3"
- export IRIS_TEST_DATA_SUFFIX=$(echo "${IRIS_TEST_DATA_REF}" | sed "s/^v//")
- export IRIS_SAMPLE_DATA_REF="1ed3e26606366717e2053bacc12bf5e8d8fa2704"
- export IRIS_SAMPLE_DATA_SUFFIX=$(echo "${IRIS_SAMPLE_DATA_REF}" | sed "s/^v//")
# Switch off virtualenv so we can use apt-get for Python packages.
- deactivate
# add repo
- ./.travis_no_output sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3E5C1192
- ./.travis_no_output sudo add-apt-repository -y ppa:ubuntugis/ppa
# access to scipy 0.12.0 https://launchpad.net/~pylab/+archive/stable
- sudo add-apt-repository -y ppa:pylab/stable
- ./.travis_no_output sudo apt-get update
# install deps
- ./.travis_no_output sudo apt-get install python-scipy cython python-pip
- ./.travis_no_output sudo /usr/bin/pip install numpy==1.7.2
- ./.travis_no_output sudo /usr/bin/pip install --use-mirrors shapely nose
- ./.travis_no_output sudo /usr/bin/pip install --use-mirrors pyshp pep8 mock
- ./.travis_no_output sudo /usr/bin/pip install --use-mirrors setuptools
- ./.travis_no_output sudo /usr/bin/pip install matplotlib==1.3.1
- ./.travis_no_output sudo apt-get install libgeos-dev libproj-dev
- ./.travis_no_output sudo apt-get install libudunits2-dev libhdf5-serial-dev netcdf-bin libnetcdf-dev
- ./.travis_no_output sudo apt-get install make unzip python-sphinx graphviz
- ./.travis_no_output sudo /usr/bin/pip install http://netcdf4-python.googlecode.com/files/netCDF4-1.0.2.tar.gz
- ./.travis_no_output sudo /usr/bin/pip install pyke
- ./.travis_no_output sudo /usr/bin/pip install pandas==0.12.0
- ./.travis_no_output sudo apt-get install openjdk-7-jre
- sudo apt-get install python-gdal
- export LD_LIBRARY_PATH=/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server:$LD_LIBRARY_PATH
# cfchecker
- ./.travis_no_output sudo /usr/bin/pip install cdat-lite
# cfchecker via pip normally works, but we've found the pip interface to fail intermittently,
# therefore we specify the full download url.
# - ./.travis_no_output sudo /usr/bin/pip install cfchecker
- ./.travis_no_output sudo /usr/bin/pip install https://pypi.python.org/packages/source/c/cfchecker/cfchecker-2.0.3.tar.gz#md5=54e780e8688ac743d1e21448a3901061
- echo '#!/usr/bin/env sh' > cfchecker
- echo "cfchecks -s `pwd`/etc/cf-standard-name-table.xml -a `pwd`/etc/area-type-table.xml -u /usr/share/xml/udunits/udunits2.xml \$1" >> cfchecker
- ./.travis_no_output sudo cp cfchecker /usr/local/bin/cfchecker
- ./.travis_no_output sudo chmod a+x /usr/local/bin/cfchecker
# grib api
- ./.travis_no_output sudo apt-get install libjasper-dev
- ./.travis_no_output sudo apt-get build-dep libgrib-api-1.9.9 libgrib-api-dev libgrib-api-tools
- ./.travis_no_output wget https://software.ecmwf.int/wiki/download/attachments/3473437/grib_api-1.9.16.tar.gz --no-check-certificate
- ./.travis_no_output tar -xvf grib_api-1.9.16.tar.gz
- cd grib_api-1.9.16/
- ../.travis_no_output PYTHON="/usr/bin/python" CFLAGS="-fPIC" ./configure --with-jasper=/usr/local/lib --disable-fortran --enable-python
- ../.travis_no_output make
- ../.travis_no_output sudo make install
- cd python
- ../../.travis_no_output sudo /usr/bin/python setup.py install
- cd ../..
# biggus
- ./.travis_no_output wget -O biggus.zip https://github.com/SciTools/biggus/archive/${BIGGUS_REF}.zip
- ./.travis_no_output unzip -q biggus.zip
- ln -s $(pwd)/biggus-${BIGGUS_SUFFIX} biggus
- cd biggus
- ../.travis_no_output /usr/bin/python setup.py install --user
- cd ..
# cartopy
- ./.travis_no_output wget -O cartopy.zip https://github.com/SciTools/cartopy/archive/${CARTOPY_REF}.zip
- ./.travis_no_output unzip -q cartopy.zip
- ln -s $(pwd)/cartopy-${CARTOPY_SUFFIX} cartopy
- cd cartopy
- ../.travis_no_output /usr/bin/python setup.py install --user
- cd ..
# Pre-load Natural Earth data to avoid multiple, overlapping downloads.
# i.e. There should be no DownloadWarning reports in the log.
- /usr/bin/python -c 'import cartopy; cartopy.io.shapereader.natural_earth()'
# mo_unpack
- ./.travis_no_output wget https://puma.nerc.ac.uk/trac/UM_TOOLS/raw-attachment/wiki/unpack/unpack-030712.tgz
- ./.travis_no_output tar -xf unpack-030712.tgz
- cd unpack-030712/libmo_unpack
#? - gcc -c -fPIC -O4 -mfpmath=sse -msse -I include -D_LARGEFILE_SOURCE -D_LARGEFILE_SOURCE64 -D_FILE_OFFSET_BITS=64 *.c
- ../../.travis_no_output gcc -c -fPIC -O4 -mfpmath=sse -msse -I include -D_LARGEFILE_SOURCE *.c
- ../../.travis_no_output gcc -shared -Wl,-soname,libmo_unpack.so -o lib/libmo_unpack.so *.o
- ../../.travis_no_output sudo cp lib/* /usr/local/lib
- ../../.travis_no_output sudo cp include/* /usr/local/include
- cd ../..
# iris test data
- ./.travis_no_output wget -O iris-test-data.zip https://github.com/SciTools/iris-test-data/archive/${IRIS_TEST_DATA_REF}.zip
- ./.travis_no_output unzip -q iris-test-data.zip
- ln -s $(pwd)/iris-test-data-${IRIS_TEST_DATA_SUFFIX} iris-test-data
# iris sample data
- ./.travis_no_output wget -O iris-sample-data.zip https://github.com/SciTools/iris-sample-data/archive/${IRIS_SAMPLE_DATA_REF}.zip
- ./.travis_no_output unzip -q iris-sample-data.zip
- ln -s $(pwd)/iris-sample-data-${IRIS_SAMPLE_DATA_SUFFIX} iris-sample-data
# iris
- ./.travis_no_output /usr/bin/python setup.py --with-unpack build_ext --inplace -I/usr/local/include -L/usr/local/lib -R/usr/local/lib
- ./.travis_no_output /usr/bin/python setup.py std_names
- echo "[Resources]" > lib/iris/etc/site.cfg
- echo "sample_data_dir = $(pwd)/iris-sample-data/sample_data" >> lib/iris/etc/site.cfg
- echo "test_data_dir = $(pwd)/iris-test-data/test_data" >> lib/iris/etc/site.cfg
- ln -s $(pwd)/lib/iris /home/travis/.local/lib/python2.7/site-packages/iris
- ./.travis_no_output /usr/bin/python setup.py pyke_rules
script:
- /usr/bin/python setup.py test --example-tests
- cd $(pwd)/docs/iris
# Make html produces an error when run on Travis that does not affect any downstream functionality but causes the build to fail spuriously.
# The following gets around this error, which should be investigated further in the future.
- echo `make clean html`
- make doctest