From: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Mar 2023 17:53:54 +0000 (-0600) Subject: Bump mypy from 0.982 to 1.0.1 (#2611) X-Git-Tag: 0.24.0~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6779fae5eeab56575358c47e30e7d3913a09c18b;p=thirdparty%2Fhttpx.git Bump mypy from 0.982 to 1.0.1 (#2611) * Bump mypy from 0.982 to 1.0.1 Bumps [mypy](https://github.com/python/mypy) from 0.982 to 1.0.1. - [Release notes](https://github.com/python/mypy/releases) - [Commits](https://github.com/python/mypy/compare/v0.982...v1.0.1) --- updated-dependencies: - dependency-name: mypy dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * Remove unused ignores for mypy-1.0.1 --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Michael Adkins --- diff --git a/httpx/_content.py b/httpx/_content.py index 1c450b75..b16e12d9 100644 --- a/httpx/_content.py +++ b/httpx/_content.py @@ -54,10 +54,10 @@ class IteratorByteStream(SyncByteStream): self._is_stream_consumed = True if hasattr(self._stream, "read"): # File-like interfaces should use 'read' directly. - chunk = self._stream.read(self.CHUNK_SIZE) # type: ignore + chunk = self._stream.read(self.CHUNK_SIZE) while chunk: yield chunk - chunk = self._stream.read(self.CHUNK_SIZE) # type: ignore + chunk = self._stream.read(self.CHUNK_SIZE) else: # Otherwise iterate. for part in self._stream: @@ -79,10 +79,10 @@ class AsyncIteratorByteStream(AsyncByteStream): self._is_stream_consumed = True if hasattr(self._stream, "aread"): # File-like interfaces should use 'aread' directly. - chunk = await self._stream.aread(self.CHUNK_SIZE) # type: ignore + chunk = await self._stream.aread(self.CHUNK_SIZE) while chunk: yield chunk - chunk = await self._stream.aread(self.CHUNK_SIZE) # type: ignore + chunk = await self._stream.aread(self.CHUNK_SIZE) else: # Otherwise iterate. async for part in self._stream: @@ -107,7 +107,6 @@ class UnattachedStream(AsyncByteStream, SyncByteStream): def encode_content( content: Union[str, bytes, Iterable[bytes], AsyncIterable[bytes]] ) -> Tuple[Dict[str, str], Union[SyncByteStream, AsyncByteStream]]: - if isinstance(content, (bytes, str)): body = content.encode("utf-8") if isinstance(content, str) else content content_length = len(body) diff --git a/httpx/_transports/default.py b/httpx/_transports/default.py index dfd274e7..fca7de98 100644 --- a/httpx/_transports/default.py +++ b/httpx/_transports/default.py @@ -106,7 +106,7 @@ class ResponseStream(SyncByteStream): def close(self) -> None: if hasattr(self._httpcore_stream, "close"): - self._httpcore_stream.close() # type: ignore + self._httpcore_stream.close() class HTTPTransport(BaseTransport): @@ -241,7 +241,7 @@ class AsyncResponseStream(AsyncByteStream): async def aclose(self) -> None: if hasattr(self._httpcore_stream, "aclose"): - await self._httpcore_stream.aclose() # type: ignore + await self._httpcore_stream.aclose() class AsyncHTTPTransport(AsyncBaseTransport): diff --git a/requirements.txt b/requirements.txt index ea096679..0dff922f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -29,7 +29,7 @@ flake8-pie==0.16.0; python_version>='3.7' importlib-metadata==4.13.0; python_version>='3.7' isort==5.11.4; python_version<'3.8' isort==5.12.0; python_version>='3.8' -mypy==0.982 +mypy==1.0.1 types-certifi==2021.10.8.2 pytest==7.2.1 trio==0.22.0