From 9fdf07df0e58c91d73c211927b22d1c873aea8f7 Mon Sep 17 00:00:00 2001 From: Sam Bull Date: Mon, 23 Dec 2024 15:27:58 +0000 Subject: [PATCH 1/5] Revert incorrect typing changes --- aiohttp/http_parser.py | 1 - 1 file changed, 1 deletion(-) diff --git a/aiohttp/http_parser.py b/aiohttp/http_parser.py index d44f4cb12f1..bb78aea2fcd 100644 --- a/aiohttp/http_parser.py +++ b/aiohttp/http_parser.py @@ -670,7 +670,6 @@ def feed_data( ) -> Tuple[List[Tuple[RawResponseMessage, StreamReader]], bool, bytes]: if SEP is None: SEP = b"\r\n" if DEBUG else b"\n" - assert SEP is not None return super().feed_data(data, SEP, *args, **kwargs) def parse_message(self, lines: List[bytes]) -> RawResponseMessage: From 46182c66c7246452b53f9271c92e07254254a52a Mon Sep 17 00:00:00 2001 From: Sam Bull Date: Mon, 23 Dec 2024 15:29:55 +0000 Subject: [PATCH 2/5] Update web_protocol.py --- aiohttp/web_protocol.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aiohttp/web_protocol.py b/aiohttp/web_protocol.py index 3d76fc1f1d7..3810ca9cb81 100644 --- a/aiohttp/web_protocol.py +++ b/aiohttp/web_protocol.py @@ -583,7 +583,7 @@ async def start(self) -> None: else: task = loop.create_task(coro) try: - resp, reset = await task # type: ignore[possibly-undefined] + resp, reset = await task except ConnectionError: self.log_debug("Ignored premature client disconnection") break From 8095364c594b9f405bdf1671f002ba142b7c8ad5 Mon Sep 17 00:00:00 2001 From: Sam Bull Date: Mon, 23 Dec 2024 15:30:24 +0000 Subject: [PATCH 3/5] Update web_protocol.py --- aiohttp/web_protocol.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aiohttp/web_protocol.py b/aiohttp/web_protocol.py index 3810ca9cb81..221b03bb48b 100644 --- a/aiohttp/web_protocol.py +++ b/aiohttp/web_protocol.py @@ -589,7 +589,7 @@ async def start(self) -> None: break # Drop the processed task from asyncio.Task.all_tasks() early - del task # type: ignore[possibly-undefined] + del task # https://github.com/python/mypy/issues/14309 if reset: # type: ignore[possibly-undefined] self.log_debug("Ignored premature client disconnection 2") From 9330546b23de0e88fdb31cc5de114715ac19ba72 Mon Sep 17 00:00:00 2001 From: Sam Bull Date: Mon, 23 Dec 2024 15:31:15 +0000 Subject: [PATCH 4/5] Update ci-cd.yml --- .github/workflows/ci-cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 2ebc795ef22..d31ce5164e7 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -49,7 +49,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v5 with: - python-version: 3.13 + python-version: 3.11 - name: Cache PyPI uses: actions/cache@v4.2.0 with: From 6eed0f09c6081c64d4ffd8217e71256e4703745d Mon Sep 17 00:00:00 2001 From: Sam Bull Date: Wed, 25 Dec 2024 21:40:23 +0000 Subject: [PATCH 5/5] Update .mypy.ini --- .mypy.ini | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.mypy.ini b/.mypy.ini index 4a1333c4704..54efdae5bad 100644 --- a/.mypy.ini +++ b/.mypy.ini @@ -11,8 +11,9 @@ disallow_untyped_calls = True disallow_untyped_decorators = True disallow_untyped_defs = True # TODO(PY312): explicit-override -enable_error_code = ignore-without-code, possibly-undefined, redundant-expr, redundant-self, truthy-bool, truthy-iterable, unused-awaitable +enable_error_code = deprecated, ignore-without-code, possibly-undefined, redundant-expr, redundant-self, truthy-bool, truthy-iterable, unused-awaitable extra_checks = True +follow_untyped_imports = True implicit_reexport = False no_implicit_optional = True pretty = True