Skip to content

Instantly share code, notes, and snippets.

@trstringer
Created July 31, 2017 18:14
Show Gist options
  • Save trstringer/2aafb51c906193e14ec9ebfe5f9768cb to your computer and use it in GitHub Desktop.
Save trstringer/2aafb51c906193e14ec9ebfe5f9768cb to your computer and use it in GitHub Desktop.
#!/bin/bash
create_venv() {
python3 -m venv venv >& /dev/null
. venv/bin/activate
}
remove_venv() {
if [ -d "./venv" ]; then
rm -rf ./venv
fi
}
PY_IMPORT="import azure.mgmt.containerinstance"
echo *** ACI import test ***
remove_venv
create_venv
pip install azure >& /dev/null
echo "... attempting with azure pkg (pip install azure)"
python -c "$PY_IMPORT" >& /dev/null
if [ $? -eq 0 ]; then
echo success
else
echo failure
fi
remove_venv
create_venv
pip install --pre azure >& /dev/null
echo "... attempting with azure pre pkg (pip install --pre azure)"
python -c "$PY_IMPORT" >& /dev/null
if [ $? -eq 0 ]; then
echo success
else
echo failure
fi
remove_venv
create_venv
pip install azure-mgmt-containerinstance >& /dev/null
echo "... attempting with azure-mgmt-containerinstance pkg (pip install azure-mgmt-containerinstance)"
python -c "$PY_IMPORT" >& /dev/null
if [ $? -eq 0 ]; then
echo success
else
echo failure
fi
remove_venv
create_venv
git clone https://github.com/Azure/azure-sdk-for-python/ >& /dev/null
cd azure-sdk-for-python
python setup.py install >& /dev/null
cd ..
echo "... attempting with azure-sdk-for-python source build (git clone && python setup.py install)"
python -c "$PY_IMPORT" >& /dev/null
if [ $? -eq 0 ]; then
echo success
else
echo failure
fi
rm -rf azure-sdk-for-python
remove_venv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment