Skip to content

Commit b57f521

Browse files
chore(deps-dev): bump mypy from 1.1.1 to 1.2.0 (#2096)
* chore(deps-dev): bump mypy from 1.1.1 to 1.2.0 Bumps [mypy](https://github.com/python/mypy) from 1.1.1 to 1.2.0. - [Release notes](https://github.com/python/mypy/releases) - [Commits](python/mypy@v1.1.1...v1.2.0) --- updated-dependencies: - dependency-name: mypy dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * fix: types * fix: remove PickleBuffer Not supported on python 3.7 --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Ruben Fonseca <[email protected]>
1 parent 907c80d commit b57f521

File tree

3 files changed

+60
-33
lines changed

3 files changed

+60
-33
lines changed

Diff for: aws_lambda_powertools/utilities/streaming/_s3_seekable_io.py

+21-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,29 @@
11
import io
22
import logging
3-
from typing import IO, TYPE_CHECKING, AnyStr, Iterable, List, Optional, cast
3+
from typing import (
4+
IO,
5+
TYPE_CHECKING,
6+
Any,
7+
Iterable,
8+
List,
9+
Optional,
10+
Sequence,
11+
TypeVar,
12+
Union,
13+
cast,
14+
)
415

516
import boto3
617

718
from aws_lambda_powertools.utilities.streaming.compat import PowertoolsStreamingBody
819

920
if TYPE_CHECKING:
21+
from mmap import mmap
22+
1023
from mypy_boto3_s3 import Client
1124

25+
_CData = TypeVar("_CData")
26+
1227
logger = logging.getLogger(__name__)
1328

1429

@@ -177,8 +192,11 @@ def isatty(self) -> bool:
177192
def truncate(self, size: Optional[int] = 0) -> int:
178193
raise NotImplementedError("this stream is not writable")
179194

180-
def write(self, data: AnyStr) -> int:
195+
def write(self, data: Union[bytes, Union[bytearray, memoryview, Sequence[Any], "mmap", "_CData"]]) -> int:
181196
raise NotImplementedError("this stream is not writable")
182197

183-
def writelines(self, lines: Iterable[AnyStr]) -> None:
198+
def writelines(
199+
self,
200+
data: Iterable[Union[bytes, Union[bytearray, memoryview, Sequence[Any], "mmap", "_CData"]]],
201+
) -> None:
184202
raise NotImplementedError("this stream is not writable")

Diff for: aws_lambda_powertools/utilities/streaming/s3_object.py

+12-3
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44
from typing import (
55
IO,
66
TYPE_CHECKING,
7-
AnyStr,
7+
Any,
88
Iterable,
99
List,
1010
Optional,
1111
Sequence,
12+
TypeVar,
13+
Union,
1214
cast,
1315
overload,
1416
)
@@ -26,8 +28,12 @@
2628
)
2729

2830
if TYPE_CHECKING:
31+
from mmap import mmap
32+
2933
from mypy_boto3_s3 import Client
3034

35+
_CData = TypeVar("_CData")
36+
3137

3238
# Maintenance: almost all this logic should be moved to a base class
3339
class S3Object(IO[bytes]):
@@ -252,8 +258,11 @@ def isatty(self) -> bool:
252258
def truncate(self, size: Optional[int] = 0) -> int:
253259
raise NotImplementedError("this stream is not writable")
254260

255-
def write(self, data: AnyStr) -> int:
261+
def write(self, data: Union[bytes, Union[bytearray, memoryview, Sequence[Any], "mmap", "_CData"]]) -> int:
256262
raise NotImplementedError("this stream is not writable")
257263

258-
def writelines(self, lines: Iterable[AnyStr]) -> None:
264+
def writelines(
265+
self,
266+
data: Iterable[Union[bytes, Union[bytearray, memoryview, Sequence[Any], "mmap", "_CData"]]],
267+
) -> None:
259268
raise NotImplementedError("this stream is not writable")

Diff for: poetry.lock

+27-27
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)