From 0c6eb017d450b633b29b9c259e91484aef21c4ee Mon Sep 17 00:00:00 2001 From: Eduard Iskandarov Date: Wed, 13 Jan 2021 12:07:59 +0500 Subject: [PATCH 1/4] =?UTF-8?q?=E2=9E=95=20add=20awslambdaric=20deps=20for?= =?UTF-8?q?=20type=20checking?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- requirements.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/requirements.txt b/requirements.txt index 12a49bba..139c326f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,6 +9,8 @@ moto mypy brotli brotli-asgi +awslambdaric +awslambdaric-stubs # Docs mkdocs mkdocs-material \ No newline at end of file From 60b769af3b1c672828dd37abd2a078c4e424a244 Mon Sep 17 00:00:00 2001 From: Eduard Iskandarov Date: Wed, 13 Jan 2021 12:09:19 +0500 Subject: [PATCH 2/4] =?UTF-8?q?=F0=9F=8F=B7=EF=B8=8F=20add=20type=20hints?= =?UTF-8?q?=20for=20lambda=20context=20in=20handler?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mangum/adapter.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mangum/adapter.py b/mangum/adapter.py index 61fb4293..cd5d9831 100644 --- a/mangum/adapter.py +++ b/mangum/adapter.py @@ -11,6 +11,8 @@ from mangum.protocols.http import HTTPCycle from mangum.exceptions import ConfigurationError +if typing.TYPE_CHECKING: + from awslambdaric.lambda_context import LambdaContext DEFAULT_TEXT_MIME_TYPES = [ "application/json", @@ -79,7 +81,7 @@ def __post_init__(self, text_mime_types: typing.Optional[typing.List[str]]) -> N text_mime_types = DEFAULT_TEXT_MIME_TYPES self.text_mime_types = text_mime_types - def __call__(self, event: dict, context: dict) -> dict: + def __call__(self, event: dict, context: "LambdaContext") -> dict: self.logger.debug("Event received.") with ExitStack() as stack: From 9a15d1ce2cf2a74007f3548940319b6a42d7199e Mon Sep 17 00:00:00 2001 From: Eduard Iskandarov Date: Wed, 13 Jan 2021 12:16:19 +0500 Subject: [PATCH 3/4] =?UTF-8?q?=E2=9C=85=20exclude=20typing=20code=20from?= =?UTF-8?q?=20coverage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mangum/adapter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mangum/adapter.py b/mangum/adapter.py index cd5d9831..9d67486d 100644 --- a/mangum/adapter.py +++ b/mangum/adapter.py @@ -11,7 +11,7 @@ from mangum.protocols.http import HTTPCycle from mangum.exceptions import ConfigurationError -if typing.TYPE_CHECKING: +if typing.TYPE_CHECKING: # pragma: no cover from awslambdaric.lambda_context import LambdaContext DEFAULT_TEXT_MIME_TYPES = [ From fe72ca70641b60d67c4b4c60cff0687e07c56478 Mon Sep 17 00:00:00 2001 From: Eduard Iskandarov Date: Fri, 26 Feb 2021 15:10:35 +0500 Subject: [PATCH 4/4] =?UTF-8?q?=E2=9E=96=20remove=20redundant=20awslambdar?= =?UTF-8?q?ic=20dependency?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- requirements.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index 139c326f..82ef74e7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,8 +9,7 @@ moto mypy brotli brotli-asgi -awslambdaric awslambdaric-stubs # Docs mkdocs -mkdocs-material \ No newline at end of file +mkdocs-material