Skip to content

Commit 27d9393

Browse files
authored
Merge pull request #14 from aws/sync-public
Sync master with public repo
2 parents 3ebe7ec + 0eb1baf commit 27d9393

8 files changed

+37
-11
lines changed

buildspec.yml

+3
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@ batch:
1313
buildspec: codebuild/python3.7.yml
1414
- identifier: python3_8
1515
buildspec: codebuild/python3.8.yml
16+
17+
- identifier: code_coverage
18+
buildspec: codebuild/coverage/coverage.yml

codebuild/coverage/coverage.yml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version: 0.2
2+
3+
env:
4+
variables:
5+
TOXENV: "coverage"
6+
7+
phases:
8+
install:
9+
runtime-versions:
10+
python: latest
11+
build:
12+
commands:
13+
- pip install tox
14+
- tox

examples/src/aws_kms_encrypted_client.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -124,15 +124,15 @@ def encrypt_batch_items(table_name, aws_cmk_id):
124124
def _select_index_from_item(item):
125125
"""Find the index keys that match this item."""
126126
for index in index_keys:
127-
if all([item[key] == value for key, value in index.items()]):
127+
if all(item[key] == value for key, value in index.items()):
128128
return index
129129

130130
raise Exception("Index key not found in item.")
131131

132132
def _select_item_from_index(index, all_items):
133133
"""Find the item that matches these index keys."""
134134
for item in all_items:
135-
if all([item[key] == value for key, value in index.items()]):
135+
if all(item[key] == value for key, value in index.items()):
136136
return item
137137

138138
raise Exception("Index key not found in item.")

examples/src/aws_kms_encrypted_resource.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,15 @@ def encrypt_batch_items(table_name, aws_cmk_id):
7676
def _select_index_from_item(item):
7777
"""Find the index keys that match this item."""
7878
for index in index_keys:
79-
if all([item[key] == value for key, value in index.items()]):
79+
if all(item[key] == value for key, value in index.items()):
8080
return index
8181

8282
raise Exception("Index key not found in item.")
8383

8484
def _select_item_from_index(index, all_items):
8585
"""Find the item that matches these index keys."""
8686
for item in all_items:
87-
if all([item[key] == value for key, value in index.items()]):
87+
if all(item[key] == value for key, value in index.items()):
8888
return item
8989

9090
raise Exception("Index key not found in item.")

setup.cfg

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ branch = True
99

1010
[coverage:report]
1111
show_missing = True
12+
fail_under = 90
1213

1314
[mypy]
1415
ignore_missing_imports = True

test/upstream-requirements-py27.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ hypothesis==4.40.0
3333
idna==2.8
3434
importlib-metadata==0.23
3535
ipaddress==1.0.22
36-
Jinja2==2.10.3
36+
Jinja2==2.11.3
3737
jmespath==0.9.4
3838
jsondiff==1.1.2
3939
jsonpatch==1.24
@@ -60,10 +60,10 @@ pytest-xdist==1.30.0
6060
python-dateutil==2.8.0
6161
python-jose==3.0.1
6262
pytz==2019.3
63-
PyYAML==5.1.2
63+
PyYAML==5.4
6464
requests==2.22.0
6565
responses==0.10.6
66-
rsa==4.0
66+
rsa==4.5
6767
s3transfer==0.2.1
6868
scandir==1.10.0
6969
six==1.12.0

test/upstream-requirements-py37.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ future==0.18.0
2222
hypothesis==4.40.0
2323
idna==2.8
2424
importlib-metadata==0.23
25-
Jinja2==2.10.3
25+
Jinja2==2.11.3
2626
jmespath==0.9.4
2727
jsondiff==1.1.2
2828
jsonpatch==1.24
@@ -48,10 +48,10 @@ pytest-xdist==1.30.0
4848
python-dateutil==2.8.0
4949
python-jose==3.0.1
5050
pytz==2019.3
51-
PyYAML==5.1.2
51+
PyYAML==5.4
5252
requests==2.22.0
5353
responses==0.10.6
54-
rsa==4.0
54+
rsa==4.5
5555
s3transfer==0.2.1
5656
six==1.12.0
5757
sshpubkeys==3.1.0

tox.ini

+9-1
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,12 @@ envlist =
3535
# test-release :: Builds dist files and uploads to testpypi pypirc profile.
3636
# release :: Builds dist files and uploads to pypi pypirc profile.
3737

38+
# Reporting environments:
39+
#
40+
# coverage :: Runs code coverage, failing the build if coverage is below the configured threshold
41+
3842
[testenv:base-command]
39-
commands = pytest --basetemp={envtmpdir} -l --cov dynamodb_encryption_sdk {posargs}
43+
commands = pytest --basetemp={envtmpdir} -l {posargs}
4044

4145
[testenv]
4246
passenv =
@@ -86,6 +90,10 @@ commands =
8690
# Only run examples tests
8791
examples: {[testenv:base-command]commands} examples/test/ -m "examples"
8892

93+
# Run code coverage on the unit tests
94+
[testenv:coverage]
95+
commands = {[testenv:base-command]commands} --cov dynamodb_encryption_sdk test/ -m "local and not slow and not veryslow and not nope"
96+
8997
# Verify that local tests work without environment variables present
9098
[testenv:nocmk]
9199
basepython = python3

0 commit comments

Comments
 (0)