Skip to content

Commit 4906998

Browse files
committed
fix: run_notebook_test.sh skip incompatible and use excplicit python version for pip
1 parent 5d3631f commit 4906998

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

tests/scripts/run-notebook-test.sh

+15-2
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,22 @@ for env in base /home/ec2-user/anaconda3/envs/*; do
5858
5959
sudo -u ec2-user -E sh -c 'source /home/ec2-user/anaconda3/bin/activate "$env"'
6060
61+
if [ $env = base ]; then
62+
ENV_PYTHON=python
63+
else
64+
ENV_PYTHON="$env/bin/python"
65+
fi
66+
67+
PYTHON_VERSION=$($ENV_PYTHON -c"import sys; print('{}{}'.format(sys.version_info[0], sys.version_info[1]))")
68+
if [ $PYTHON_VERSION -lt 38 ]; then
69+
echo "Skipping because $env uses py$PYTHON_VERSION which is incompatible with SageMaker Python SDK"
70+
sudo -u ec2-user -E sh -c 'source /home/ec2-user/anaconda3/bin/deactivate'
71+
continue
72+
fi
73+
6174
echo "Updating SageMaker Python SDK..."
62-
pip install --upgrade pip
63-
pip install "$TARBALL_DIRECTORY/sagemaker.tar.gz"
75+
$ENV_PYTHON -m pip install --upgrade pip
76+
$ENV_PYTHON -m pip install "$TARBALL_DIRECTORY/sagemaker.tar.gz"
6477
6578
sudo -u ec2-user -E sh -c 'source /home/ec2-user/anaconda3/bin/deactivate'
6679

0 commit comments

Comments
 (0)