Skip to content

Commit a95fb73

Browse files
authored
feature: Python 3.7 support (#353)
* Upgrade sagemaker-training and add py37 testenv * Update buildspecs, setup.py, and tox envlist
1 parent ae26b42 commit a95fb73

File tree

7 files changed

+32
-11
lines changed

7 files changed

+32
-11
lines changed

.coveragerc_py37

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[run]
2+
branch = True
3+
timid = True
4+
5+
[report]
6+
exclude_lines =
7+
pragma: no cover
8+
pragma: py3 no cover
9+
if six.PY2
10+
elif six.PY2
11+
12+
partial_branches =
13+
pragma: no cover
14+
pragma: py3 no cover
15+
if six.PY3
16+
elif six.PY3
17+
18+
show_missing = True
19+
20+
fail_under = 90

buildspec-release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ phases:
1212
# run unit tests
1313
- AWS_ACCESS_KEY_ID= AWS_SECRET_ACCESS_KEY= AWS_SESSION_TOKEN=
1414
AWS_CONTAINER_CREDENTIALS_RELATIVE_URI= AWS_DEFAULT_REGION=
15-
tox -e py27,py36 -- test/unit
15+
tox -e py27,py36,py37 --parallel all -- test/unit
1616

1717
# run local integ tests
1818
#- $(aws ecr get-login --no-include-email --region us-west-2)
19-
#- IGNORE_COVERAGE=- tox -e py27,py36 -- test/integ/local
19+
#- IGNORE_COVERAGE=- tox -e py27,py37 -- test/integ/local
2020

2121
# run sagemaker integ tests
22-
#- IGNORE_COVERAGE=- tox -e py27,py36 -- test/integ/sagemaker
22+
#- IGNORE_COVERAGE=- tox -e py27,py37 -- test/integ/sagemaker
2323

2424
# generate the distribution package
2525
- python3 setup.py sdist

buildspec-toolkit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ phases:
3333
- tox -e flake8,twine
3434

3535
# run unit tests
36-
- tox -e py36,py27 test-toolkit/unit
36+
- tox -e py27,py36,py37 --parallel all test-toolkit/unit
3737

3838
# define tags
3939
- GENERIC_TAG="$FRAMEWORK_VERSION-tensorflow-$BUILD_ID"

buildspec-unit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ phases:
55
commands:
66
- pip install --upgrade pip --quiet
77
- pip install tox --quiet
8-
- tox -e ${TOX_ENVLIST} -- test/unit
8+
- tox -e ${TOX_ENVLIST} --parallel all -- test/unit

buildspec.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,14 @@ phases:
9696
- launch-ec2-instance --instance-type $instance_type --ami-name dlami-ubuntu
9797

9898
# run cpu integration tests
99-
- py3_cmd="IGNORE_COVERAGE=- tox -e py36 -- test/integration/local --region $AWS_DEFAULT_REGION --docker-base-name $PREPROD_IMAGE --tag $CPU_TAG_PY3 --framework-version $FRAMEWORK_VERSION --py-version 3 --processor cpu --durations 10"
99+
- py3_cmd="IGNORE_COVERAGE=- tox -e py37 -- test/integration/local --region $AWS_DEFAULT_REGION --docker-base-name $PREPROD_IMAGE --tag $CPU_TAG_PY3 --framework-version $FRAMEWORK_VERSION --py-version 3 --processor cpu --durations 10"
100100
- execute-command-if-has-matching-changes "$py3_cmd" "test/" "docker/*" "buildspec.yml"
101101
- py2_cmd="IGNORE_COVERAGE=- tox -e py27 -- test/integration/local --region $AWS_DEFAULT_REGION --docker-base-name $PREPROD_IMAGE --tag $CPU_TAG_PY2 --framework-version $FRAMEWORK_VERSION --py-version 2 --processor cpu --durations 10"
102102
- execute-command-if-has-matching-changes "$py2_cmd" "test/" "docker/*" "buildspec.yml"
103103

104104
# run gpu integration tests
105105
- printf "$SETUP_CMDS" > $SETUP_FILE
106-
- cmd="IGNORE_COVERAGE=- tox -e py36 -- test/integration/local -n 4 --region $AWS_DEFAULT_REGION --docker-base-name $PREPROD_IMAGE --tag $GPU_TAG_PY3 --framework-version $FRAMEWORK_VERSION --py-version 3 --processor gpu --durations 10"
106+
- cmd="IGNORE_COVERAGE=- tox -e py37 -- test/integration/local -n 4 --region $AWS_DEFAULT_REGION --docker-base-name $PREPROD_IMAGE --tag $GPU_TAG_PY3 --framework-version $FRAMEWORK_VERSION --py-version 3 --processor gpu --durations 10"
107107
- py3_cmd="remote-test --github-repo $GITHUB_REPO --test-cmd \"$cmd\" --setup-file $SETUP_FILE --pr-number \"$PR_NUM\""
108108
- execute-command-if-has-matching-changes "$py3_cmd" "test/" "docker/*" "buildspec.yml"
109109

@@ -112,9 +112,9 @@ phases:
112112
- execute-command-if-has-matching-changes "$py2_cmd" "test/" "docker/*" "buildspec.yml"
113113

114114
# run sagemaker tests
115-
- test_cmd="IGNORE_COVERAGE=- tox -e py36 -- test/integration/sagemaker -n 8 --region $AWS_DEFAULT_REGION --docker-base-name $ECR_REPO --account-id $ACCOUNT --tag $CPU_TAG_PY3 --py-version 3 --processor cpu --durations 10"
115+
- test_cmd="IGNORE_COVERAGE=- tox -e py37 -- test/integration/sagemaker -n 8 --region $AWS_DEFAULT_REGION --docker-base-name $ECR_REPO --account-id $ACCOUNT --tag $CPU_TAG_PY3 --py-version 3 --processor cpu --durations 10"
116116
- execute-command-if-has-matching-changes "$test_cmd" "test/" "docker/*" "buildspec.yml"
117-
- test_cmd="IGNORE_COVERAGE=- tox -e py36 -- test/integration/sagemaker -n 8 --region $AWS_DEFAULT_REGION --docker-base-name $ECR_REPO --account-id $ACCOUNT --tag $GPU_TAG_PY3 --py-version 3 --processor gpu --durations 10"
117+
- test_cmd="IGNORE_COVERAGE=- tox -e py37 -- test/integration/sagemaker -n 8 --region $AWS_DEFAULT_REGION --docker-base-name $ECR_REPO --account-id $ACCOUNT --tag $GPU_TAG_PY3 --py-version 3 --processor gpu --durations 10"
118118
- execute-command-if-has-matching-changes "$test_cmd" "test/" "docker/*" "buildspec.yml"
119119
- test_cmd="IGNORE_COVERAGE=- tox -e py27 -- test/integration/sagemaker -n 8 --region $AWS_DEFAULT_REGION --docker-base-name $ECR_REPO --account-id $ACCOUNT --tag $CPU_TAG_PY2 --py-version 2 --processor cpu --durations 10"
120120
- execute-command-if-has-matching-changes "$test_cmd" "test/" "docker/*" "buildspec.yml"

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,10 @@ def read_version():
6060
"Programming Language :: Python",
6161
'Programming Language :: Python :: 2.7',
6262
'Programming Language :: Python :: 3.6',
63+
'Programming Language :: Python :: 3.7',
6364
],
6465

65-
install_requires=['sagemaker-training>=3.4.2', 'numpy', 'scipy', 'sklearn',
66+
install_requires=['sagemaker-training>=3.5.0', 'numpy', 'scipy', 'sklearn',
6667
'pandas', 'Pillow', 'h5py'],
6768
extras_require={
6869
'test': test_dependencies,

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# and then run "tox" from this directory.
55

66
[tox]
7-
envlist = py27,py36,flake8
7+
envlist = py27,py36,py37,flake8
88
skip_missing_interpreters = False
99

1010
[travis]

0 commit comments

Comments
 (0)