Skip to content

Commit

Permalink
new python installer with more consistent version checker on ISStreamer
Browse files Browse the repository at this point in the history
  • Loading branch information
davidsulpy committed Nov 19, 2018
1 parent c33d409 commit 2f05bfc
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 80 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -18,6 +18,7 @@ deploy:
repo: initialstate/python_appender
branch: master
python: '3.5'
skip_existing: true
notifications:
slack:
secure: rAnXefiLNiVD2XtRHei42YG9JNDcbzcK/4ZFH2eVMIvYuWIhaeHUeO6kw/A5kGlnk862trhWfvqu6I+Fg0eH040O7DYpRaUDnXOCzLR1zGA5M8qN71uYZsFppPnpDH0TzpVMnIrv2xyjik4zkonJCuAVrLgmLBVCHIt2Bqvs06w=
1 change: 0 additions & 1 deletion cloud_deployer
Submodule cloud_deployer deleted from 4d2856
2 changes: 1 addition & 1 deletion example_app/app.py
@@ -1,7 +1,7 @@
from ISStreamer.Streamer import Streamer
import time, math

streamer = Streamer(bucket_name="test", debug_level=3, ini_file_location="./isstreamer.ini", async=True)
streamer = Streamer(bucket_key="479DAGGBW86T", debug_level=3, ini_file_location="./isstreamer.ini")

def stress_test_loop(i, num):
while i > 0:
Expand Down
35 changes: 23 additions & 12 deletions install_scripts/python
Expand Up @@ -21,6 +21,7 @@ echo " --------- "
echo "This may take a couple minutes to install, grab some coffee :)"
echo "But don't forget to come back, I'll have questions later!"
echo ""
INITIALSTATE_AUTH_SVC=${INITIALSTATE_AUTH_SVC:="auth"}

function check_for_easy_install {
if hash easy_install 2>/dev/null; then
Expand Down Expand Up @@ -83,19 +84,25 @@ function check_for_isstreamer {
pip install --upgrade ISStreamer
fi

isstreamer_version=$(python -c "import pkg_resources; print(pkg_resources.get_distribution('ISStreamer').version)")
isstreamer_version=$(python -c "import ISStreamer.version; print(ISStreamer.version.__version__)")

echo "Found ISStreamer: $isstreamer_version"
isstreamer_version_array=(${isstreamer_version//" "/ })
isstreamer_version_num=${isstreamer_version_array[0]}
isstreamer_version_num_array=(${isstreamer_version_num//./ })
isstreamer_major_version=${isstreamer_version_num_array[0]}
isstreamer_minor=${isstreamer_version_num_array[1]}
isstreamer_minor_version_array=(${isstreamer_minor//"rc"/ })
isstreamer_minor_version=${isstreamer_minor_version_array[0]}

echo "isstreamer major version: $isstreamer_major_version"
echo "isstreamer minor version: $isstreamer_minor_version"
if [[ $isstreamer_version == "" ]] ; then
echo "No ISStreamer found..."
exit 1
else
echo "Found ISStreamer: $isstreamer_version"
isstreamer_version_array=(${isstreamer_version//" "/ })
isstreamer_version_num=${isstreamer_version_array[0]}
isstreamer_version_num_array=(${isstreamer_version_num//./ })
isstreamer_major_version=${isstreamer_version_num_array[0]}
isstreamer_minor=${isstreamer_version_num_array[1]}
isstreamer_minor_version_array=(${isstreamer_minor//"rc"/ })
isstreamer_minor_version=${isstreamer_minor_version_array[0]}

echo "isstreamer major version: $isstreamer_major_version"
echo "isstreamer minor version: $isstreamer_minor_version"
fi
}

function download_script {
Expand Down Expand Up @@ -135,7 +142,11 @@ function download_script {
example_location="./is_example.py"
fi

python_example=$(curl -X POST "https://api.init.st/dev-auth/python/example" -H "X-USER: $username" -H "X-PASS: $password" -H "Accept-Content: text/plain" -m 30 -d "" -s)
echo "getting python example script"
if [ "$INITIALSTATE_AUTH_SVC" != "auth" ]; then
echo "using $INITIALSTATE_AUTH_SVC"
fi
python_example=$(curl -X POST "https://api.init.st/$INITIALSTATE_AUTH_SVC/python/example" -H "X-USER: $username" -H "X-PASS: $password" -H "Accept-Content: text/plain" -m 30 -d "" -s)

if [ "$python_example" = "INVALID_CREDENTIALS" ]; then
echo "invalid credentials, let's try that again!"
Expand Down
66 changes: 0 additions & 66 deletions rakefile.rb

This file was deleted.

0 comments on commit 2f05bfc

Please sign in to comment.