/
.travis.yml
250 lines (241 loc) · 7.34 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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
# Control file for Travis CI (https://travis-ci.org)
# Must be located in the root directory of the Git repository.
# Commit depth that is checked out.
git:
depth: 50
# By default, notification emails are sent to the PR creator and commiter.
notifications:
email: false
sudo: required
# Disabling the distro, so we get the latest.
# Note that for Python 2.6, we are pinning the distro to Ubuntu trusty (14.04),
# because that is the latest Ubuntu version that still has Python 2.6 support.
# Note that for Python 3.7 and higher, at least Ubuntu xenial is required,
# which is the default on Travis since 6/2019.
# dist:
# - xenial
# We define the job matrix explicitly, in order to be able to minimize the
# combinations of runtime environments.
# For OS-X, using an explicit matrix is required anyway, because Travis at
# this point only has half-baked support for Python on OS-X that does
# not work. Also, on OS-X, it needs to be invoked with language=generic
# and an empty 'python' variable in order to prevent that Travis attempts
# to install Python.
matrix:
include:
# - os: linux
# language: python
# python: "2.6"
# dist: trusty
# env:
# - PACKAGE_LEVEL=minimum
- os: linux
language: python
python: "2.6"
dist: trusty
env:
- PACKAGE_LEVEL=latest
- os: linux
language: python
python: "2.7"
env:
- PACKAGE_LEVEL=minimum
# - os: linux
# language: python
# python: "2.7"
# env:
# - PACKAGE_LEVEL=latest
# - os: linux
# language: python
# python: "3.4"
# env:
# - PACKAGE_LEVEL=minimum
- os: linux
language: python
python: "3.4"
env:
- PACKAGE_LEVEL=latest
# - os: linux
# language: python
# python: "3.5"
# env:
# - PACKAGE_LEVEL=minimum
# - os: linux
# language: python
# python: "3.5"
# env:
# - PACKAGE_LEVEL=latest
# - os: linux
# language: python
# python: "3.6"
# env:
# - PACKAGE_LEVEL=minimum
# - os: linux
# language: python
# python: "3.6"
# env:
# - PACKAGE_LEVEL=latest
# - os: linux
# language: python
# python: "3.7"
# env:
# - PACKAGE_LEVEL=minimum
# - os: linux
# language: python
# python: "3.7"
# env:
# - PACKAGE_LEVEL=latest
- os: linux
language: python
python: "3.8"
env:
- PACKAGE_LEVEL=minimum
- os: linux
language: python
python: "3.8"
env:
- PACKAGE_LEVEL=latest
# Note: pywbem does not install on pypy, because M2Crypto does not install.
# - os: linux
# language: python
# python: "pypy-5.3.1" # Python 2.7.10
# env:
# - PACKAGE_LEVEL=minimum
# - os: linux
# language: python
# python: "pypy-5.3.1" # Python 2.7.10
# env:
# - PACKAGE_LEVEL=latest
# - os: osx
# language: generic
# python:
# env:
# - PYTHON=2
# - PACKAGE_LEVEL=minimum
# - os: osx
# language: generic
# python:
# env:
# - PYTHON=2
# - PACKAGE_LEVEL=latest
# - os: osx
# language: generic
# python:
# env:
# - PYTHON=3
# - PACKAGE_LEVEL=minimum
# - os: osx
# language: generic
# python:
# env:
# - PYTHON=3
# - PACKAGE_LEVEL=latest
before_install:
- if [[ "$TRAVIS_BRANCH" == "manual-ci-run" ]]; then
export _NEED_REBASE=true;
fi
- if [[ -n $_NEED_REBASE ]]; then git fetch origin master; fi
- if [[ -n $_NEED_REBASE ]]; then git branch master FETCH_HEAD; fi
- if [[ -n $_NEED_REBASE ]]; then git rebase master; fi
- git branch -av
- git tag
# commands to install dependencies
install:
- if [[ "$TRAVIS_BRANCH" == "manual-ci-run" || "$TRAVIS_PULL_REQUEST_BRANCH" == "manual-ci-run" ]]; then
export _MANUAL_CI_RUN=true;
fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
if [[ "${PYTHON:0:1}" == "2" ]]; then
export PYTHON_CMD=python2;
export PIP_CMD=pip2;
else
export PYTHON_CMD=python3;
export PIP_CMD=pip3;
fi;
else
export PYTHON_CMD=python;
export PIP_CMD=pip;
fi;
echo "PYTHON_CMD=$PYTHON_CMD";
echo "PIP_CMD=$PIP_CMD"
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
if [[ "${PYTHON:0:1}" == "2" ]]; then
OSX_PYTHON_PKG=python@2;
else
OSX_PYTHON_PKG=python@3;
fi;
echo "OSX_PYTHON_PKG=$OSX_PYTHON_PKG";
fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
echo "travis.yml Updating package metadata";
brew update;
fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
echo "travis.yml Installing/upgrading Python";
brew ls --versions $OSX_PYTHON_PKG;
rc=$?;
if [[ $rc == 0 ]]; then
echo "Upgrading $OSX_PYTHON_PKG";
brew upgrade $OSX_PYTHON_PKG;
else
echo "Installing $OSX_PYTHON_PKG";
brew install $OSX_PYTHON_PKG;
fi;
echo "Unlinking $OSX_PYTHON_PKG";
brew unlink $OSX_PYTHON_PKG;
echo "Linking $OSX_PYTHON_PKG";
brew link --overwrite $OSX_PYTHON_PKG;
$PIP_CMD install --upgrade pip setuptools;
echo "Checking Python and Pip";
which $PYTHON_CMD && which $PIP_CMD;
fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
echo "travis.yml Installing Python virtualenv";
$PIP_CMD install virtualenv;
virtualenv $HOME/venv -p $PYTHON_CMD && source $HOME/venv/bin/activate;
fi
- env |sort
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
echo "travis.yml Setting Python development env.vars";
openssl_dir=$(brew --prefix openssl);
export LDFLAGS="-L$openssl_dir/lib -I/usr/lib $LDFLAGS";
echo "LDFLAGS=$LDFLAGS";
export CFLAGS="-I$openssl_dir/include -I/usr/include $CFLAGS";
echo "CFLAGS=$CFLAGS";
export SWIG_FEATURES="-I$openssl_dir/include $SWIG_FEATURES";
echo "SWIG_FEATURES=$SWIG_FEATURES";
fi
# Begin of m2crypto quick fix.
# The problem happens only with Python 2.6 on Ubuntu 16.04, see pywbem issue #750.
# TODO: Replace the following quick fix for installing M2Crypto with a real fix.
- if [[ "$TRAVIS_OS_NAME" == "linux" && "$TRAVIS_PYTHON_VERSION" == "2.6" ]]; then
if [[ -f /usr/include/x86_64-linux-gnu/openssl/opensslconf.h && ! -f /usr/include/openssl/opensslconf.h ]]; then
echo "Quickfix for M2Crypto swig run - Linking openssl/opensslconf.h";
sudo ln -s /usr/include/x86_64-linux-gnu/openssl/opensslconf.h /usr/include/openssl/opensslconf.h;
fi
fi
# End of m2crypto quick fix.
- pip list
- make platform env
- make install
- pip list
- make develop
- pip list
# commands to run builds & tests
script:
# make build is always run in order to verify the package version determination
- make build
- if [[ -n $_MANUAL_CI_RUN ]]; then make builddoc; fi
- make check
# - if [[ -n $_MANUAL_CI_RUN ]]; then make pylint; fi
- make pylint
- make test
after_success:
# Note: In case of error 422 (Couldn't find a repository matching this job),
# log on to https://coveralls.io to refresh the OAuth token, and
# make sure this project is enabled there.
# Make sure the Python version matches the one specified for python-coveralls
# in dev-requirements.txt.
- if [[ "$TRAVIS_OS_NAME" == "linux" && "$TRAVIS_PYTHON_VERSION" == "3.8" && "$PACKAGE_LEVEL" == "latest" && -z $_MANUAL_CI_RUN ]]; then
coveralls;
fi