@@ -5,12 +5,27 @@ sudo: true
55
66env :
77 global :
8- - cPREFIX="" # prefix before commands - used for wine, there the prefix is "wine"
9- - cPYTHON="python" # command to launch python interpreter (its different on macOs, there we need python3)
10- - cPIP="python -m pip" # command to launch pip (its different on macOs, there we need pip3)
11- - WINEDEBUG=fixme-all # switch off wine fix me messages
8+ # prefix before commands - used for wine, there the prefix is "wine"
9+ - cPREFIX=""
10+ # command to launch python interpreter (its different on macOs, there we need python3)
11+ - cPYTHON="python"
12+ # command to launch pip (its different on macOs, there we need pip3)
13+ - cPIP="python -m pip"
14+ # switch off wine fix me messages
15+ - WINEDEBUG=fixme-all
16+ # mypy path
17+ - MYPYPATH="./lib_platform/3rd_party_stubs"
18+ # package name
19+ - PACKAGE_NAME="lib_platform"
20+ # the registered CLI Command
21+ - CLI_COMMAND=lib_platform
22+ # the source file for rst_include (rebuild rst file includes)
23+ - RST_INCLUDE_SOURCE="./.docs/README_template.rst"
24+ # the target file for rst_include (rebuild rst file includes)
25+ - RST_INCLUDE_TARGET="./README.rst"
26+ # secure environment variable
1227 - secure : " IDAldo6HWLAFHnQg4SRyMO4og923nEjeQ/jeOeFUhvgb8/p8Sq01NZR+CH6EC/YRucTjbuBwociJXgQ88hkYprczbWGiijU0MgV/iiRPHd0/f8ZLOTXsOKK81pKV1wcrZMOsqRwwXCjRZHRr2dwK7kJKlV/5p/ESFI9ZscMZrOllS/vEwoPkyWo8rkMjV/oVvC9N8LENvCDjVseODYBXKMpN9TmrICIghiqnndNU0zdOUmNUqquQajxWRiCfowktkmPBkZpJvCDRm6TEgckVHdnczZE4Hzm8SIqEnQK/FAvy+9N65dbH7yiKufTBBdsQrwtwH1+CAAlIbeWnGtezOSON9zRkJYAjeeE1/ax28coh0NiIg0hNCzSawEjp0mVJnvwYDpW06szvBURaOYtCz9FZ8//Ql5xIKCM9IxX3FMiwhoEKHsmbkYEc5KmljkBBNaKOoxI8rFN26XvqoI9y2aRR7I/fFWxfFiIgVsRo1CL1qFhl+R0dnHbNK0abcGLQ6mRmvqXvQb3tW67So13NBueLfBibARR6uE7lh27JG0rLa92Xez2TPBr0mUOS4QDyrNNXv94LHUzO6rrSO3ZCXqXadqX340EcB9J8TG7a6jLp6R03uLCeGCda7ZWpF/9jbD4iAsDExCb+twwfaN0FCKxYn0VTDFLcJRHv2l4wIGM=" # CC_TEST_REPORTER_ID.secret
13- - secure : " mIb5KEfeclxVKXxEIf91KnsCps5fCraj4pFpJvxTJV1o12rIqEFKXeK+sD/yxA101GQWQo4QJxTFoDHqiyvBHa+HIk1IqC9puYas5+itBxtplshAx+4dgcVcPPohyejV/4Gy90kd5oBxZWcyU2Pgp0/TBhBaiWd9ndsmlzRMpV9PNVptKRcc3hZ2TGIoM9zOVHAe1N1Riuzf4glrp08M0CVv8jMNLL638lKodkNEo3+qdgj/dpz6tjmtDjWl0a24DpqQJRW2nfj3hHirwpo1t5ghgFTTAUsjCYi9xoabk6x+BQM2Pj5sqluwehDc31jxBVe2w/sNTTHrYM+OjG6BscfjqLxzqMWmE3tcwXQ4szXcB7JujkNAsxZUX0DDs9ygRajj2bGg2HZyQv3XWCJO8pIW2lktV+UmLabayHUOFfFi86KwGqnGviBLRKv2X0UW0rNSRqL5gL7NiSkw9pkp8z4zNVS41SyvStKFb7zXAIMmCY17meQEV1eEzUQrip7e0aDerjqCRDwskcytqLu79eg9VFZr2J+uludpzddyWPETHVwr5pUr6kxzzj7Pbq5V8/4x16oX3gbiTARPC+OQk/5W+3fO+OcOgDPBXYzVCz5zqktRTEaHq73z9ZdLMiKEpSBXcR2k+jxB7MnHGhrxF8ehCmezZVpVIZE3xtSi24I =" # pypi_password .secret
28+ - secure : " wK8WmNhbVEkbI8V3vSGKFtme/75tL/DItotP66lUleD0sgQyNs3EM+USZPtkFkpJYnIyaX+qfH1zMR+nwLcOmbWHFAcyRBJXmDDDU3E3+UGEJ8DcLEktYOvnY5fGPdbjN5OMDbNdDYwwkC1Ggq/Cqbt1IwYNBCiuzxVtKIPo7oPFShg1mzkvmRTWD4MGygOUYlNTx9/x8OrnXrbj15tGRbrgjF3QE1HC87E464DUN77RZkNmV4ObW/sjo0LqubYeo5Je32oYk7Ys1akFQnPNxYgk+sFA2EvlvLdqDwK/GrV8KTB2OmhA0pgEFR505pCvHiPIA6WbShj2fffqNXUfFHHULo/sgHxI59Fk+lM5jjBQ+OiQuS41BoNhs02pLeuHsNBwRcqFu9MTrDKOtyIuMfbjG4MUTf6x6yleDRkGIkxZLQ0X6QDLOikEb0bVVxZ/xC3lrNfpgz6kRlXfopsBZK1AVrA3HnvhAeI+WjgsYxnHnLLuFddmKn6JpUaYn6GsS+k8gml0t82hi5d77dzVjycgdihk0nEwxbXLpSNuOSEIQu+TXnQZwpV8GOsnpHNYdvfAZIyQ7NZNQqO3O1hrA3qy3bbK87ZgwtkOg4/iZdVjBzEDHF6x2Hw/275WY/b9E3VL1yW+p5w1txG3tPb+wy7kVHmuW3SdmbP12y+a8aE =" # PYPI_PASSWORD .secret
1429
1530
1631addons :
@@ -46,45 +61,50 @@ matrix:
4661 language : python
4762 python : " 3.6"
4863 before_install :
49- - export mypy_strict_typecheck="True"
50- - export build_docs="False"
51- - export deploy_on_pypi="False"
64+ - export MYPY_STRICT="True"
65+ - export BUILD_DOCS="False"
66+ - export DEPLOY_CHECK="False"
67+ - export DEPLOY="False"
5268
5369
5470 - os : linux
5571 language : python
5672 python : " 3.7"
5773 before_install :
58- - export mypy_strict_typecheck="True"
59- - export build_docs="False"
60- - export deploy_on_pypi="False"
74+ - export MYPY_STRICT="True"
75+ - export BUILD_DOCS="False"
76+ - export DEPLOY_CHECK="False"
77+ - export DEPLOY="False"
6178
6279
6380 - os : linux
6481 language : python
6582 python : " 3.8"
6683 before_install :
67- - export mypy_strict_typecheck="True"
68- - export build_docs="True"
69- - export deploy_on_pypi="True"
84+ - export MYPY_STRICT="True"
85+ - export BUILD_DOCS="True"
86+ - export DEPLOY_CHECK="True"
87+ - export DEPLOY="True"
7088
7189
7290 - os : linux
7391 language : python
7492 python : " 3.8-dev"
7593 before_install :
76- - export mypy_strict_typecheck="True"
77- - export build_docs="False"
78- - export deploy_on_pypi="False"
94+ - export MYPY_STRICT="True"
95+ - export BUILD_DOCS="False"
96+ - export DEPLOY_CHECK="False"
97+ - export DEPLOY="False"
7998
8099
81100 - os : linux
82101 language : python
83102 python : " pypy3"
84103 before_install :
85- - export mypy_strict_typecheck="True"
86- - export build_docs="False"
87- - export deploy_on_pypi="False"
104+ - export MYPY_STRICT="False"
105+ - export BUILD_DOCS="False"
106+ - export DEPLOY_CHECK="False"
107+ - export DEPLOY="False"
88108
89109
90110 - os : osx
@@ -100,130 +120,23 @@ matrix:
100120
101121
102122install :
103- # install lib_bash_wine - this installs also lib_bash
104- - $(command -v sudo 2>/dev/null) git clone https://github.com/bitranox/lib_bash_wine.git /usr/local/lib_bash_wine
105- - $(command -v sudo 2>/dev/null) chmod -R 0755 /usr/local/lib_bash_wine
106- - $(command -v sudo 2>/dev/null) chmod -R +x /usr/local/lib_bash_wine/*.sh
107- - $(command -v sudo 2>/dev/null) /usr/local/lib_bash_wine/install_or_update.sh
108- - export lib_bash_color="/usr/local/lib_bash/lib_color.sh"
109- - export lib_bash_banner="/usr/local/lib_bash/lib_helpers.sh banner"
110- - export lib_bash_banner_warning="/usr/local/lib_bash/lib_helpers.sh banner_warning"
111- - export lib_bash_wine="/usr/local/lib_bash_wine"
112- - ${lib_bash_banner} "upgrading pip"; ${cPREFIX} ${cPIP} install --upgrade pip
113- - ${lib_bash_banner} "upgrading setuptools"; ${cPREFIX} ${cPIP} install --upgrade setuptools
114- - ${lib_bash_banner} "upgrading wheel"; ${cPREFIX} ${cPIP} install --upgrade wheel
115- - ${lib_bash_banner} "upgrading pytest-pycodestyle"; ${cPREFIX} ${cPIP} install --upgrade "pytest-pycodestyle; python_version >= \"3.5\""
116- - ${lib_bash_banner} "installing lib_log_utils"; ${cPREFIX} ${cPIP} install git+https://github.com/bitranox/lib_log_utils.git
117- - if [[ ${build_docs} == "True" ]]; then
118- ${lib_bash_banner} "installing rst_include"; ${cPREFIX} ${cPIP} install git+https://github.com/bitranox/rst_include.git;
119- fi
120-
121- - if [[ ${cPREFIX} == "wine" ]]; then ${lib_bash_wine}/001_000_install_wine.sh ; fi
122- - if [[ ${cPREFIX} == "wine" ]]; then ${lib_bash_wine}/002_000_install_wine_machine.sh ; fi
123- - if [[ ${wine_python_version} == "python3" ]]; then ${lib_bash_wine}/003_000_install_wine_python3_preinstalled.sh ; fi
124- - if [[ ${cPREFIX} == "wine" ]]; then ${lib_bash_wine}/004_000_install_wine_git_portable.sh ; fi
125- - if [[ ${cPREFIX} == "wine" ]]; then ${lib_bash_wine}/005_000_install_wine_powershell_core.sh ; fi
123+ - ${cPIP} install lib_travis
124+ - log_util --colortest
125+ - lib_travis install
126126
127127script :
128-
129- # setup.py test
130- - COMMAND="${cPREFIX} ${cPYTHON} ./setup.py test"
131- - ${lib_bash_banner} "running '${COMMAND}'"
132- - if ${COMMAND}; then ${lib_bash_banner} "'${COMMAND}' - OK"; else ${lib_bash_banner_warning} "'${COMMAND}' - FAILED" && exit 1; fi
133-
134- # pip install git+https://github.com/bitranox/lib_platform.git --install-option test
135- - COMMAND="${cPREFIX} ${cPIP} install git+https://github.com/bitranox/lib_platform.git --install-option test"
136- - ${lib_bash_banner} "running '${COMMAND}'"
137- - if ${COMMAND}; then ${lib_bash_banner} "'${COMMAND}' - OK"; else ${lib_bash_banner_warning} "'${COMMAND}' - FAILED" && exit 1; fi
138-
139- # pip install git+https://github.com/bitranox/lib_platform.git
140- - COMMAND="${cPREFIX} ${cPIP} install git+https://github.com/bitranox/lib_platform.git"
141- - ${lib_bash_banner} "running '${COMMAND}'"
142- - if ${COMMAND}; then ${lib_bash_banner} "'${COMMAND}' - OK"; else ${lib_bash_banner_warning} "'${COMMAND}' - FAILED" && exit 1; fi
143-
144- # commandline registration check
145- - COMMAND="${cPREFIX} lib_platform --version"
146- - ${lib_bash_banner} "running '${COMMAND}' (check commandline registration)"
147- - if ${COMMAND}; then ${lib_bash_banner} "'${COMMAND}' - OK"; else ${lib_bash_banner_warning} "'${COMMAND}' - FAILED" && exit 1; fi
148-
149- # pytest codecov only
150- - COMMAND="${cPREFIX} ${cPYTHON} -m pytest --cov=lib_platform"
151- - ${lib_bash_banner} "running '${COMMAND}' - (coverage only)"
152- - ${cPREFIX} ${cPIP} install --upgrade -r ./requirements_test.txt > /dev/null 2>&1
153- - ${cPREFIX} ${cPIP} install --upgrade codecov > /dev/null 2>&1
154- - ${cPREFIX} ${cPIP} install --upgrade pytest-cov > /dev/null 2>&1
155- - if ${COMMAND}; then ${lib_bash_banner} "'${COMMAND}' - OK"; else ${lib_bash_banner_warning} "'${COMMAND}' - FAILED" && exit 1; fi
156-
157- # mypy typecheck strict
158- - if [[ ${mypy_strict_typecheck} == "True" ]]; then
159- COMMAND="${cPREFIX} ${cPYTHON} -m mypy -p lib_platform --strict --no-warn-unused-ignores --implicit-reexport --follow-imports=silent"
160- ${lib_bash_banner} "running '${COMMAND}'";
161- if ${COMMAND}; then ${lib_bash_banner} "'${COMMAND}' - OK"; else ${lib_bash_banner_warning} "'${COMMAND}' - FAILED" && exit 1; fi
162- else
163- ${lib_bash_banner_warning} "mypy typecheck --strict disabled on this build";
164- fi
165-
166- # Bild Docs
167- - if [[ "${build_docs}" == "True" ]]; then
168- COMMAND="${cPREFIX}" rst_include include "./.docs/README_template.rst" "./README.rst";
169- ${lib_bash_banner} "running '${COMMAND}' - rebuild README.rst";
170- if ${COMMAND}; then ${lib_bash_banner} "'${COMMAND}' - OK"; else ${lib_bash_banner_warning} "'${COMMAND}' - FAILED" && exit 1; fi
171- else
172- ${lib_bash_banner_warning} "rebuild README.rst disabled on this build" ;
173- fi
174-
175- # Check if Deployment would work on non-tagged builds
176- - if [[ -f setup.py ]] && [[ -z ${TRAVIS_TAG} ]] && [[ ${build_docs} == "True" ]]; then
177- ${lib_bash_banner} "Testing PyPi Deployment";
178- ${cPREFIX} ${cPIP} install readme_renderer > /dev/null 2>&1;
179- ${cPREFIX} ${cPIP} install --upgrade twine > /dev/null 2>&1;
180- ${cPREFIX} ${cPIP} install wheel > /dev/null 2>&1;
181- ${cPREFIX} ${cPYTHON} setup.py sdist bdist_wheel || ${lib_bash_banner_warning} "Building Wheels failed" 1>&2;
182- if ${cPREFIX} twine check dist/*; then
183- ${lib_bash_banner} "PyPi Deployment would be OK";
184- else
185- ${lib_bash_banner_warning} "PyPi Deployment would fail";
186- exit 1;
187- fi
188- else
189- ${lib_bash_banner_warning} "Check PyPi Deployment disabled on this build" ;
190- fi
128+ - BRANCH=$(lib_travis get_branch)
129+ - log_util --level=NOTICE --banner "working on branch ${BRANCH}"
130+ - lib_travis script
191131
192132after_success :
193- - ${cPREFIX} coverage report
194- - ${cPREFIX} codecov
195- # codeclimate coverage upload - TODO: check function on wine
196- - if [ "${TRAVIS_OS_NAME}" == 'windows' ]; then
197- CODECLIMATE_REPO_TOKEN="${CC_TEST_REPORTER_ID}";
198- ${cPREFIX} ${cPIP} install codeclimate-test-reporter;
199- ${cPREFIX} codeclimate-test-reporter;
200- else
201- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter;
202- chmod +x ./cc-test-reporter;
203- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT;
204- fi
205-
206- # This works for sure - the Travis deploy is somehow buggy.
207- # create the secret :
208- # pypi_password
209- # to create the secret :
210- # cd /<repository>
211- # sudo travis encrypt -r <github_account>/<repository> pypi_password=*****
212- # copy and paste the encrypted password in the PizzaCutter Config File
213- - if [[ ${deploy_on_pypi} == "True" ]] && [[ -n ${TRAVIS_TAG} ]]; then
214- ${lib_bash_banner} "Deploy on PyPi";
215- export travis_deploy="True";
216- ${cPREFIX} ${cPIP} install readme_renderer;
217- ${cPREFIX} ${cPIP} install --upgrade twine;
218- ${cPREFIX} ${cPIP} install wheel;
219- ${cPREFIX} ${cPYTHON} setup.py sdist bdist_wheel;
220- ${cPREFIX} twine check dist/*;
221- ${cPREFIX} twine upload --repository-url https://upload.pypi.org/legacy/ -u bitranox -p ${pypi_password} dist/*;
222- fi
133+ - lib_travis after_success
134+ - lib_travis deploy
223135
224136notifications :
225137 email :
226138 recipients :
227139228- on_success : never # default: change
229- on_failure : always # default: always
140+ # on_success default: change
141+ on_success : never
142+ on_failure : always
0 commit comments