Skip to content

Commit 9caeaba

Browse files
akiymhaotianw465
authored andcommitted
support pynamodb (#88)
pynamodb >= 3.3.1 supports botocore >= 1.11.3
1 parent 4d79dd5 commit 9caeaba

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

aws_xray_sdk/core/patcher.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
SUPPORTED_MODULES = (
77
'botocore',
8+
'pynamodb',
89
'requests',
910
'sqlite3',
1011
'mysql',
@@ -15,6 +16,7 @@
1516

1617
NO_DOUBLE_PATCH = (
1718
'botocore',
19+
'pynamodb',
1820
'requests',
1921
'sqlite3',
2022
'mysql',
@@ -42,9 +44,9 @@ def patch(modules_to_patch, raise_errors=True):
4244
# elif module_to_patch == 'aioboto3':
4345
# modules.add('aiobotocore')
4446
# pynamodb requires botocore to be patched as well
45-
# elif module_to_patch == 'pynamodb':
46-
# modules.add('botocore')
47-
# modules.add(module_to_patch)
47+
elif module_to_patch == 'pynamodb':
48+
modules.add('botocore')
49+
modules.add(module_to_patch)
4850
else:
4951
modules.add(module_to_patch)
5052
unsupported_modules = modules - set(SUPPORTED_MODULES)

tox.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ deps =
1818
future
1919
# the sdk doesn't support earlier version of django
2020
django >= 1.10, <2.0
21-
pynamodb
21+
pynamodb >= 3.3.1
2222
psycopg2
2323
testing.postgresql
2424

@@ -31,8 +31,8 @@ deps =
3131
py{35,36}: aiobotocore
3232

3333
commands =
34-
py{27,34}: coverage run --source aws_xray_sdk -m py.test tests --ignore tests/ext/aiohttp --ignore tests/ext/aiobotocore --ignore tests/test_async_local_storage.py --ignore tests/test_async_recorder.py --ignore tests/ext/pynamodb
35-
py{35,36}: coverage run --source aws_xray_sdk -m py.test tests --ignore tests/ext/aiobotocore --ignore tests/ext/pynamodb
34+
py{27,34}: coverage run --source aws_xray_sdk -m py.test tests --ignore tests/ext/aiohttp --ignore tests/ext/aiobotocore --ignore tests/test_async_local_storage.py --ignore tests/test_async_recorder.py
35+
py{35,36}: coverage run --source aws_xray_sdk -m py.test tests --ignore tests/ext/aiobotocore
3636

3737
setenv =
3838
DJANGO_SETTINGS_MODULE = tests.ext.django.app.settings

0 commit comments

Comments
 (0)