Skip to content

Commit cb791a4

Browse files
committed
chore(mypy): add typing_extensions, 3.6 3.7 compatible changes
1 parent d0ede58 commit cb791a4

11 files changed

+79
-16
lines changed

examples/event_handler_graphql/src/assert_async_graphql_response_module.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1+
import sys
2+
3+
if sys.version_info >= (3, 8):
4+
from typing import TypedDict
5+
else:
6+
from typing_extensions import TypedDict
7+
18
import asyncio
2-
from typing import List, TypedDict
9+
from typing import List
310

411
import aiohttp
512

examples/event_handler_graphql/src/assert_graphql_response_module.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
from typing import List, TypedDict
1+
import sys
2+
3+
if sys.version_info >= (3, 8):
4+
from typing import TypedDict
5+
else:
6+
from typing_extensions import TypedDict
7+
8+
from typing import List
29

310
from aws_lambda_powertools import Logger, Tracer
411
from aws_lambda_powertools.event_handler import AppSyncResolver

examples/event_handler_graphql/src/async_resolvers.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
import asyncio
2-
from typing import List, TypedDict
2+
import sys
3+
4+
if sys.version_info >= (3, 8):
5+
from typing import TypedDict
6+
else:
7+
from typing_extensions import TypedDict
8+
9+
from typing import List
310

411
import aiohttp
512

examples/event_handler_graphql/src/custom_models.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
from typing import List, TypedDict
1+
import sys
2+
3+
if sys.version_info >= (3, 8):
4+
from typing import TypedDict
5+
else:
6+
from typing_extensions import TypedDict
7+
8+
from typing import List
29

310
from aws_lambda_powertools import Logger, Tracer
411
from aws_lambda_powertools.event_handler import AppSyncResolver

examples/event_handler_graphql/src/getting_started_graphql_api_resolver.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
from typing import List, TypedDict
1+
import sys
2+
3+
if sys.version_info >= (3, 8):
4+
from typing import TypedDict
5+
else:
6+
from typing_extensions import TypedDict
7+
8+
from typing import List
29

310
import requests
411
from requests import Response

examples/event_handler_graphql/src/graphql_transformer_merchant_info.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
from typing import List, TypedDict
1+
import sys
2+
3+
if sys.version_info >= (3, 8):
4+
from typing import TypedDict
5+
else:
6+
from typing_extensions import TypedDict
7+
8+
from typing import List
29

310
from aws_lambda_powertools import Logger, Tracer
411
from aws_lambda_powertools.event_handler import AppSyncResolver

examples/event_handler_graphql/src/graphql_transformer_search_merchant.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
from typing import List, TypedDict
1+
import sys
2+
3+
if sys.version_info >= (3, 8):
4+
from typing import TypedDict
5+
else:
6+
from typing_extensions import TypedDict
7+
8+
from typing import List
29

310
from aws_lambda_powertools import Logger, Tracer
411
from aws_lambda_powertools.event_handler import AppSyncResolver

examples/event_handler_graphql/src/nested_mappings.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
from typing import List, TypedDict
1+
import sys
2+
3+
if sys.version_info >= (3, 8):
4+
from typing import TypedDict
5+
else:
6+
from typing_extensions import TypedDict
7+
8+
from typing import List
29

310
from aws_lambda_powertools import Logger, Tracer
411
from aws_lambda_powertools.event_handler import AppSyncResolver

examples/event_handler_graphql/src/split_operation_module.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
from typing import List, TypedDict
1+
import sys
2+
3+
if sys.version_info >= (3, 8):
4+
from typing import TypedDict
5+
else:
6+
from typing_extensions import TypedDict
7+
8+
from typing import List
29

310
from aws_lambda_powertools import Logger, Tracer
411
from aws_lambda_powertools.event_handler.appsync import Router

poetry.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ mypy-boto3-cloudwatch = "^1.24.35"
6767
mypy-boto3-lambda = "^1.24.0"
6868
mypy-boto3-xray = "^1.24.0"
6969
types-requests = "^2.28.5"
70-
70+
typing-extensions = { version = "^4.3.0", python = ">=3.7" }
7171

7272
[tool.poetry.extras]
7373
pydantic = ["pydantic", "email-validator"]

0 commit comments

Comments
 (0)