Update pre-commit-config [Py310] (#86415)

This commit is contained in:
Marc Mueller 2023-01-23 09:59:44 +01:00 committed by GitHub
parent 6397138589
commit 4f87c1f30f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 7 deletions

View File

@ -3,7 +3,7 @@ repos:
rev: v3.3.1 rev: v3.3.1
hooks: hooks:
- id: pyupgrade - id: pyupgrade
args: [--py39-plus] args: [--py310-plus]
- repo: https://github.com/PyCQA/autoflake - repo: https://github.com/PyCQA/autoflake
rev: v2.0.0 rev: v2.0.0
hooks: hooks:
@ -84,7 +84,7 @@ repos:
- id: python-typing-update - id: python-typing-update
stages: [manual] stages: [manual]
args: args:
- --py39-plus - --py310-plus
- --force - --force
- --keep-updates - --keep-updates
files: ^(homeassistant|tests|script)/.+\.py$ files: ^(homeassistant|tests|script)/.+\.py$

View File

@ -6,9 +6,8 @@ from collections.abc import Awaitable, Callable, Iterable
import dataclasses import dataclasses
from functools import partial, wraps from functools import partial, wraps
import logging import logging
from typing import TYPE_CHECKING, Any, TypedDict, TypeVar from typing import TYPE_CHECKING, Any, TypedDict, TypeGuard, TypeVar
from typing_extensions import TypeGuard
import voluptuous as vol import voluptuous as vol
from homeassistant.auth.permissions.const import CAT_ENTITIES, POLICY_CONTROL from homeassistant.auth.permissions.const import CAT_ENTITIES, POLICY_CONTROL

View File

@ -1,8 +1,7 @@
"""Tests for the Bluetooth integration.""" """Tests for the Bluetooth integration."""
from __future__ import annotations
from collections.abc import Callable from collections.abc import Callable
from typing import Union
from unittest.mock import patch from unittest.mock import patch
import bleak import bleak
@ -66,7 +65,7 @@ class FakeScanner(BaseHaRemoteScanner):
class BaseFakeBleakClient: class BaseFakeBleakClient:
"""Base class for fake bleak clients.""" """Base class for fake bleak clients."""
def __init__(self, address_or_ble_device: Union[BLEDevice, str], **kwargs): def __init__(self, address_or_ble_device: BLEDevice | str, **kwargs):
"""Initialize the fake bleak client.""" """Initialize the fake bleak client."""
self._device_path = "/dev/test" self._device_path = "/dev/test"
self._device = address_or_ble_device self._device = address_or_ble_device