forked from Unidata/MetPy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
184 lines (171 loc) · 5.99 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
173
174
175
176
177
178
179
180
181
182
183
184
# 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="$HOME/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
# Codecov only works with coverage < 4.4
# Docutils 0.15 breaks sphinx 1.8.5 on Python 2.7
- EXTRA_PACKAGES="shapely<1.5.17.post1 coverage<4.4 docutils<0.15"
- EXTRA_INSTALLS="test"
- 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.12.0 matplotlib==2.1.0 scipy==0.17.0 pint==0.8 xarray==0.10.7 pandas==0.22.0"
- TASK="coverage"
- TEST_OUTPUT_CONTROL=""
- python: "3.7-dev"
env: PRE="--pre"
- python: "3.7-dev"
env: TASK="docs" PRE="--pre"
- python: nightly
env: PRE="--pre"
- python: "3.7-dev"
env:
- TASK="coverage"
- VERSIONS="git+git://github.com/hgrecco/pint@master#egg=pint git+git://github.com/pydata/xarray@master#egg=xarray"
- python: "3.7-dev"
env:
- TASK="docs"
- VERSIONS="git+git://github.com/hgrecco/pint@master#egg=pint git+git://github.com/pydata/xarray@master#egg=xarray"
allow_failures:
- python: "3.7-dev"
- python: nightly
before_install:
# We hard-code the sphinx_rtd_theme to lock in our build with patch for
# version chooser
- python -m pip install --upgrade pip;
- 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="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 != 2.7 ]]; 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;
# These need to be downloaded because when we run builds later we disable the index
- python -m pip download -d $WHEELDIR -f $WHEELHOUSE setuptools wheel setuptools_scm;
# Cython needs to be installed before even downloading CartoPy
- python -m pip install Cython;
- python -m pip download -d $WHEELDIR ".[$EXTRA_INSTALLS]" $EXTRA_PACKAGES -f $WHEELHOUSE $PRE $VERSIONS;
- touch $WHEELDIR/download_marker;
- travis_wait python -m pip wheel -w $WHEELDIR $EXTRA_PACKAGES -f $WHEELHOUSE $PRE $VERSIONS;
- python -m pip install $EXTRA_PACKAGES --upgrade --upgrade-strategy=eager --no-index -f file://$WHEELDIR $VERSIONS;
- travis_wait 30 python -m pip wheel -w $WHEELDIR ".[$EXTRA_INSTALLS]" $EXTRA_PACKAGES -f $WHEELHOUSE $PRE $VERSIONS;
# Make sure we don't upload MetPy or other development build wheels
- rm -f $WHEELDIR/MetPy*.whl $WHEELDIR/xarray-*+*.whl $WHEELDIR/Pint-*dev*.whl;
- ls -lrt --full-time $WHEELDIR;
install:
- python -m pip install ".[$EXTRA_INSTALLS]" --upgrade --upgrade-strategy=eager --no-index $PRE -f file://$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 != 2.7 ]]; then
PY_IGNORE_IMPORTMISMATCH=1 python -m pytest --doctest-modules -k "not test" src;
export DOC_TEST_RESULT=$?;
else
export DOC_TEST_RESULT=0;
fi;
doc8 docs/;
if [[ $? -ne 0 || $DOC_BUILD_RESULT -ne 0 || $DOC_TEST_RESULT -ne 0 ]]; then
false;
fi;
else
flake8 --version;
python -m pytest $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
- ls -lrt --full-time $WHEELDIR;
- echo $(find $WHEELDIR -newer $WHEELDIR/download_marker -name *.whl | tr [:space:] :)
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
username: __token__
distributions: sdist bdist_wheel
on:
repo: Unidata/MetPy
python: 3.7
condition: '$TASK != "docs"'
tags: true
- provider: script
script: ci/deploy_docs.sh
skip_cleanup: true
on:
all_branches: true
python: 3.7
condition: '$TASK == "docs"'
notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/7d9db0e3c69256819df7