forked from lixzhang/install_python_on_wine_and_travis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
382 lines (337 loc) · 13.7 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
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
language: python
group: travis_latest
dist: xenial
sudo: true
env:
global:
- github_master="https://github.com/${TRAVIS_REPO_SLUG}/archive/master.zip"
- pip_command="pip"
- python_command="python"
- WINEDEBUG=fixme-all # switch off wine fix me messages
# pypi_password for your Project
# This works for sure - the Travis deploy is somehow buggy.
# create the secret :
# cd /<repository>
# travis encrypt pypi_password=*****
# copy and paste the encrypted password here
# - secure: "...."
addons:
apt:
packages:
- xvfb # install xvfb virtual framebuffer - this we need for WINE
- winbind # needed for WINE
services: # start services
- xvfb # is needed for WINE on headless installation
matrix:
include:
- os: windows
language: sh
name: "Windows Python 3.8"
# oddly a secure password under env: global: causes that choco fails
# so we need to put the option : filter_secrets: false
# this can be a security issue, check that You dont leak secrets here !
filter_secrets: false
before_install:
- git clone https://github.com/bitranox/lib_bash.git /usr/local/lib_bash
- chmod -R 0755 /usr/local/lib_bash
- chmod -R +x /usr/local/lib_bash/*.sh
- /usr/local/lib_bash/lib_retry.sh retry choco install python3
- export PATH="/c/Python38:/c/Python38/Scripts:$PATH"
- os: linux
language: python
python: '3.4'
- os: linux
language: python
python: '3.6'
# we can do that also with env - but we dont want to show it on the travis build overview
before_install:
- export mypy_static_typecheck="False"
- export build_docs="True"
- export deploy_on_pypi="False"
- os: linux
language: python
python: '3.7'
- os: linux
language: python
python: '3.8'
- os: linux
language: python
python: '3.8-dev'
- os: linux
language: python
python: 'pypy3'
- os: linux
language: python
name: "WINE stable 32 Bit Python 3.7, Windows XP"
env:
- WINEARCH="win32"
- WINEPREFIX="${HOME}/wine/wine32"
- CMDPREFIX="wine"
- winetricks_windows_version="winxp"
- wine_release="stable"
- wine_python_version="python3"
- os: linux
language: python
name: "WINE stable 64 Bit Python 3.7, Windows XP"
env:
- WINEPREFIX="${HOME}/wine/wine64"
- CMDPREFIX="wine"
- winetricks_windows_version="winxp"
- wine_release="stable"
- wine_python_version="python3"
- os: linux
language: python
name: "WINE stable 32 Bit Python 3.7, Windows 10"
env:
- WINEARCH="win32"
- WINEPREFIX="${HOME}/wine/wine32"
- CMDPREFIX="wine"
- winetricks_windows_version="win10"
- wine_release="stable"
- wine_python_version="python3"
- os: linux
language: python
name: "WINE stable 64 Bit Python 3.7, Windows 10"
env:
- WINEPREFIX="${HOME}/wine/wine64"
- CMDPREFIX="wine"
- winetricks_windows_version="win10"
- wine_release="stable"
- wine_python_version="python3"
- os: linux
language: python
name: "WINE devel 32 Bit Python 3.7, Windows XP"
env:
- WINEARCH="win32"
- WINEPREFIX="${HOME}/wine/wine32"
- CMDPREFIX="wine"
- winetricks_windows_version="winxp"
- wine_release="devel"
- wine_python_version="python3"
- os: linux
language: python
name: "WINE devel 64 Bit Python 3.7, Windows XP"
env:
- WINEPREFIX="${HOME}/wine/wine64"
- CMDPREFIX="wine"
- winetricks_windows_version="winxp"
- wine_release="devel"
- wine_python_version="python3"
- os: linux
language: python
name: "WINE devel 32 Bit Python 3.7, Windows 10"
env:
- WINEARCH="win32"
- WINEPREFIX="${HOME}/wine/wine32"
- CMDPREFIX="wine"
- winetricks_windows_version="win10"
- wine_release="devel"
- wine_python_version="python3"
- os: linux
language: python
name: "WINE devel 64 Bit Python 3.7, Windows 10"
env:
- WINEPREFIX="${HOME}/wine/wine64"
- CMDPREFIX="wine"
- winetricks_windows_version="win10"
- wine_release="devel"
- wine_python_version="python3"
- os: linux
language: python
name: "WINE staging 32 Bit Python 3.7, Windows XP"
env:
- WINEARCH="win32"
- WINEPREFIX="${HOME}/wine/wine32"
- CMDPREFIX="wine"
- winetricks_windows_version="winxp"
- wine_release="staging"
- wine_python_version="python3"
- os: linux
language: python
name: "WINE staging 64 Bit Python 3.7, Windows XP"
env:
- WINEPREFIX="${HOME}/wine/wine64"
- CMDPREFIX="wine"
- winetricks_windows_version="winxp"
- wine_release="staging"
- wine_python_version="python3"
- os: linux
language: python
name: "WINE staging 32 Bit Python 3.7, Windows 10"
env:
- WINEARCH="win32"
- WINEPREFIX="${HOME}/wine/wine32"
- CMDPREFIX="wine"
- winetricks_windows_version="win10"
- wine_release="staging"
- wine_python_version="python3"
- os: linux
language: python
name: "WINE staging 64 Bit Python 3.7, Windows 10"
env:
- WINEPREFIX="${HOME}/wine/wine64"
- CMDPREFIX="wine"
- winetricks_windows_version="win10"
- wine_release="staging"
- wine_python_version="python3"
- os: osx
language: sh
name: "osX Python 3.8"
python: "3.8"
osx_image: xcode11
env:
# on osx pip and python points to python 2.7 - therefore we have to use pip3 and python3 here
- pip_command="pip3"
- python_command="python3"
install:
# install lib_bash_wine - this installs also lib_bash
- $(command -v sudo 2>/dev/null) git clone https://github.com/bitranox/lib_bash_wine.git /usr/local/lib_bash_wine
- $(command -v sudo 2>/dev/null) chmod -R 0755 /usr/local/lib_bash_wine
- $(command -v sudo 2>/dev/null) chmod -R +x /usr/local/lib_bash_wine/*.sh
- $(command -v sudo 2>/dev/null) /usr/local/lib_bash_wine/install_or_update.sh
- export lib_bash_color="/usr/local/lib_bash/lib_color.sh"
- export lib_bash_banner="/usr/local/lib_bash/lib_helpers.sh banner"
- export lib_bash_banner_warning="/usr/local/lib_bash/lib_helpers.sh banner_warning"
- export lib_bash_wine="/usr/local/lib_bash_wine"
- export REPOSITORY_NAME=${TRAVIS_REPO_SLUG#*/} && ${lib_bash_color} clr_bold clr_green "Export Repository Name ${REPOSITORY_NAME}"
- if [[ ${CMDPREFIX} == "wine" ]]; then ${lib_bash_wine}/001_000_install_wine.sh ; fi
- if [[ ${CMDPREFIX} == "wine" ]]; then ${lib_bash_wine}/002_000_install_wine_machine.sh ; fi
- if [[ ${wine_python_version} == "python3" ]]; then ${lib_bash_wine}/003_000_install_wine_python3_preinstalled.sh ; fi
- if [[ ${CMDPREFIX} == "wine" ]]; then ${lib_bash_wine}/004_000_install_wine_git_portable.sh ; fi
- if [[ ${CMDPREFIX} == "wine" ]]; then ${lib_bash_wine}/005_000_install_wine_powershell_core.sh ; fi
- ${lib_bash_banner} "upgrading pip"; ${CMDPREFIX} ${python_command} -m pip install --upgrade pip
- if [[ ${build_docs} == "True" ]]; then
${lib_bash_banner} "install rst_include (Building Docs)";
${CMDPREFIX} ${pip_command} install git+https://github.com/bitranox/rst_include.git;
fi
- if [[ -f ./setup.py ]]; then
${lib_bash_banner} "setup.py found, Installing Application via pip install -e";
${CMDPREFIX} ${pip_command} install -e . ;
if [[ $? -eq 0 ]]; then
${lib_bash_banner} "pip install -e - OK";
else
${lib_bash_banner_warning} "pip install -e - FAILED";
exit 1;
fi
else
${lib_bash_banner_warning} "no setup.py found, skipping Installation";
fi
script:
- if [[ -f ./setup.py ]]; then
${lib_bash_banner} "Installing Pytest requirements";
${CMDPREFIX} ${pip_command} install -r ./requirements_pytest.txt;
${CMDPREFIX} ${pip_command} install codecov;
${CMDPREFIX} ${pip_command} install pytest-cov;
${lib_bash_banner} "running setup.py test";
${CMDPREFIX} ${python_command} ./setup.py test;
if [[ $? -eq 0 ]]; then
${lib_bash_banner} "setup.py test - OK";
else
${lib_bash_banner_warning} "setup.py test - FAILED";
exit 1;
fi
${lib_bash_banner} "running pip install --upgrade";
${CMDPREFIX} ${pip_command} install ${github_master} --upgrade;
if [[ $? -eq 0 ]]; then
${lib_bash_banner} "pip install --upgrade - OK";
else
${lib_bash_banner_warning} "pip install --upgrade - FAILED";
exit 1;
fi
${lib_bash_banner} "running pytest";
${CMDPREFIX} ${python_command} -m pytest --cov;
if [[ $? -eq 0 ]]; then
${lib_bash_banner} "pytest - OK";
else
${lib_bash_banner_warning} "pytest - FAILED";
exit 1;
fi
if [[ ${mypy_static_typecheck} == "True" ]]; then
${lib_bash_banner} "running mypy static typechecks --strict";
${CMDPREFIX} ${python_command} -m mypy -p ${REPOSITORY_NAME} --strict --no-warn-unused-ignores;
if [[ $? -eq 0 ]]; then
${lib_bash_banner} "mypy static typechecks --strict OK";
else
${lib_bash_banner_warning} "mypy static typechecks --strict FAILED";
exit 1;
fi
else
${lib_bash_banner_warning} "static typechecking disabled on this build";
fi
else
${lib_bash_banner_warning} "no setup.py found, skipping pip install with --install-option test";
${lib_bash_banner_warning} "no setup.py found, skipping pip install";
${lib_bash_banner_warning} "no setup.py found, skipping install pytest requirements";
${lib_bash_banner_warning} "no setup.py found, skipping pytest";
${lib_bash_banner_warning} "no setup.py found, skipping static typechecking";
fi
# Check Commandline Registration
- if [[ ! -z ${commandline_registration_check} ]]; then
${lib_bash_banner} "Testing Commandline Registration";
bash -c "${commandline_registration_check}";
if [[ $? -eq 0 ]]; then
${lib_bash_banner} "Commandline Registration - OK";
else
${lib_bash_banner_warning} "Commandline Registration - FAILED";
exit 1;
fi
else
${lib_bash_banner_warning} "Commandline Registration Check disabled on this build";
fi
# Bild Docs
- if [[ -f build_docs.py ]] && [[ "${build_docs}" == "True" ]]; then
${lib_bash_banner} "Building Docs";
${CMDPREFIX} ${python_command} build_docs.py ${TRAVIS_REPO_SLUG};
if [[ $? -eq 0 ]]; then
${lib_bash_banner} "Building Docs OK";
else
${lib_bash_banner_warning} "Building Docs FAILED";
exit 1;
fi
else
${lib_bash_banner_warning} "Building Docs disabled on this build" ;
fi
# Check if Deployment would work on non-tagged builds
- if [[ -f setup.py ]] && [[ -z ${TRAVIS_TAG} ]] && [[ -f build_docs.py ]] && [[ ${build_docs} == "True" ]]; then
${lib_bash_banner} "Testing PyPi Deployment";
${CMDPREFIX} ${pip_command} install readme_renderer > /dev/null 2>&1;
${CMDPREFIX} ${pip_command} install --upgrade twine > /dev/null 2>&1;
${CMDPREFIX} ${pip_command} install wheel > /dev/null 2>&1;
${CMDPREFIX} ${python_command} setup.py sdist bdist_wheel || ${lib_bash_banner_warning} "Building Wheels failed" 1>&2;
${CMDPREFIX} twine check dist/*;
if [[ $? -eq 0 ]]; then
${lib_bash_banner} "PyPi Deployment would be OK";
else
${lib_bash_banner_warning} "PyPi Deployment would fail";
exit 1;
fi
else
${lib_bash_banner_warning} "Check PyPi Deployment disabled on this build" ;
fi
after_success:
- ${CMDPREFIX} coverage report
- ${CMDPREFIX} codecov
# This works for sure - the Travis deploy is somehow buggy.
# create the secret :
# cd /<repository>
# travis encrypt pypi_password=*****
# and put it under :
# env:
# global:
# -secure: *******
- if [[ ${deploy_on_pypi} == "True" ]] && [[ -n ${TRAVIS_TAG} ]]; then
${lib_bash_banner} "Deploy on PyPi";
export travis_deploy="True";
${CMDPREFIX} ${pip_command} install readme_renderer;
${CMDPREFIX} ${pip_command} install --upgrade twine;
${CMDPREFIX} ${pip_command} install wheel;
${CMDPREFIX} ${python_command} setup.py sdist bdist_wheel;
${CMDPREFIX} twine check dist/*;
${CMDPREFIX} twine upload --repository-url https://upload.pypi.org/legacy/ -u bitranox -p ${pypi_password} dist/*;
fi
notifications:
email:
recipients:
on_success: never # default: change
on_failure: always # default: always