@@ -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="./pathlib3x/3rd_party_stubs"
18+ # package name
19+ - PACKAGE_NAME="pathlib3x"
20+ # the registered CLI Command
21+ - CLI_COMMAND=pathlib3x
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 : " O+0o+rCBF9YSt6qCc5pobAEicFt3VonzG11/vx+98LIo75GoR+8f5kqWlZGc329cuHJgD2O3JDBnIFHuWzq3iCjACNjwSgFyYUZJLZbVVOsrNdDWaqPdQP6FNEF3Y5206/FtBeH1MOkwKu3K9YZIIGEOSMNqf4U/eKGHUETHZKXJX/95KfFnvRA4jFh9jj+Hc+Mg+51D4g1RRbJ18vW2whHd7p5lKYlChou/MTEKgmQfBHBrQ4CMdxh/VTKU95iUeKTRo3NwuzL9+wOOWtO6c+QwNPJgvL9+NZTroviYfzqVd7iuBvmj5Tg13tKVoV3bm4RgLy5cB2VHq2JAAeBWJEE7zLX1NFntSxJSG4CKZ8MVPxvaVxZXwa8svOqfRfxe8yOfUYnW3kNvppruXrRQ/3lmLulcWN6XkH55yS+5zWSk+EvxrXNq8YuD9ztTmi9b/Ur2PwTAMJG4IVL0XSzrEGrmu2Yz0OQa7gUYNiJfOhgAaI4Y6lv6Kq9PAn3uQiLat8vY8PD1FU9j0KKL9xr1a5RrZwc448an8/T3LXmS39STaBBUzO7Fc6IHhkNaybh5yYAJUtVZ5jUwRrsPcVdzWfiI/JzVjR+Qnx/8Q3p+A4u+s2H78pnHoPKlqPyHFJxQD+GNah5jRze+BVbn86q5+LY55H37+NkYpHyn6RYGrAk=" # CC_TEST_REPORTER_ID.secret
13- - secure : " rd1r+HtbB1z1f5yDDgF3zTqbkp4H0m1OY0uHLB35GepE/0fO0t3t7erDZi8Lmi9YlM6qsgpaOoIQTMs7mF9pMQUey9A3kWHrwFHXuz+4LTbJR7i9vvdQDN4nQeijG5kWA6SH097452xHUsQAs3xoIDqEG5XbR+VKQDnNF2Jce37C9j9bku2/9yFZyanfRQbvRJoJidL4jiWn4ZD+LFw2yxDT/n8h7RfZZ5rdmTGDByW2yF9OzGqywpOADieBdb2zZIquTDEjBm52ZrAcfKXjrsFdscLn9iill13LBQ6rmS167eup2pHh1cKq2vy0IS0wHvyVrMufXGRrbs/t7Mq4ws5vRQfcCfaLqj8m49NmMaLVtDljwYvWpepFW3qfOLUQS/FvpKYOyJ9aKfhqeskGwUcmShQQEDQvXdV6UuDwOgauFO42q3n41uLllDq7xad2kkhtpk9CuoLA4DRZrZ2nUxougzBH0z8gPBZ1CYt830TNcBBQi9HEdCPnBhCNGYVZhNyMyUl9lzyfqt/7gDe0UiUi5QedFZ/nC44oMIx3/jHr1h2diRBAxlkQzoX5E1bjMKtQdWFI0HjOTk124zJHNos60Ay8tUUEW++QJ6craPu8jn5/qQn6IcwvwCMoR3OW+lRx6k1eusCSq4nnymg0C3jG5liQDPT6Bi7sV156X0k =" # pypi_password .secret
28+ - secure : " tQj4HojSPINDwP5EF8QKQKyewvJPYFmsfpzAsce0WY0Na9iZPqJaWEutDtenjJu/6ww4K1eocVLvAdsfNAoSXmxUrtbkYOw8f2URgb9EYmLFL46QiOs3WZ8hDmgr44qmvizSoto6abCerVlj2WtUmbCVc9nljZVPzUWy3LrkqzyZGyrZhqTxt/ObEI3FhEfrfhcN4UfexPjSnHSe1dqi53NrWQwFEltobyMWTznYIieJToCCNNPk/+3AjjPHkyHWU6vqLsakXoDVwsy028ScPjElu9Huw80wygpRq1i80RiT93GH5qYuV/VJBYT09BQNX4mBFTPauCykkcI1vE7I9BnbQMjrvCHDi1eH+u/yAFOCjKtMuuS5JNLzmKiS68SO1gA0Fv76Wi5vc+tsaz1YoXNnNvurWIEo5mz3sV+5cEV82jx7z70RjSMjOjwzz3gr/XMMDwvnvxP8FAsnolQ495VHGWBVo1pFnxcERT7mxi5TJcwvKtOHDypcFZP2/zt68upHB/Wnkl7aWk4O2ac0awSDQ01r4J0j72d6VkPv7GJvtl/SmMaPg4T+v6ID4BuYLf3BLWPgrQ9YQe94AKLUg8xWYxA5dCN6XoSAz5dZJLhNGHMkoaXmxhAw+ZxloIoUmRvE7yYWQYCGY+H4XpOFauZKr070cHy1HuB1Yv0fWSc =" # 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/pathlib3x.git --install-option test
135- - COMMAND="${cPREFIX} ${cPIP} install git+https://github.com/bitranox/pathlib3x.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/pathlib3x.git
140- - COMMAND="${cPREFIX} ${cPIP} install git+https://github.com/bitranox/pathlib3x.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} pathlib3x --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=pathlib3x"
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 pathlib3x --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 :
227139 - bitranox@gmail.com
228- 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