Update mypy to 1.5.0 (#98179)
This commit is contained in:
parent
990ec1d445
commit
fb66ceb302
7 changed files with 10 additions and 9 deletions
|
@ -637,7 +637,7 @@ class BluetoothManager:
|
|||
else:
|
||||
# We could write out every item in the typed dict here
|
||||
# but that would be a bit inefficient and verbose.
|
||||
callback_matcher.update(matcher) # type: ignore[typeddict-item]
|
||||
callback_matcher.update(matcher)
|
||||
callback_matcher[CONNECTABLE] = matcher.get(CONNECTABLE, True)
|
||||
|
||||
connectable = callback_matcher[CONNECTABLE]
|
||||
|
|
|
@ -48,7 +48,7 @@ class LitterRobotBinarySensorEntity(LitterRobotEntity[_RobotT], BinarySensorEnti
|
|||
|
||||
|
||||
BINARY_SENSOR_MAP: dict[type[Robot], tuple[RobotBinarySensorEntityDescription, ...]] = {
|
||||
LitterRobot: (
|
||||
LitterRobot: ( # type: ignore[type-abstract] # only used for isinstance check
|
||||
RobotBinarySensorEntityDescription[LitterRobot](
|
||||
key="sleeping",
|
||||
translation_key="sleeping",
|
||||
|
@ -66,7 +66,7 @@ BINARY_SENSOR_MAP: dict[type[Robot], tuple[RobotBinarySensorEntityDescription, .
|
|||
is_on_fn=lambda robot: robot.sleep_mode_enabled,
|
||||
),
|
||||
),
|
||||
Robot: (
|
||||
Robot: ( # type: ignore[type-abstract] # only used for isinstance check
|
||||
RobotBinarySensorEntityDescription[Robot](
|
||||
key="power_status",
|
||||
translation_key="power_status",
|
||||
|
|
|
@ -48,7 +48,7 @@ class RobotSelectEntityDescription(
|
|||
|
||||
|
||||
ROBOT_SELECT_MAP: dict[type[Robot], RobotSelectEntityDescription] = {
|
||||
LitterRobot: RobotSelectEntityDescription[LitterRobot, int](
|
||||
LitterRobot: RobotSelectEntityDescription[LitterRobot, int]( # type: ignore[type-abstract] # only used for isinstance check
|
||||
key="cycle_delay",
|
||||
translation_key="cycle_delay",
|
||||
icon="mdi:timer-outline",
|
||||
|
|
|
@ -66,7 +66,7 @@ class LitterRobotSensorEntity(LitterRobotEntity[_RobotT], SensorEntity):
|
|||
|
||||
|
||||
ROBOT_SENSOR_MAP: dict[type[Robot], list[RobotSensorEntityDescription]] = {
|
||||
LitterRobot: [
|
||||
LitterRobot: [ # type: ignore[type-abstract] # only used for isinstance check
|
||||
RobotSensorEntityDescription[LitterRobot](
|
||||
key="waste_drawer_level",
|
||||
translation_key="waste_drawer",
|
||||
|
|
2
mypy.ini
2
mypy.ini
|
@ -17,7 +17,7 @@ warn_unused_configs = true
|
|||
warn_unused_ignores = true
|
||||
enable_error_code = ignore-without-code, redundant-self, truthy-iterable
|
||||
disable_error_code = annotation-unchecked
|
||||
strict_concatenate = false
|
||||
extra_checks = false
|
||||
check_untyped_defs = true
|
||||
disallow_incomplete_defs = true
|
||||
disallow_subclassing_any = true
|
||||
|
|
|
@ -11,7 +11,7 @@ astroid==2.15.4
|
|||
coverage==7.2.7
|
||||
freezegun==1.2.2
|
||||
mock-open==1.4.0
|
||||
mypy==1.4.1
|
||||
mypy==1.5.0
|
||||
pre-commit==3.3.3
|
||||
pydantic==1.10.12
|
||||
pylint==2.17.4
|
||||
|
|
|
@ -51,8 +51,9 @@ GENERAL_SETTINGS: Final[dict[str, str]] = {
|
|||
]
|
||||
),
|
||||
"disable_error_code": ", ".join(["annotation-unchecked"]),
|
||||
# Strict_concatenate breaks passthrough ParamSpec typing
|
||||
"strict_concatenate": "false",
|
||||
# Impractical in real code
|
||||
# E.g. this breaks passthrough ParamSpec typing with Concatenate
|
||||
"extra_checks": "false",
|
||||
}
|
||||
|
||||
# This is basically the list of checks which is enabled for "strict=true".
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue