From 7100e743089672166bc9560cf1ee49c31920ea48 Mon Sep 17 00:00:00 2001 From: Sam Bull Date: Mon, 26 Dec 2022 14:42:56 +0000 Subject: [PATCH 01/10] [3.9] Fix CI (#7143) (cherry picked from commit c919bfa616ed2fe412ffb0e2f5dcefae993436f8) --- .github/workflows/ci.yml | 4 ++-- aiohttp/helpers.py | 1 + tests/test_client_request.py | 4 ++-- tests/test_streams.py | 4 ++-- tests/test_web_app.py | 4 ++-- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 05f4eb33ec4..0849d2547c3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -59,9 +59,9 @@ jobs: - name: Run linters run: | make mypy - - name: Install libenchant-dev + - name: Install libenchant run: | - sudo apt install libenchant-dev + sudo apt install libenchant-2-dev - name: Install spell checker run: | pip install -r requirements/doc-spelling.txt -c requirements/constraints.txt diff --git a/aiohttp/helpers.py b/aiohttp/helpers.py index 0469ee41de5..874ab1ac076 100644 --- a/aiohttp/helpers.py +++ b/aiohttp/helpers.py @@ -62,6 +62,7 @@ PY_37 = sys.version_info >= (3, 7) PY_38 = sys.version_info >= (3, 8) PY_310 = sys.version_info >= (3, 10) +PY_311 = sys.version_info >= (3, 11) if sys.version_info < (3, 7): import idna_ssl diff --git a/tests/test_client_request.py b/tests/test_client_request.py index c822d0c0206..ea4ebb4af10 100644 --- a/tests/test_client_request.py +++ b/tests/test_client_request.py @@ -19,7 +19,7 @@ Fingerprint, _merge_ssl_params, ) -from aiohttp.helpers import PY_310 +from aiohttp.helpers import PY_311 from aiohttp.test_utils import make_mocked_coro @@ -276,7 +276,7 @@ def test_host_header_ipv6_with_port(make_request) -> None: @pytest.mark.xfail( - PY_310, + PY_311, reason="No idea why ClientRequest() is constructed out of loop but " "it calls `asyncio.get_event_loop()`", raises=DeprecationWarning, diff --git a/tests/test_streams.py b/tests/test_streams.py index 5ddc4c94ddc..23f159a0e3b 100644 --- a/tests/test_streams.py +++ b/tests/test_streams.py @@ -12,7 +12,7 @@ from re_assert import Matches from aiohttp import streams -from aiohttp.helpers import PY_310 +from aiohttp.helpers import PY_311 DATA = b"line1\nline2\nline3\n" @@ -84,7 +84,7 @@ async def test_create_waiter(self) -> None: await stream._wait("test") @pytest.mark.xfail( - PY_310, + PY_311, reason="No idea why ClientRequest() is constructed out of loop but " "it calls `asyncio.get_event_loop()`", raises=DeprecationWarning, diff --git a/tests/test_web_app.py b/tests/test_web_app.py index 7501fba032b..165b3776cef 100644 --- a/tests/test_web_app.py +++ b/tests/test_web_app.py @@ -6,7 +6,7 @@ from aiohttp import log, web from aiohttp.abc import AbstractAccessLogger, AbstractRouter -from aiohttp.helpers import DEBUG, PY_36, PY_310 +from aiohttp.helpers import DEBUG, PY_36, PY_311 from aiohttp.test_utils import make_mocked_coro from aiohttp.typedefs import Handler @@ -40,7 +40,7 @@ async def test_set_loop() -> None: @pytest.mark.xfail( - PY_310, + PY_311, reason="No idea why _set_loop() is constructed out of loop " "but it calls `asyncio.get_event_loop()`", raises=DeprecationWarning, From c1f500b02cbc3b6afe071ec130ed6c18753aa227 Mon Sep 17 00:00:00 2001 From: Sam Bull Date: Fri, 10 Feb 2023 23:14:56 +0000 Subject: [PATCH 02/10] Update ci.yml --- .github/workflows/ci.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0849d2547c3..27a2e63215e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -119,36 +119,36 @@ jobs: matrix: pyver: [3.6, 3.7, 3.8, 3.9, '3.10'] no-extensions: ['', 'Y'] - os: [ubuntu, macos, windows] + os: [ubuntu-20.04, macos-latest, windows-latest] exclude: - - os: macos + - os: macos-latest no-extensions: 'Y' - - os: macos + - os: macos-latest pyver: 3.7 - - os: macos + - os: macos-latest pyver: 3.8 - - os: windows + - os: windows-latest no-extensions: 'Y' experimental: [false] include: - pyver: pypy-3.8 no-extensions: 'Y' - os: ubuntu + os: ubuntu-latest experimental: false - - os: macos + - os: macos-latest pyver: "3.11.0-alpha - 3.11.0" experimental: true no-extensions: 'Y' - - os: ubuntu + - os: ubuntu-latest pyver: "3.11.0-alpha - 3.11.0" experimental: false no-extensions: 'Y' - - os: windows + - os: windows-latest pyver: "3.11.0-alpha - 3.11.0" experimental: true no-extensions: 'Y' fail-fast: true - runs-on: ${{ matrix.os }}-latest + runs-on: ${{ matrix.os }} continue-on-error: ${{ matrix.experimental }} steps: - name: Checkout From c0f8283ecff645aa8d08e8d13ee83b7819a10d01 Mon Sep 17 00:00:00 2001 From: Sam Bull Date: Fri, 10 Feb 2023 23:21:46 +0000 Subject: [PATCH 03/10] Update constraints.txt --- requirements/constraints.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/constraints.txt b/requirements/constraints.txt index 21b22332a27..204c9fc03ad 100644 --- a/requirements/constraints.txt +++ b/requirements/constraints.txt @@ -116,7 +116,7 @@ multidict==5.2.0 # via # -r requirements/multidict.txt # yarl -mypy==0.910 ; implementation_name == "cpython" +mypy==1.0.0 ; implementation_name == "cpython" # via # -r requirements/lint.txt # -r requirements/test.txt From 890016c74853e91997aac031cd28ae866f612d89 Mon Sep 17 00:00:00 2001 From: Sam Bull Date: Fri, 10 Feb 2023 23:22:02 +0000 Subject: [PATCH 04/10] Update lint.txt --- requirements/lint.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/lint.txt b/requirements/lint.txt index 541b373c7d2..a3b63bd67a8 100644 --- a/requirements/lint.txt +++ b/requirements/lint.txt @@ -1,4 +1,4 @@ -r typing-extensions.txt -mypy==0.910; implementation_name=="cpython" +mypy==1.0.0; implementation_name=="cpython" pre-commit==2.16.0 pytest==6.2.5 From 726e9698fd958f5685c5e65397eb5e1e5866076c Mon Sep 17 00:00:00 2001 From: Sam Bull Date: Fri, 10 Feb 2023 23:22:26 +0000 Subject: [PATCH 05/10] Update test.txt --- requirements/test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/test.txt b/requirements/test.txt index 7d2323af949..2422f6f3d0d 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -4,7 +4,7 @@ coverage==6.2; python_version < "3.7" coverage==6.4.2; python_version >= "3.7" cryptography==36.0.0; platform_machine!="i686" # no 32-bit wheels; no python 3.9 wheels yet freezegun==1.1.0 -mypy==0.910; implementation_name=="cpython" +mypy==1.0.0; implementation_name=="cpython" mypy-extensions==0.4.3; implementation_name=="cpython" proxy.py ~= 2.4.4rc3 pytest==6.2.5 From 7bc4dce5824cbfae2b43fba91b238054c34e1fcd Mon Sep 17 00:00:00 2001 From: Sam Bull Date: Fri, 10 Feb 2023 23:26:23 +0000 Subject: [PATCH 06/10] Update .mypy.ini --- .mypy.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/.mypy.ini b/.mypy.ini index 7e474fc0bab..b97c3cd58cd 100644 --- a/.mypy.ini +++ b/.mypy.ini @@ -1,4 +1,5 @@ [mypy] +ignore_errors = True # Only for 3.8 branch which is already EOL files = aiohttp, examples check_untyped_defs = True follow_imports_for_stubs = True From 439165338a56e64e1ae1d4a8bd63b659d0d3e41a Mon Sep 17 00:00:00 2001 From: Sam Bull Date: Fri, 10 Feb 2023 23:30:03 +0000 Subject: [PATCH 07/10] Update .mypy.ini --- .mypy.ini | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.mypy.ini b/.mypy.ini index b97c3cd58cd..a216570f5cf 100644 --- a/.mypy.ini +++ b/.mypy.ini @@ -1,5 +1,6 @@ [mypy] -ignore_errors = True # Only for 3.8 branch which is already EOL +# Only for 3.8 branch which is already EOL +ignore_errors = True files = aiohttp, examples check_untyped_defs = True follow_imports_for_stubs = True From 469931c90012ae8192ce882982d88256a73bdff5 Mon Sep 17 00:00:00 2001 From: Sam Bull Date: Fri, 10 Feb 2023 23:31:14 +0000 Subject: [PATCH 08/10] Update constraints.txt --- requirements/constraints.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/constraints.txt b/requirements/constraints.txt index 204c9fc03ad..21b22332a27 100644 --- a/requirements/constraints.txt +++ b/requirements/constraints.txt @@ -116,7 +116,7 @@ multidict==5.2.0 # via # -r requirements/multidict.txt # yarl -mypy==1.0.0 ; implementation_name == "cpython" +mypy==0.910 ; implementation_name == "cpython" # via # -r requirements/lint.txt # -r requirements/test.txt From d723d82a13a2ae52d414f2ec332ccbcbc30e1b97 Mon Sep 17 00:00:00 2001 From: Sam Bull Date: Fri, 10 Feb 2023 23:31:40 +0000 Subject: [PATCH 09/10] Update test.txt --- requirements/test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/test.txt b/requirements/test.txt index 2422f6f3d0d..7d2323af949 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -4,7 +4,7 @@ coverage==6.2; python_version < "3.7" coverage==6.4.2; python_version >= "3.7" cryptography==36.0.0; platform_machine!="i686" # no 32-bit wheels; no python 3.9 wheels yet freezegun==1.1.0 -mypy==1.0.0; implementation_name=="cpython" +mypy==0.910; implementation_name=="cpython" mypy-extensions==0.4.3; implementation_name=="cpython" proxy.py ~= 2.4.4rc3 pytest==6.2.5 From 83ec83c264162dbec6647d12557cd02d3761d5ac Mon Sep 17 00:00:00 2001 From: Sam Bull Date: Fri, 10 Feb 2023 23:32:02 +0000 Subject: [PATCH 10/10] Update lint.txt --- requirements/lint.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/lint.txt b/requirements/lint.txt index a3b63bd67a8..541b373c7d2 100644 --- a/requirements/lint.txt +++ b/requirements/lint.txt @@ -1,4 +1,4 @@ -r typing-extensions.txt -mypy==1.0.0; implementation_name=="cpython" +mypy==0.910; implementation_name=="cpython" pre-commit==2.16.0 pytest==6.2.5