Skip to content

Commit

Permalink
Merge pull request #4 from bitranox/development
Browse files Browse the repository at this point in the history
1.2.3
  • Loading branch information
bitranox authored Jul 29, 2020
2 parents 4914b91 + 16835d9 commit 1130734
Show file tree
Hide file tree
Showing 15 changed files with 179 additions and 291 deletions.
12 changes: 8 additions & 4 deletions .docs/README_template.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Version 1.2.3 as of 2020-07-29, see changelog_

=======================================================

lib_platform
============

Expand All @@ -22,10 +26,6 @@ Python version required: 3.6.0 or newer

.. include:: ./try_in_jupyter.rst

Installation and Upgrade
------------------------
.. include:: ./installation.rst

Usage
-----------
.. include:: ./usage.rst
Expand All @@ -34,6 +34,10 @@ Usage from Commandline
------------------------
.. include:: ./commandline_help.rst

Installation and Upgrade
------------------------
.. include:: ./installation.rst

Requirements
------------
following modules will be automatically installed :
Expand Down
2 changes: 1 addition & 1 deletion .docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
- `Try it Online`_
- `Installation and Upgrade`_
- `Usage`_
- `Usage from Commandline`_
- `Installation and Upgrade`_
- `Requirements`_
- `Acknowledgements`_
- `Contribute`_
Expand Down
189 changes: 51 additions & 138 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,27 @@ sudo: true

env:
global:
- cPREFIX="" # prefix before commands - used for wine, there the prefix is "wine"
- cPYTHON="python" # command to launch python interpreter (its different on macOs, there we need python3)
- cPIP="python -m pip" # command to launch pip (its different on macOs, there we need pip3)
- WINEDEBUG=fixme-all # switch off wine fix me messages
# prefix before commands - used for wine, there the prefix is "wine"
- cPREFIX=""
# command to launch python interpreter (its different on macOs, there we need python3)
- cPYTHON="python"
# command to launch pip (its different on macOs, there we need pip3)
- cPIP="python -m pip"
# switch off wine fix me messages
- WINEDEBUG=fixme-all
# mypy path
- MYPYPATH="./lib_platform/3rd_party_stubs"
# package name
- PACKAGE_NAME="lib_platform"
# the registered CLI Command
- CLI_COMMAND=lib_platform
# the source file for rst_include (rebuild rst file includes)
- RST_INCLUDE_SOURCE="./.docs/README_template.rst"
# the target file for rst_include (rebuild rst file includes)
- RST_INCLUDE_TARGET="./README.rst"
# secure environment variable
- 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
- secure: "mIb5KEfeclxVKXxEIf91KnsCps5fCraj4pFpJvxTJV1o12rIqEFKXeK+sD/yxA101GQWQo4QJxTFoDHqiyvBHa+HIk1IqC9puYas5+itBxtplshAx+4dgcVcPPohyejV/4Gy90kd5oBxZWcyU2Pgp0/TBhBaiWd9ndsmlzRMpV9PNVptKRcc3hZ2TGIoM9zOVHAe1N1Riuzf4glrp08M0CVv8jMNLL638lKodkNEo3+qdgj/dpz6tjmtDjWl0a24DpqQJRW2nfj3hHirwpo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3tPb+wy7kVHmuW3SdmbP12y+a8aE=" # PYPI_PASSWORD.secret


addons:
Expand Down Expand Up @@ -46,45 +61,50 @@ matrix:
language: python
python: "3.6"
before_install:
- export mypy_strict_typecheck="True"
- export build_docs="False"
- export deploy_on_pypi="False"
- export MYPY_STRICT="True"
- export BUILD_DOCS="False"
- export DEPLOY_CHECK="False"
- export DEPLOY="False"


- os: linux
language: python
python: "3.7"
before_install:
- export mypy_strict_typecheck="True"
- export build_docs="False"
- export deploy_on_pypi="False"
- export MYPY_STRICT="True"
- export BUILD_DOCS="False"
- export DEPLOY_CHECK="False"
- export DEPLOY="False"


- os: linux
language: python
python: "3.8"
before_install:
- export mypy_strict_typecheck="True"
- export build_docs="True"
- export deploy_on_pypi="True"
- export MYPY_STRICT="True"
- export BUILD_DOCS="True"
- export DEPLOY_CHECK="True"
- export DEPLOY="True"


