Skip to content

docs(examples): enforce and fix all mypy errors #1393

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 26 commits into from
Jul 28, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
53ad2ed
chore(mypy): fix redef _
heitorlessa Jul 28, 2022
ab10966
fix(tracer): correct ctx manager and default provider type
heitorlessa Jul 28, 2022
c55a9c1
chore(mypy): add requests type def as dev dep
heitorlessa Jul 28, 2022
3ba9e8a
chore(mypy): ignore lack of botocore types
heitorlessa Jul 28, 2022
f905451
chore(mypy): ignore lack of orjson types
heitorlessa Jul 28, 2022
6c24df6
chore(example): fix constructor default
heitorlessa Jul 28, 2022
23b5179
chore(mypy): ignore sentinel value assignment; needs issue
heitorlessa Jul 28, 2022
91ead7f
docs(examples): fix incorrect type response and Response class
heitorlessa Jul 28, 2022
15b6351
chore(mypy): fix potential none operator
heitorlessa Jul 28, 2022
ff5ec56
chore(mypy): fix return type on graphql merchant
heitorlessa Jul 28, 2022
6718279
chore(mypy): fix missing return
heitorlessa Jul 28, 2022
3ae1575
chore(mypy): ignore sentinel type, missing return
heitorlessa Jul 28, 2022
fe713c3
chore(mypy): ignore present attr defined in custom model; note for te…
heitorlessa Jul 28, 2022
306bfd3
chore(mypy): fix import and type annotation on async graphql
heitorlessa Jul 28, 2022
f1d1ff3
chore(mypy): fix coroutine response not being ready to subscribe
heitorlessa Jul 28, 2022
a9e7ca5
chore(ci): ensure mypy runs on examples
heitorlessa Jul 28, 2022
3135117
chore(mypy): address leftovers
heitorlessa Jul 28, 2022
bb583f4
chore(mypy): use backward compatible List annotation
heitorlessa Jul 28, 2022
cf29df7
chore(mypy): use backward compatible List annotation
heitorlessa Jul 28, 2022
d0ede58
Merge branch 'docs/examples-mypy' of https://github.com/heitorlessa/a…
heitorlessa Jul 28, 2022
cb791a4
chore(mypy): add typing_extensions, 3.6 3.7 compatible changes
heitorlessa Jul 28, 2022
1cbf580
docs(examples): fix highlighting due to backwards compatible typedict…
heitorlessa Jul 28, 2022
5004034
chore: leftover from rebase
heitorlessa Jul 28, 2022
0fd0820
Merge branch 'develop' of https://github.com/awslabs/aws-lambda-power…
heitorlessa Jul 28, 2022
d3d196e
chore(mypy): add leftover assignment ignore
heitorlessa Jul 28, 2022
4a98d0e
Revert "chore(mypy): add leftover assignment ignore"
heitorlessa Jul 28, 2022
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
Prev Previous commit
Next Next commit
chore(mypy): address leftovers
  • Loading branch information
heitorlessa committed Jul 28, 2022
commit 31351175798084febbf43e9070168a12050d9c89
8 changes: 4 additions & 4 deletions aws_lambda_powertools/tracing/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import numbers
import traceback
from contextlib import contextmanager
from typing import Any, Generator, List, NoReturn, Optional, Set, Union
from typing import Any, Generator, List, NoReturn, Optional, Sequence, Union


class BaseSegment(abc.ABC):
Expand Down Expand Up @@ -74,7 +74,7 @@ def add_exception(self, exception: BaseException, stack: List[traceback.StackSum


class BaseProvider(abc.ABC):
@abc.abstractmethod # type: ignore
@abc.abstractmethod
@contextmanager
def in_subsegment(self, name=None, **kwargs) -> Generator[BaseSegment, None, None]:
"""Return a subsegment context manger.
Expand All @@ -87,7 +87,7 @@ def in_subsegment(self, name=None, **kwargs) -> Generator[BaseSegment, None, Non
Optional parameters to be propagated to segment
"""

@abc.abstractmethod # type: ignore
@abc.abstractmethod
@contextmanager
def in_subsegment_async(self, name=None, **kwargs) -> Generator[BaseSegment, None, None]:
"""Return a subsegment async context manger.
Expand Down Expand Up @@ -131,7 +131,7 @@ def put_metadata(self, key: str, value: Any, namespace: str = "default") -> NoRe
"""

@abc.abstractmethod
def patch(self, modules: Set[str]) -> NoReturn:
def patch(self, modules: Sequence[str]) -> NoReturn:
"""Instrument a set of supported libraries

Parameters
Expand Down
3 changes: 3 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,6 @@ ignore_missing_imports = True

[mypy-orjson]
ignore_missing_imports = True

[mypy-aiohttp]
ignore_missing_imports = True