diff --git a/.travis.yml b/.travis.yml index c433b4f5c2c623f681a43ddd7b6a798920eea072..aa7d8c1de7756e1999eee4a12f2d53046e8a8a03 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,5 @@ language: python python: - - "2.6" - "2.7" before_install: # To install bats and test our shell/bash functions @@ -17,7 +16,7 @@ env: install: "pip install ." # command to run tests -script: +script: - bats tests/shell - py.test diff --git a/bashhub/rest_client.py b/bashhub/rest_client.py index 7864c75835ee56a6af0d63c1f11cfcce01405df0..c01101aa982e06a35042431c78ad9c0c2fdd0b08 100644 --- a/bashhub/rest_client.py +++ b/bashhub/rest_client.py @@ -14,6 +14,11 @@ from bashhub_globals import BH_URL, BH_AUTH from version import __version__ from requests import ConnectionError from requests import HTTPError +import requests.packages.urllib3 + +# Disable warnings caused by old Python versions 2.7.6 >= +# Remove once we've successfully migrated to Python 3 +requests.packages.urllib3.disable_warnings() # Build our user agent string user_agent = 'bashhub/%s' % __version__ diff --git a/bashhub/shell/bashhub.sh b/bashhub/shell/bashhub.sh index deee9d86b60e69d02580ca057bb25f40cb00357a..2444d5d15557459a81a0ac26da42c4b75c98751a 100644 --- a/bashhub/shell/bashhub.sh +++ b/bashhub/shell/bashhub.sh @@ -37,8 +37,10 @@ __bh_setup_bashhub() { __bh_hook_bashhub() { - # Alias to bind Ctrl + B - bind '"\C-b":"\C-u\C-kbh -i\n"' + if [ -t 1 ]; then + # Alias to bind Ctrl + B + bind '"\C-b":"\C-u\C-kbh -i\n"' + fi # Hook into preexec and precmd functions if ! contains_element __bh_preexec "${preexec_functions[@]}"; then diff --git a/bashhub/shell/deps/lib-bashhub.sh b/bashhub/shell/deps/lib-bashhub.sh index 6fa96dffea1bba071dc436d61eb4eee2e39c2e45..a559050769f28c8808b041e85a7efb6e825a01b7 100644 --- a/bashhub/shell/deps/lib-bashhub.sh +++ b/bashhub/shell/deps/lib-bashhub.sh @@ -142,7 +142,8 @@ __bh_check_bashhub_installation() { # manipulating variables when invoked by precmd. __bh_precmd_run_script() { if [[ -e $BH_HOME_DIRECTORY/script.bh ]]; then - local command=$(head -n 1 "$BH_HOME_DIRECTORY/script.bh") + local command + command=$(head -n 1 "$BH_HOME_DIRECTORY/script.bh") rm "$BH_HOME_DIRECTORY/script.bh" eval "$command" fi; diff --git a/bashhub/version.py b/bashhub/version.py index 2a041c4b5f4c7a3bb07ee9d3183eaba5a62430be..58d478ab160be0a838dab2d6ce9a15ce6d80b07b 100644 --- a/bashhub/version.py +++ b/bashhub/version.py @@ -1 +1 @@ -__version__ = '1.1.6-dev' +__version__ = '1.2.0' diff --git a/install-bashhub.sh b/install-bashhub.sh index 82ad5d5002d10fe47947ebd24d6e4731f68c2777..ae6edac74c91f019f4938f768ee8d2b2d18a08d1 100755 --- a/install-bashhub.sh +++ b/install-bashhub.sh @@ -30,7 +30,7 @@ fi python_command=' import sys -if (2, 6, 0) < sys.version_info < (3,0): +if (2, 7, 0) < sys.version_info < (3,0): sys.exit(0) else: sys.exit(-1)' @@ -41,7 +41,7 @@ zshprofile=~/.zshrc # Optional parameter to specify a github branch # to pull from. -github_branch=${1:-'1.1.5'} +github_branch=${1:-'1.20.0'} install_bashhub() { check_dependencies @@ -50,9 +50,9 @@ install_bashhub() { } get_and_check_python_version() { - # Only supporting 2.6 - 2.7 right now. Eventually bump this to include 3. + # Only supporting 2.7 right now. Eventually bump this to include 3. # Preface explict versions first to avoid global updates to 3. - python_version_array=( "python2.7" "python27" "python2.6" "python26" "python2" "python") + python_version_array=( "python2.7" "python27" "python2" "python") for python_version in "${python_version_array[@]}"; do if type "$python_version" &> /dev/null; then @@ -74,7 +74,7 @@ download_and_install_env() { # Options for your first environment: ENV_OPTS="--distribute" - # Only supporting python 2.6 - 2.7 right now. + # Only supporting 2.7 right now. python_command=$(get_and_check_python_version) if [[ -z "$python_command" ]]; then die "\n Sorry you need to have python 2.7 installed. Please install it and rerun this script." 1 diff --git a/setup.py b/setup.py index 9d0340b9ee3603bbbc0f6d0ed28c39b775888770..ff2d8b02fab41d869f372e3b8d4aa561ae7b7d75 100644 --- a/setup.py +++ b/setup.py @@ -16,7 +16,7 @@ setup(name='bashhub', packages=find_packages(), include_package_data=True, install_requires=[ - 'requests==1.2.3', 'jsonpickle==0.7.0', 'click==3.3', + 'requests==2.20.1', 'jsonpickle==0.7.0', 'click==3.3', 'npyscreen==4.9.1', 'python-dateutil==2.4', 'pyCLI==2.0.3', 'pymongo==2.6', 'inflection==0.2.1', 'humanize==0.5.1', ], diff --git a/tests/shell/install-bashhub.bats b/tests/shell/install-bashhub.bats index 5c68bdb265995d5fb33817a3afb2b26e457ef52b..7c7d978571f9baee68941f34d1cbb2e4a072a81c 100644 --- a/tests/shell/install-bashhub.bats +++ b/tests/shell/install-bashhub.bats @@ -29,33 +29,31 @@ setup() { [[ $status == 0 ]] } -@test "get_and_check_python_version should find python2.7 first" { - # Mock up some fake responses here. - python2.7() { return 0; } +@test "get_and_check_python_version should find python27 first" { + # Mock up some fake responses here. + python2.7() { return 1; } + python27() { return 0; } + python() { return 0; } run 'get_and_check_python_version' [[ $status == 0 ]] - [[ "$output" == "python2.7" ]] + [[ "$output" == "python27" ]] } @test "get_and_check_python_version should find different python versions" { # Mock up some fake responses here. - path=$(which python) - which() { echo $path; } python27() { return 1; } python2.7() { return 1; } - python2.6() { return 0; } - python26() { return 0; } + python2() { return 0; } run 'get_and_check_python_version' [[ $status == 0 ]] - [[ "$output" == "python2.6" ]] + [[ "$output" == "python2" ]] # Should find the default installation if no others. - python2.6() { return 1; } - python26() { return 1; } python2() { return 1; } + python() { return 0; } run 'get_and_check_python_version' [[ $status == 0 ]] @@ -81,6 +79,3 @@ setup() { [[ $status == 0 ]] [[ -e env ]] } - - -