- os: linux
language: python
python: "3.8-dev"
before_install:
- export mypy_strict_typecheck="True"
- export build_docs="False"
- export deploy_on_pypi="False"
- export MYPY_STRICT="True"
- export BUILD_DOCS="False"
- export DEPLOY_CHECK="False"
- export DEPLOY="False"


- os: linux
language: python
python: "pypy3"
before_install:
- export mypy_strict_typecheck="True"
- export build_docs="False"
- export deploy_on_pypi="False"
- export MYPY_STRICT="False"
- export BUILD_DOCS="False"
- export DEPLOY_CHECK="False"
- export DEPLOY="False"


- os: osx
Expand All @@ -100,130 +120,23 @@ matrix:


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"
- ${lib_bash_banner} "upgrading pip"; ${cPREFIX} ${cPIP} install --upgrade pip
- ${lib_bash_banner} "upgrading setuptools"; ${cPREFIX} ${cPIP} install --upgrade setuptools
- ${lib_bash_banner} "upgrading wheel"; ${cPREFIX} ${cPIP} install --upgrade wheel
- ${lib_bash_banner} "upgrading pytest-pycodestyle"; ${cPREFIX} ${cPIP} install --upgrade "pytest-pycodestyle; python_version >= \"3.5\""
- ${lib_bash_banner} "installing lib_log_utils"; ${cPREFIX} ${cPIP} install git+https://github.com/bitranox/lib_log_utils.git
- if [[ ${build_docs} == "True" ]]; then
${lib_bash_banner} "installing rst_include"; ${cPREFIX} ${cPIP} install git+https://github.com/bitranox/rst_include.git;
fi

