From ba573e267c0601e97b7caafb7ac9ad4ec7c7d52d Mon Sep 17 00:00:00 2001 From: Sam Bull Date: Sat, 11 Feb 2023 00:09:40 +0000 Subject: [PATCH] [3.8] Fix CI (#7143) (#7200) --- .github/workflows/ci.yml | 24 ++++++++++++------------ .mypy.ini | 2 ++ aiohttp/helpers.py | 1 + tests/test_client_request.py | 4 ++-- tests/test_streams.py | 4 ++-- tests/test_web_app.py | 4 ++-- 6 files changed, 21 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 05f4eb33ec4..27a2e63215e 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 @@ -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 diff --git a/.mypy.ini b/.mypy.ini index 7e474fc0bab..a216570f5cf 100644 --- a/.mypy.ini +++ b/.mypy.ini @@ -1,4 +1,6 @@ [mypy] +# Only for 3.8 branch which is already EOL +ignore_errors = True files = aiohttp, examples check_untyped_defs = True follow_imports_for_stubs = True 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,