Update python version used for pylint [Py310] (#86414)
* Update python version used for pylint linting [Py310] * Import Callable from collections.abc [Py310] * Use builtin anext [Py310]
This commit is contained in:
parent
45b4b0e990
commit
d7dda6bee5
11 changed files with 18 additions and 20 deletions
|
@ -2,11 +2,9 @@
|
|||
from __future__ import annotations
|
||||
|
||||
import asyncio
|
||||
from collections.abc import Callable
|
||||
import logging
|
||||
|
||||
# Issue with Python 3.9.0 and 3.9.1 with collections.abc.Callable
|
||||
# https://bugs.python.org/issue42965
|
||||
from typing import Any, Callable, NamedTuple, Optional
|
||||
from typing import Any, NamedTuple, Optional
|
||||
|
||||
from homeassistant.core import CALLBACK_TYPE, HomeAssistant, callback
|
||||
|
||||
|
|
|
@ -153,7 +153,7 @@ class KNXCommonFlow(ABC, FlowHandler):
|
|||
# keep a reference to the generator to scan in background until user selects a connection type
|
||||
self._async_scan_gen = self._gatewayscanner.async_scan()
|
||||
try:
|
||||
await self._async_scan_gen.__anext__()
|
||||
await anext(self._async_scan_gen)
|
||||
except StopAsyncIteration:
|
||||
pass # scan finished, no interfaces discovered
|
||||
else:
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
"""Support for MQTT message handling."""
|
||||
# pylint: disable=deprecated-typing-alias
|
||||
# In Python 3.9.0 and 3.9.1 collections.abc.Callable
|
||||
# can't be used inside typing.Union or typing.Optional
|
||||
from __future__ import annotations
|
||||
|
||||
import asyncio
|
||||
from collections.abc import Coroutine, Iterable
|
||||
from collections.abc import Callable, Coroutine, Iterable
|
||||
from functools import lru_cache, partial, wraps
|
||||
import inspect
|
||||
from itertools import groupby
|
||||
|
@ -13,7 +10,7 @@ import logging
|
|||
from operator import attrgetter
|
||||
import ssl
|
||||
import time
|
||||
from typing import TYPE_CHECKING, Any, Callable, Union, cast
|
||||
from typing import TYPE_CHECKING, Any, Union, cast
|
||||
import uuid
|
||||
|
||||
import attr
|
||||
|
|
|
@ -92,7 +92,7 @@ forced_separate = [
|
|||
combine_as_imports = true
|
||||
|
||||
[tool.pylint.MAIN]
|
||||
py-version = "3.9"
|
||||
py-version = "3.10"
|
||||
ignore = [
|
||||
"tests",
|
||||
]
|
||||
|
@ -164,6 +164,9 @@ good-names = [
|
|||
# Enable once current issues are fixed:
|
||||
# consider-using-namedtuple-or-dataclass (Pylint CodeStyle extension)
|
||||
# consider-using-assignment-expr (Pylint CodeStyle extension)
|
||||
# ---
|
||||
# Temporary for the Python 3.10 update
|
||||
# consider-alternative-union-syntax
|
||||
disable = [
|
||||
"format",
|
||||
"abstract-method",
|
||||
|
@ -188,6 +191,7 @@ disable = [
|
|||
"consider-using-f-string",
|
||||
"consider-using-namedtuple-or-dataclass",
|
||||
"consider-using-assignment-expr",
|
||||
"consider-alternative-union-syntax",
|
||||
]
|
||||
enable = [
|
||||
#"useless-suppression", # temporarily every now and then to clean them up
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
"""Fixtures for anthemav integration tests."""
|
||||
from typing import Callable
|
||||
from collections.abc import Callable
|
||||
from unittest.mock import AsyncMock, MagicMock, patch
|
||||
|
||||
import pytest
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
"""Test the Anthem A/V Receivers config flow."""
|
||||
from typing import Callable
|
||||
from collections.abc import Callable
|
||||
from unittest.mock import ANY, AsyncMock, patch
|
||||
|
||||
from anthemav.device_error import DeviceError
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
"""Test the Anthem A/V Receivers config flow."""
|
||||
from typing import Callable
|
||||
from collections.abc import Callable
|
||||
from unittest.mock import AsyncMock
|
||||
|
||||
import pytest
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
# pylint: disable=invalid-name
|
||||
import asyncio
|
||||
import collections
|
||||
from collections.abc import Callable
|
||||
from datetime import datetime, timedelta
|
||||
from http import HTTPStatus
|
||||
import json
|
||||
from typing import Callable
|
||||
from unittest.mock import Mock, patch
|
||||
|
||||
import pytest
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
"""Test pushbullet integration."""
|
||||
from collections.abc import Awaitable
|
||||
from typing import Callable
|
||||
from collections.abc import Awaitable, Callable
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
||||
import aiohttp
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Sequence
|
||||
from collections.abc import Callable, Sequence
|
||||
from dataclasses import dataclass
|
||||
from datetime import timedelta
|
||||
from typing import Any, Callable
|
||||
from typing import Any
|
||||
from unittest.mock import Mock
|
||||
|
||||
from pyunifiprotect import ProtectApiClient
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
"""Tests for the WiZ Platform integration."""
|
||||
|
||||
from collections.abc import Callable
|
||||
from contextlib import contextmanager
|
||||
from copy import deepcopy
|
||||
import json
|
||||
from typing import Callable
|
||||
from unittest.mock import AsyncMock, MagicMock, patch
|
||||
|
||||
from pywizlight import SCENES, BulbType, PilotParser, wizlight
|
||||
|
|
Loading…
Add table
Reference in a new issue