Skip to content
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
9 changes: 9 additions & 0 deletions sentry_sdk/integrations/boto3.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from typing import Type

try:
from botocore import __version__ as BOTOCORE_VERSION # type: ignore
from botocore.client import BaseClient # type: ignore
from botocore.response import StreamingBody # type: ignore
from botocore.awsrequest import AWSRequest # type: ignore
Expand All @@ -27,6 +28,14 @@ class Boto3Integration(Integration):
@staticmethod
def setup_once():
# type: () -> None
try:
version = tuple(map(int, BOTOCORE_VERSION.split(".")[:3]))
except (ValueError, TypeError):
raise DidNotEnable(
"Unparsable botocore version: {}".format(BOTOCORE_VERSION)
)
if version < (1, 12):
raise DidNotEnable("Botocore 1.12 or newer is required.")
orig_init = BaseClient.__init__

def sentry_patched_init(self, *args, **kwargs):
Expand Down
7 changes: 6 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ envlist =

{py3.6,py3.7,py3.8}-chalice-{1.16,1.17,1.18,1.19,1.20}

{py2.7,py3.6,py3.7,py3.8}-boto3-{1.14,1.15,1.16}
{py2.7,py3.6,py3.7,py3.8}-boto3-{1.9,1.10,1.11,1.12,1.13,1.14,1.15,1.16}

[testenv]
deps =
Expand Down Expand Up @@ -234,6 +234,11 @@ deps =
chalice-1.20: chalice>=1.20.0,<1.21.0
chalice: pytest-chalice==0.0.5

boto3-1.9: boto3>=1.9,<1.10
boto3-1.10: boto3>=1.10,<1.11
boto3-1.11: boto3>=1.11,<1.12
boto3-1.12: boto3>=1.12,<1.13
boto3-1.13: boto3>=1.13,<1.14
boto3-1.14: boto3>=1.14,<1.15
boto3-1.15: boto3>=1.15,<1.16
boto3-1.16: boto3>=1.16,<1.17
Expand Down