Skip to content

Commit

Permalink
feat(mypy): add mypy.init
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Brewer committed Jul 10, 2021
1 parent 0b97dd8 commit eff22cb
Show file tree
Hide file tree
Showing 12 changed files with 33 additions and 20 deletions.
2 changes: 1 addition & 1 deletion aws_lambda_powertools/logging/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import sys
from typing import IO, Any, Callable, Dict, Iterable, Optional, TypeVar, Union

import jmespath # type: ignore
import jmespath

from ..shared import constants
from ..shared.functions import resolve_env_var_choice, resolve_truthy_env_var_choice
Expand Down
2 changes: 1 addition & 1 deletion aws_lambda_powertools/shared/jmespath_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import gzip
import json

import jmespath # type: ignore
import jmespath


class PowertoolsFunctions(jmespath.functions.Functions):
Expand Down
4 changes: 2 additions & 2 deletions aws_lambda_powertools/utilities/batch/sqs.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import sys
from typing import Callable, Dict, List, Optional, Tuple

import boto3 # type: ignore
from botocore.config import Config # type: ignore
import boto3
from botocore.config import Config

from ...middleware_factory import lambda_handler_decorator
from .base import BasePartialProcessor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from typing import Any, Dict, List, Optional
from urllib.parse import unquote_plus

import boto3 # type: ignore
import boto3

from aws_lambda_powertools.utilities.data_classes.common import DictWrapper

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from types import MappingProxyType
from typing import Any, Dict, Optional

import jmespath # type: ignore
import jmespath

from aws_lambda_powertools.shared.cache_dict import LRUDict
from aws_lambda_powertools.shared.jmespath_functions import PowertoolsFunctions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import logging
from typing import Any, Dict, Optional

import boto3 # type: ignore
from botocore.config import Config # type: ignore
import boto3
from botocore.config import Config

from aws_lambda_powertools.utilities.idempotency import BasePersistenceLayer
from aws_lambda_powertools.utilities.idempotency.exceptions import (
Expand Down
4 changes: 2 additions & 2 deletions aws_lambda_powertools/utilities/parameters/appconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
from typing import Any, Dict, Optional, Union
from uuid import uuid4

import boto3 # type: ignore
from botocore.config import Config # type: ignore
import boto3
from botocore.config import Config

from ...shared import constants
from ...shared.functions import resolve_env_var_choice
Expand Down
6 changes: 3 additions & 3 deletions aws_lambda_powertools/utilities/parameters/dynamodb.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

from typing import Any, Dict, Optional

import boto3 # type: ignore
from boto3.dynamodb.conditions import Key # type: ignore
from botocore.config import Config # type: ignore
import boto3
from boto3.dynamodb.conditions import Key
from botocore.config import Config

from .base import BaseProvider

Expand Down
4 changes: 2 additions & 2 deletions aws_lambda_powertools/utilities/parameters/secrets.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

from typing import Any, Dict, Optional, Union

import boto3 # type: ignore
from botocore.config import Config # type: ignore
import boto3
from botocore.config import Config

from .base import DEFAULT_PROVIDERS, BaseProvider

Expand Down
4 changes: 2 additions & 2 deletions aws_lambda_powertools/utilities/parameters/ssm.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

from typing import Any, Dict, Optional, Union

import boto3 # type: ignore
from botocore.config import Config # type: ignore
import boto3
from botocore.config import Config

from .base import DEFAULT_MAX_AGE_SECS, DEFAULT_PROVIDERS, BaseProvider

Expand Down
6 changes: 3 additions & 3 deletions aws_lambda_powertools/utilities/validation/base.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import logging
from typing import Any, Dict, Optional, Union

import fastjsonschema # type: ignore
import jmespath # type: ignore
from jmespath.exceptions import LexerError # type: ignore
import fastjsonschema
import jmespath
from jmespath.exceptions import LexerError

from aws_lambda_powertools.shared.jmespath_functions import PowertoolsFunctions

Expand Down
13 changes: 13 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[mypy]
warn_return_any=False
warn_unused_configs=True
no_implicit_optional=True
warn_redundant_casts=True
warn_unused_ignores=True
pretty = True
show_column_numbers = True
show_error_codes = True
show_error_context = True

[mypy-jmespath]
ignore_missing_imports=True

0 comments on commit eff22cb

Please sign in to comment.