diff options
author | Joris Roovers <jroovers@cisco.com> | 2018-04-15 12:23:34 +0200 |
---|---|---|
committer | Joris Roovers <jroovers@cisco.com> | 2018-04-15 12:23:34 +0200 |
commit | 8eefab08c468e5ef4814df11512a441b5de6edcc (patch) | |
tree | e831cc596a0f950c3ff098c24ccf575d071f917e /run_tests.sh | |
parent | 03eec2042d97a4414b45e0f5f7e67fa85ce9f80b (diff) |
Python 2.6 deprecation warning
Added a Python 2.6 deprecation warning in setup.py
Also modified the build test in run_tests.sh to check for the warning.
Diffstat (limited to 'run_tests.sh')
-rwxr-xr-x | run_tests.sh | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/run_tests.sh b/run_tests.sh index 67d21d6..9e3d546 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -166,13 +166,28 @@ run_build_test(){ # Attempt to build the package echo "Building package ..." pushd "$temp_dir" - python setup.py sdist bdist_wheel + # Copy stdout file descriptor so we can both print output to stdout as well as capture it in a variable + # https://stackoverflow.com/questions/12451278/bash-capture-stdout-to-a-variable-but-still-display-it-in-the-console + exec 5>&1 + output=$(python setup.py sdist bdist_wheel | tee /dev/fd/5) local exit_code=$? popd # Cleanup :-) rm -rf "$temp_dir" - # Print success/mno success + # Check for deprecation message in python 2.6 + if [[ $(python --version 2>&1) == 'Python 2.6'* ]]; then + echo -n "[Python 2.6] Checking for deprecation warning..." + echo "$output" | grep "A future version of gitlint will drop support for Python 2.6" > /dev/null + exit_code=$((exit_code + $?)) + if [ $exit_code -gt 0 ]; then + echo -e "${RED}FAIL${NO_COLOR}" + else + echo -e "${GREEN}SUCCESS${NO_COLOR}" + fi + fi + + # Print success/no success if [ $exit_code -gt 0 ]; then echo -e "Building package...${RED}FAIL${NO_COLOR}" else @@ -266,7 +281,7 @@ install_virtualenv(){ deactivate 2> /dev/null # deactivate any active environment virtualenv -p "$python_binary" "$venv_name" source "${venv_name}/bin/activate" - easy_install -U pip + # easy_install -U pip # Commenting out for now, since this gives issues with python 2.6 pip install --ignore-requires-python -r requirements.txt pip install --ignore-requires-python -r test-requirements.txt deactivate 2> /dev/null |