Skip to content

Commit

Permalink
chore(deps-dev): bump mypy from 1.1.1 to 1.2.0 (#2096)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
dependabot[bot] and rubenfonseca authored Apr 11, 2023
1 parent 907c80d commit b57f521
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 33 deletions.
24 changes: 21 additions & 3 deletions aws_lambda_powertools/utilities/streaming/_s3_seekable_io.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,29 @@
import io
import logging
from typing import IO, TYPE_CHECKING, AnyStr, Iterable, List, Optional, cast
from typing import (
IO,
TYPE_CHECKING,
Any,
Iterable,
List,
Optional,
Sequence,
TypeVar,
Union,
cast,
)

import boto3

from aws_lambda_powertools.utilities.streaming.compat import PowertoolsStreamingBody

if TYPE_CHECKING:
from mmap import mmap

from mypy_boto3_s3 import Client

_CData = TypeVar("_CData")

logger = logging.getLogger(__name__)


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

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

def writelines(self, lines: Iterable[AnyStr]) -> None:
def writelines(
self,
data: Iterable[Union[bytes, Union[bytearray, memoryview, Sequence[Any], "mmap", "_CData"]]],
) -> None:
raise NotImplementedError("this stream is not writable")
15 changes: 12 additions & 3 deletions aws_lambda_powertools/utilities/streaming/s3_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
from typing import (
IO,
TYPE_CHECKING,
AnyStr,
Any,
Iterable,
List,
Optional,
Sequence,
TypeVar,
Union,
cast,
overload,
)
Expand All @@ -26,8 +28,12 @@
)

if TYPE_CHECKING:
from mmap import mmap

from mypy_boto3_s3 import Client

_CData = TypeVar("_CData")


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

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

def writelines(self, lines: Iterable[AnyStr]) -> None:
def writelines(
self,
data: Iterable[Union[bytes, Union[bytearray, memoryview, Sequence[Any], "mmap", "_CData"]]],
) -> None:
raise NotImplementedError("this stream is not writable")
54 changes: 27 additions & 27 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b57f521

Please sign in to comment.