forked from Unidata/MetPy
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
172 lines (159 loc) · 5.3 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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
# After changing this file, check it on:
# http://lint.travis-ci.org/
language: python
sudo: required
dist: xenial
addons:
artifacts:
target_paths: /
paths:
- $(find $WHEELDIR -newer $WHEELDIR/download_marker -name *.whl | tr [:space:] :)
apt:
packages: &base_build
- libatlas-dev
- libatlas-base-dev
- liblapack-dev
- gfortran
- libproj-dev
git:
depth: 150
python:
- 3.7
- 3.6
- 2.7
cache:
- pip
- directories:
- $HOME/local
env:
global:
- secure: "MOw+6pAQ8s7XX1U9Pbgw8SIuz5MHODj6PXe6xCSIyGR14/0KFNiR9s6NEIa9i7qnp7HOq/V2M9ZFPPioQCrL8k5V4XzZfNz6kXGUT8DoSAAnAAnDWy4yMRxYMlEcjSY8l0KZ9B3szxypkLh0Qd9+pHZYvRSLt8A8UcZSVSNGDjg="
- WHEELHOUSE="https://unidata-python.s3.amazonaws.com/wheelhouse/index.html"
- WHEELDIR="wheelhouse/"
# Shapely dependency needed to keep from using Shapely's manylinux wheels
# which use a different geos that what we build cartopy with on Travis
- EXTRA_PACKAGES="shapely<1.5.17.post1"
- EXTRA_INSTALLS="test,cdm"
- MPLLOCALFREETYPE="1"
- TEST_OUTPUT_CONTROL="-s"
- GH_PAGES_DIR="$HOME/gh-pages"
matrix:
- TASK="coverage"
- TASK="docs"
matrix:
include:
- python: 2.7
env:
- VERSIONS="numpy==1.11.0 matplotlib==2.0.0 scipy==0.17.0 pint==0.8 xarray==0.10.7"
- TASK="coverage"
- TEST_OUTPUT_CONTROL=""
- python: "3.6-dev"
env: PRE="--pre"
- python: "3.6-dev"
env: TASK="docs" PRE="--pre"
- python: nightly
env: PRE="--pre"
allow_failures:
- python: "3.6-dev"
- python: nightly
before_install:
# We hard-code the sphinx_rtd_theme to lock in our build with patch for
# version chooser
- pip install --upgrade pip;
- pip install --upgrade setuptools;
- if [[ ! -f $HOME/local/lib/libproj.so ]]; then
wget http://download.osgeo.org/proj/proj-4.9.3.tar.gz;
tar xf proj-4.9.3.tar.gz;
pushd proj-4.9.3;
./configure --prefix=$HOME/local;
make;
sed -i "" -e s/-I// proj.pc;
make install;
popd;
fi;
- export PKG_CONFIG_PATH="$HOME/local/lib/pkgconfig";
- export LD_LIBRARY_PATH="$HOME/local/lib";
- pkg-config --modversion proj;
- if [[ $TASK == "docs" ]]; then
export EXTRA_INSTALLS="cdm,doc,examples";
export EXTRA_PACKAGES="$EXTRA_PACKAGES pillow sphinx_rtd_theme==0.2.5b1.post1 pytest";
else
export TEST_OPTS="--flake8 --mpl -W error::metpy.deprecation.MetpyDeprecationWarning";
if [[ $TRAVIS_PYTHON_VERSION == 3.6 ]]; then
export EXTRA_PACKAGES="$EXTRA_PACKAGES flake8-bugbear";
fi;
if [[ $TASK == "coverage" ]]; then
export TEST_OPTS="$TEST_OPTS --cov=metpy";
export EXTRA_PACKAGES="$EXTRA_PACKAGES pytest-cov";
fi;
fi;
- mkdir $WHEELDIR;
# Cython needs to be installed before even downloading CartoPy
- pip install Cython;
- pip download -d $WHEELDIR ".[$EXTRA_INSTALLS]" $EXTRA_PACKAGES -f $WHEELHOUSE $PRE $VERSIONS;
- touch $WHEELDIR/download_marker && ls -lrt $WHEELDIR;
- travis_wait pip wheel -w $WHEELDIR $EXTRA_PACKAGES -f $WHEELHOUSE $PRE $VERSIONS;
- pip install $EXTRA_PACKAGES --upgrade --upgrade-strategy=eager --no-index -f file://$PWD/$WHEELDIR $VERSIONS;
- travis_wait 30 pip wheel -w $WHEELDIR ".[$EXTRA_INSTALLS]" $EXTRA_PACKAGES -f $WHEELHOUSE $PRE $VERSIONS;
- rm -f $WHEELDIR/MetPy*.whl;
install:
- pip install ".[$EXTRA_INSTALLS]" --upgrade --upgrade-strategy=eager --no-index $PRE -f file://$PWD/$WHEELDIR $VERSIONS;
script:
- if [[ $TASK == "docs" ]]; then
export TEST_DATA_DIR=${TRAVIS_BUILD_DIR}/staticdata;
pushd docs;
make clean overridecheck html linkcheck O=-W;
export DOC_BUILD_RESULT=$?;
popd;
if [[ $TRAVIS_PYTHON_VERSION == 3.6* ]]; then
MPLBACKEND='agg' pytest --doctest-modules -k "not test" metpy;
export DOC_TEST_RESULT=$?;
else
export DOC_TEST_RESULT=0;
fi;
doc8 --file-encoding utf8 README.rst docs/;
if [[ $? -ne 0 || $DOC_BUILD_RESULT -ne 0 || $DOC_TEST_RESULT -ne 0 ]]; then
false;
fi;
else
flake8 --version;
python setup.py test --addopts "$TEST_OUTPUT_CONTROL $TEST_OPTS";
fi
after_script:
- if [[ $TASK == "coverage" ]]; then
pip install codecov codacy-coverage codeclimate-test-reporter;
codecov -e TRAVIS_PYTHON_VERSION;
coverage xml;
python-codacy-coverage -r coverage.xml;
codeclimate-test-reporter;
fi
before_deploy:
# Remove unused, unminified javascript from sphinx
- if [[ $TASK == "docs" ]]; then
rm -f docs/build/html/_static/jquery-*.js;
rm -f docs/build/html/_static/underscore-*.js;
rm -f docs/build/html/.buildinfo;
fi
deploy:
- provider: pypi
user: dopplershift
password:
secure: VYbxLZZnQ1hR2WZwe6+NXLNVbxceDQzlaVM/G3PW8mYlnyWgIVJBgCcgpH22wT4IsNQqo1r9ow9HiybzwcU1VTZ9KXjYsjre/kCZob0jmuPKlDtujOLaMJFf0XzOw7Y/AFXaMakFA8ZOYJLaMXc0WMLwGT7Hw/oP/e2ztpVLxRA=
distributions: sdist bdist_wheel
upload_docs: no
on:
repo: Unidata/MetPy
python: 3.6
condition: '$TASK != "docs"'
tags: true
- provider: script
script: ci/deploy_docs.sh
skip_cleanup: true
on:
all_branches: true
python: 3.6
condition: '$TASK == "docs"'
notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/7d9db0e3c69256819df7