Bump black from 23.12.1 to 24.2.0 (#6221)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
dependabot[bot] 2024-02-21 15:53:50 +13:00 committed by GitHub
parent 4d8b5edb1c
commit 07c3ee75e5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
14 changed files with 24 additions and 13 deletions

View File

@ -3,7 +3,7 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.12.1
rev: 24.2.0
hooks:
- id: black
args:

View File

@ -1,2 +1,3 @@
"""Support for Honeywell HumidIcon HIH"""
CODEOWNERS = ["@Benichou34"]

View File

@ -1,2 +1,3 @@
"""Support for Honeywell ABP2"""
CODEOWNERS = ["@jpfaff"]

View File

@ -7,6 +7,7 @@ reading temperatures to a resolution of 0.0625°C.
https://www.sparkfun.com/datasheets/Sensors/Temperature/tmp102.pdf
"""
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import i2c, sensor

View File

@ -3,6 +3,7 @@
The cryptography package is loaded lazily in the functions
so that it doesn't crash if it's not installed.
"""
import logging
from pathlib import Path

View File

@ -292,8 +292,7 @@ class ConfigValidationStep(abc.ABC):
priority: float = 0.0
@abc.abstractmethod
def run(self, result: Config) -> None:
...
def run(self, result: Config) -> None: ... # noqa: E704
class LoadValidationStep(ConfigValidationStep):

View File

@ -1,4 +1,5 @@
"""Enum backports from standard lib."""
from __future__ import annotations
from enum import Enum

View File

@ -8,7 +8,6 @@ originally do.
However there is a property to further disable decorator
impact."""
# This is set to true by script/build_language_schema.py
# only, so data is collected (again functionality is not modified)
EnableSchemaExtraction = False

View File

@ -1,4 +1,5 @@
"""This helper module tracks commonly used types in the esphome python codebase."""
from typing import Union
from esphome.core import ID, Lambda, EsphomeCore

View File

@ -1,6 +1,6 @@
pylint==3.0.3
flake8==7.0.0 # also change in .pre-commit-config.yaml when updating
black==23.12.1 # also change in .pre-commit-config.yaml when updating
black==24.2.0 # also change in .pre-commit-config.yaml when updating
pyupgrade==3.15.0 # also change in .pre-commit-config.yaml when updating
pre-commit

View File

@ -849,9 +849,11 @@ def convert(schema, config_var, path):
config_var["id_type"] = {
"class": str(data.base),
"parents": [str(x.base) for x in parents]
"parents": (
[str(x.base) for x in parents]
if isinstance(parents, list)
else None,
else None
),
}
elif schema_type == "use_id":
if inspect.ismodule(data):

View File

@ -28,8 +28,9 @@ def test_write_utf8_file_fails_at_rename(
test_dir = tmpdir.mkdir("files")
test_file = Path(test_dir / "test.json")
with pytest.raises(OSError), patch(
"esphome.dashboard.util.file.os.replace", side_effect=OSError
with (
pytest.raises(OSError),
patch("esphome.dashboard.util.file.os.replace", side_effect=OSError),
):
write_utf8_file(test_file, '{"some":"data"}', False)
@ -45,9 +46,11 @@ def test_write_utf8_file_fails_at_rename_and_remove(
test_dir = tmpdir.mkdir("files")
test_file = Path(test_dir / "test.json")
with pytest.raises(OSError), patch(
"esphome.dashboard.util.file.os.remove", side_effect=OSError
), patch("esphome.dashboard.util.file.os.replace", side_effect=OSError):
with (
pytest.raises(OSError),
patch("esphome.dashboard.util.file.os.remove", side_effect=OSError),
patch("esphome.dashboard.util.file.os.replace", side_effect=OSError),
):
write_utf8_file(test_file, '{"some":"data"}', False)
assert "File replacement cleanup failed" in caplog.text

View File

@ -8,6 +8,7 @@ If adding unit tests ensure that they are fast. Slower integration tests should
not be part of a unit test suite.
"""
import sys
import pytest

View File

@ -1,4 +1,5 @@
"""Tests for the wizard.py file."""
import os
import esphome.wizard as wz