- if [[ ${cPREFIX} == "wine" ]]; then ${lib_bash_wine}/001_000_install_wine.sh ; fi
- if [[ ${cPREFIX} == "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 [[ ${cPREFIX} == "wine" ]]; then ${lib_bash_wine}/004_000_install_wine_git_portable.sh ; fi
- if [[ ${cPREFIX} == "wine" ]]; then ${lib_bash_wine}/005_000_install_wine_powershell_core.sh ; fi
- ${cPIP} install lib_travis
- log_util --colortest
- lib_travis install

script:

# setup.py test
- COMMAND="${cPREFIX} ${cPYTHON} ./setup.py test"
- ${lib_bash_banner} "running '${COMMAND}'"
- if ${COMMAND}; then ${lib_bash_banner} "'${COMMAND}' - OK"; else ${lib_bash_banner_warning} "'${COMMAND}' - FAILED" && exit 1; fi

# pip install git+https://github.com/bitranox/lib_platform.git --install-option test
- COMMAND="${cPREFIX} ${cPIP} install git+https://github.com/bitranox/lib_platform.git --install-option test"
- ${lib_bash_banner} "running '${COMMAND}'"
- if ${COMMAND}; then ${lib_bash_banner} "'${COMMAND}' - OK"; else ${lib_bash_banner_warning} "'${COMMAND}' - FAILED" && exit 1; fi

# pip install git+https://github.com/bitranox/lib_platform.git
- COMMAND="${cPREFIX} ${cPIP} install git+https://github.com/bitranox/lib_platform.git"
- ${lib_bash_banner} "running '${COMMAND}'"
- if ${COMMAND}; then ${lib_bash_banner} "'${COMMAND}' - OK"; else ${lib_bash_banner_warning} "'${COMMAND}' - FAILED" && exit 1; fi

# commandline registration check
- COMMAND="${cPREFIX} lib_platform --version"
- ${lib_bash_banner} "running '${COMMAND}' (check commandline registration)"
- if ${COMMAND}; then ${lib_bash_banner} "'${COMMAND}' - OK"; else ${lib_bash_banner_warning} "'${COMMAND}' - FAILED" && exit 1; fi

# pytest codecov only
- COMMAND="${cPREFIX} ${cPYTHON} -m pytest --cov=lib_platform"
- ${lib_bash_banner} "running '${COMMAND}' - (coverage only)"
- ${cPREFIX} ${cPIP} install --upgrade -r ./requirements_test.txt > /dev/null 2>&1
- ${cPREFIX} ${cPIP} install --upgrade codecov > /dev/null 2>&1
- ${cPREFIX} ${cPIP} install --upgrade pytest-cov > /dev/null 2>&1
- if ${COMMAND}; then ${lib_bash_banner} "'${COMMAND}' - OK"; else ${lib_bash_banner_warning} "'${COMMAND}' - FAILED" && exit 1; fi

# mypy typecheck strict
- if [[ ${mypy_strict_typecheck} == "True" ]]; then
COMMAND="${cPREFIX} ${cPYTHON} -m mypy -p lib_platform --strict --no-warn-unused-ignores --implicit-reexport --follow-imports=silent"
${lib_bash_banner} "running '${COMMAND}'";
if ${COMMAND}; then ${lib_bash_banner} "'${COMMAND}' - OK"; else ${lib_bash_banner_warning} "'${COMMAND}' - FAILED" && exit 1; fi
else
${lib_bash_banner_warning} "mypy typecheck --strict disabled on this build";
fi

# Bild Docs
- if [[ "${build_docs}" == "True" ]]; then
COMMAND="${cPREFIX}" rst_include include "./.docs/README_template.rst" "./README.rst";
${lib_bash_banner} "running '${COMMAND}' - rebuild README.rst";
if ${COMMAND}; then ${lib_bash_banner} "'${COMMAND}' - OK"; else ${lib_bash_banner_warning} "'${COMMAND}' - FAILED" && exit 1; fi
else
${lib_bash_banner_warning} "rebuild README.rst disabled on this build" ;
fi

# Check if Deployment would work on non-tagged builds
- if [[ -f setup.py ]] && [[ -z ${TRAVIS_TAG} ]] && [[ ${build_docs} == "True" ]]; then
${lib_bash_banner} "Testing PyPi Deployment";
${cPREFIX} ${cPIP} install readme_renderer > /dev/null 2>&1;
${cPREFIX} ${cPIP} install --upgrade twine > /dev/null 2>&1;
${cPREFIX} ${cPIP} install wheel > /dev/null 2>&1;
${cPREFIX} ${cPYTHON} setup.py sdist bdist_wheel || ${lib_bash_banner_warning} "Building Wheels failed" 1>&2;
if ${cPREFIX} twine check dist/*; 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
- BRANCH=$(lib_travis get_branch)
- log_util --level=NOTICE --banner "working on branch ${BRANCH}"
- lib_travis script

after_success:
- ${cPREFIX} coverage report
- ${cPREFIX} codecov
# codeclimate coverage upload - TODO: check function on wine
- if [ "${TRAVIS_OS_NAME}" == 'windows' ]; then
CODECLIMATE_REPO_TOKEN="${CC_TEST_REPORTER_ID}";
${cPREFIX} ${cPIP} install codeclimate-test-reporter;
${cPREFIX} codeclimate-test-reporter;
else
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter;
chmod +x ./cc-test-reporter;
./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT;
fi

# This works for sure - the Travis deploy is somehow buggy.
# create the secret :
# pypi_password
# to create the secret :
# cd /<repository>
# sudo travis encrypt -r <github_account>/<repository> pypi_password=*****
# copy and paste the encrypted password in the PizzaCutter Config File
- if [[ ${deploy_on_pypi} == "True" ]] && [[ -n ${TRAVIS_TAG} ]]; then
${lib_bash_banner} "Deploy on PyPi";
export travis_deploy="True";
${cPREFIX} ${cPIP} install readme_renderer;
${cPREFIX} ${cPIP} install --upgrade twine;
${cPREFIX} ${cPIP} install wheel;
${cPREFIX} ${cPYTHON} setup.py sdist bdist_wheel;
${cPREFIX} twine check dist/*;
${cPREFIX} twine upload --repository-url https://upload.pypi.org/legacy/ -u bitranox -p ${pypi_password} dist/*;
fi
- lib_travis after_success
- lib_travis deploy

notifications:
email:
recipients:
- [email protected]
on_success: never # default: change
on_failure: always # default: always
# on_success default: change
on_success: never
on_failure: always
6 changes: 6 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ Changelog
- new MINOR version for added functionality in a backwards compatible manner
- new PATCH version for backwards compatible bug fixes

1.2.3
-----
2020-07-29: feature release
- use the new pizzacutter template
- use cli_exit_tools

1.2.2
-----
2020-07-16: feature release
Expand Down
Loading

0 comments on commit 1130734

Please sign in to comment.