diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c4007305c9..763f5a85ef 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -78,9 +78,9 @@ Before sending us a pull request, please ensure that: 1. cd into the sagemaker-python-sdk folder: `cd sagemaker-python-sdk` or `cd /environment/sagemaker-python-sdk` 1. Run the following tox command and verify that all code checks and unit tests pass: `tox tests/unit` -You can also run a single test with the following command: `tox -e py36 -- -s -vv ::` +You can also run a single test with the following command: `tox -e py310 -- -s -vv ::` * Note that the coverage test will fail if you only run a single test, so make sure to surround the command with `export IGNORE_COVERAGE=-` and `unset IGNORE_COVERAGE` - * Example: `export IGNORE_COVERAGE=- ; tox -e py36 -- -s -vv tests/unit/test_estimator.py::test_sagemaker_model_s3_uri_invalid ; unset IGNORE_COVERAGE` + * Example: `export IGNORE_COVERAGE=- ; tox -e py310 -- -s -vv tests/unit/test_estimator.py::test_sagemaker_model_s3_uri_invalid ; unset IGNORE_COVERAGE` ### Run the Integration Tests @@ -89,9 +89,9 @@ Our CI system runs integration tests (the ones in the `tests/integ` directory), You should only worry about manually running any new integration tests that you write, or integration tests that test an area of code that you've modified. 1. Follow the instructions at [Set Up the AWS Command Line Interface (AWS CLI)](https://docs.aws.amazon.com/polly/latest/dg/setup-aws-cli.html). -1. To run a test, specify the test file and method you want to run per the following command: `tox -e py36 -- -s -vv ::` +1. To run a test, specify the test file and method you want to run per the following command: `tox -e py310 -- -s -vv ::` * Note that the coverage test will fail if you only run a single test, so make sure to surround the command with `export IGNORE_COVERAGE=-` and `unset IGNORE_COVERAGE` - * Example: `export IGNORE_COVERAGE=- ; tox -e py36 -- -s -vv tests/integ/test_tf_script_mode.py::test_mnist ; unset IGNORE_COVERAGE` + * Example: `export IGNORE_COVERAGE=- ; tox -e py310 -- -s -vv tests/integ/test_tf_script_mode.py::test_mnist ; unset IGNORE_COVERAGE` If you are writing or modifying a test that creates a SageMaker job (training, tuner, or transform) or endpoint, it's important to assign a concurrency-friendly `job_name` (or `endpoint_name`), or your tests may fail randomly due to name collisions. We have a helper method `sagemaker.utils.unique_name_from_base(base, max_length)` that makes test-friendly names. You can find examples of how to use it [here](https://github.com/aws/sagemaker-python-sdk/blob/3816a5658d3737c9767e01bc8d37fc3ed5551593/tests/integ/test_tfs.py#L37) and [here](https://github.com/aws/sagemaker-python-sdk/blob/3816a5658d3737c9767e01bc8d37fc3ed5551593/tests/integ/test_tuner.py#L616), or by searching for "unique\_name\_from\_base" in our test code. diff --git a/README.rst b/README.rst index 44f724a781..b9409f1450 100644 --- a/README.rst +++ b/README.rst @@ -90,6 +90,7 @@ SageMaker Python SDK is tested on: - Python 3.7 - Python 3.8 - Python 3.9 +- Python 3.10 AWS Permissions ~~~~~~~~~~~~~~~ diff --git a/requirements/extras/test_requirements.txt b/requirements/extras/test_requirements.txt index 0fa7b16471..d37476cb62 100644 --- a/requirements/extras/test_requirements.txt +++ b/requirements/extras/test_requirements.txt @@ -11,7 +11,7 @@ contextlib2==21.6.0 awslogs==0.14.0 black==22.3.0 stopit==1.1.2 -apache-airflow==2.2.4 +apache-airflow==2.3.4 apache-airflow-providers-amazon==4.0.0 attrs==20.3.0 fabric==2.6.0 diff --git a/setup.py b/setup.py index e4c6e2e358..aff6bb938b 100644 --- a/setup.py +++ b/setup.py @@ -94,6 +94,7 @@ def read_requirements(filename): "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", ], install_requires=required_packages, extras_require=extras, diff --git a/tests/integ/test_airflow_config.py b/tests/integ/test_airflow_config.py index 638e228375..42232c1135 100644 --- a/tests/integ/test_airflow_config.py +++ b/tests/integ/test_airflow_config.py @@ -14,9 +14,9 @@ import os -import airflow import pytest import numpy as np +from airflow import utils from airflow import DAG from airflow.contrib.operators.sagemaker_training_operator import SageMakerTrainingOperator from airflow.contrib.operators.sagemaker_transform_operator import SageMakerTransformOperator @@ -624,7 +624,7 @@ def _build_airflow_workflow(estimator, instance_type, inputs=None, mini_batch_si default_args = { "owner": "airflow", - "start_date": airflow.utils.dates.days_ago(2), + "start_date": utils.dates.days_ago(2), "provide_context": True, }