Skip to content

change: update scikit-learn, scipy, and apache-airflow deps for dependabot #4103

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Sep 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .githooks/pre-push
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
# this pre-push hook runs style checks and unit tests in python 3.6, 3.7, and 3.8 using tox.
# this pre-push hook runs style checks and unit tests in python 3.8, 3.9, and 3.10 using tox.

set -e

Expand Down
2 changes: 1 addition & 1 deletion requirements/extras/scipy_requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
scipy==1.7.3
scipy==1.10.1
6 changes: 3 additions & 3 deletions requirements/extras/test_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ awslogs==0.14.0
black==22.3.0
stopit==1.1.2
# Update tox.ini to have correct version of airflow constraints file
apache-airflow==2.6.3
apache-airflow==2.7.0
apache-airflow-providers-amazon==7.2.1
attrs>=23.1.0,<24
fabric==2.6.0
Expand All @@ -21,9 +21,9 @@ sagemaker-experiments==0.1.35
Jinja2==3.0.3
pyvis==0.2.1
pandas>=1.3.5,<1.5
scikit-learn==1.0.2
scikit-learn==1.3.0
cloudpickle==2.2.1
scipy==1.7.3
scipy==1.10.1
urllib3>=1.26.8,<1.26.15
docker>=5.0.2,<7.0.0
PyYAML==6.0
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def read_requirements(filename):
url="https://github.com/aws/sagemaker-python-sdk/",
license="Apache License 2.0",
keywords="ML Amazon AWS AI Tensorflow MXNet",
python_requires=">= 3.7",
python_requires=">= 3.8",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
Expand Down
2 changes: 1 addition & 1 deletion tests/data/remote_function/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
scipy==1.7.3
scipy==1.10.1
2 changes: 1 addition & 1 deletion tests/integ/sagemaker/experiments/test_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ def _generate_estimator(
sagemaker_client_config=sagemaker_client_config,
)
return SKLearn(
framework_version="0.23-1",
framework_version="1.2-1",
entry_point=_ENTRY_POINT_PATH,
dependencies=[sdk_tar],
role=execution_role,
Expand Down
2 changes: 1 addition & 1 deletion tests/integ/sagemaker/remote_function/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"channels:\n"
" - defaults\n"
"dependencies:\n"
" - scipy=1.7.3\n"
" - scipy=1.10.1\n"
" - pip:\n"
" - /sagemaker-{sagemaker_version}.tar.gz\n"
"prefix: /opt/conda/bin/conda\n"
Expand Down
17 changes: 15 additions & 2 deletions tests/scripts/run-notebook-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,22 @@ for env in base /home/ec2-user/anaconda3/envs/*; do

sudo -u ec2-user -E sh -c 'source /home/ec2-user/anaconda3/bin/activate "$env"'

if [ $env = base ]; then
ENV_PYTHON=python
else
ENV_PYTHON="$env/bin/python"
fi

PYTHON_VERSION=$($ENV_PYTHON -c"import sys; print('{}{}'.format(sys.version_info[0], sys.version_info[1]))")
if [ $PYTHON_VERSION -lt 38 ]; then
echo "Skipping because $env uses py$PYTHON_VERSION which is incompatible with SageMaker Python SDK"
sudo -u ec2-user -E sh -c 'source /home/ec2-user/anaconda3/bin/deactivate'
continue
fi

echo "Updating SageMaker Python SDK..."
pip install --upgrade pip
pip install "$TARBALL_DIRECTORY/sagemaker.tar.gz"
$ENV_PYTHON -m pip install --upgrade pip
$ENV_PYTHON -m pip install "$TARBALL_DIRECTORY/sagemaker.tar.gz"

sudo -u ec2-user -E sh -c 'source /home/ec2-user/anaconda3/bin/deactivate'

Expand Down
5 changes: 3 additions & 2 deletions tests/unit/sagemaker/deserializers/test_deserializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,9 @@ def test_numpy_deserializer_from_json(numpy_deserializer):
# Sadly, ragged arrays work fine in JSON (giving us a 1D array of Python lists)
def test_numpy_deserializer_from_json_ragged(numpy_deserializer):
stream = io.BytesIO(b"[[1,2,3],\n[4,5,6,7]]")
array = numpy_deserializer.deserialize(stream, "application/json")
assert np.array_equal(array, np.array([[1, 2, 3], [4, 5, 6, 7]]))
with pytest.raises(ValueError) as error:
numpy_deserializer.deserialize(stream, "application/json")
assert "requested array has an inhomogeneous shape" in str(error)


def test_numpy_deserializer_from_json_alpha():
Expand Down