2022-01-28 23:09:05 +01:00
[ build-system ]
2025-04-20 03:57:53 +02:00
requires = [ "setuptools==78.1.1" ]
2022-01-28 23:09:05 +01:00
build-backend = "setuptools.build_meta"
2022-05-25 04:01:27 +02:00
[ project ]
2025-03-26 20:30:03 +01:00
name = "homeassistant"
2026-07-29 16:47:26 +02:00
version = "2026.9.0.dev0"
2025-03-26 20:30:03 +01:00
license = "Apache-2.0"
2025-03-20 11:04:49 +01:00
license-files = [ "LICENSE*" , "homeassistant/backports/LICENSE*" ]
2022-05-25 04:01:27 +02:00
description = "Open-source home automation platform running on Python 3."
2025-03-26 20:30:03 +01:00
readme = "README.rst"
authors = [
{ name = "The Home Assistant Authors" , email = "hello@home-assistant.io" },
2022-05-25 04:01:27 +02:00
]
2025-03-26 20:30:03 +01:00
keywords = [ "home" , "automation" ]
2022-05-25 04:01:27 +02:00
classifiers = [
2025-03-26 20:30:03 +01:00
"Development Status :: 5 - Production/Stable" ,
"Intended Audience :: End Users/Desktop" ,
"Intended Audience :: Developers" ,
"Operating System :: OS Independent" ,
2025-10-15 20:50:16 +02:00
"Programming Language :: Python :: 3.14" ,
2025-03-26 20:30:03 +01:00
"Topic :: Home Automation" ,
2022-05-25 04:01:27 +02:00
]
2026-01-28 23:48:27 +01:00
requires-python = ">=3.14.2"
2025-03-26 20:30:03 +01:00
dependencies = [
2026-05-20 05:10:03 -05:00
"aiodns==4.0.4" ,
2026-02-03 10:23:25 +01:00
# aiogithubapi is needed by frontend; frontend is unconditionally imported at
# module level in `bootstrap.py` and its requirements thus need to be in
# requirements.txt to ensure they are always installed
2026-03-02 11:49:32 +01:00
"aiogithubapi==26.0.0" ,
2026-07-22 17:02:27 -10:00
"aiohttp==3.14.3" ,
2025-06-02 07:52:23 +02:00
"aiohttp_cors==0.8.1" ,
2025-06-07 09:30:43 -05:00
"aiohttp-fast-zlib==0.3.0" ,
2026-05-25 16:03:12 -05:00
"aiohttp-asyncmdnsresolver==0.2.0" ,
2025-03-26 20:30:03 +01:00
"aiozoneinfo==0.2.3" ,
2025-10-04 10:26:55 -05:00
"annotatedyaml==1.0.2" ,
2025-03-26 20:30:03 +01:00
"astral==2.2" ,
"async-interrupt==1.2.2" ,
2026-04-15 17:22:33 +02:00
"attrs==26.1.0" ,
2025-03-26 20:30:03 +01:00
"atomicwrites-homeassistant==1.4.1" ,
2026-04-16 10:07:45 +02:00
"audioop-lts==0.2.2" ,
2025-10-25 23:42:15 +02:00
"awesomeversion==25.8.0" ,
2025-10-01 19:07:45 +02:00
"bcrypt==5.0.0" ,
2025-03-26 20:30:03 +01:00
"certifi>=2021.5.30" ,
2025-09-04 20:54:49 +02:00
"ciso8601==2.3.3" ,
2025-11-01 23:25:35 +00:00
"cronsim==2.7" ,
2026-05-24 10:22:02 -05:00
"fnv-hash-fast==2.0.3" ,
2025-03-26 20:30:03 +01:00
# hass-nabucasa is imported by helpers which don't depend on the cloud
# integration
2026-03-23 17:10:16 +01:00
"hass-nabucasa==2.2.0" ,
2025-03-26 20:30:03 +01:00
# When bumping httpx, please check the version pins of
# httpcore, anyio, and h11 in gen_requirements_all
"httpx==0.28.1" ,
2026-04-16 12:06:34 +02:00
"home-assistant-bluetooth==2.0.0" ,
2025-03-26 20:30:03 +01:00
"ifaddr==0.2.0" ,
"Jinja2==3.1.6" ,
2026-04-16 11:25:00 +02:00
"lru-dict==1.4.1" ,
2026-07-20 09:03:02 +02:00
"PyJWT==2.13.0" ,
2025-03-26 20:30:03 +01:00
# PyJWT has loose dependency. We want the latest one.
2026-06-17 07:34:00 +02:00
"cryptography==48.0.1" ,
2026-07-10 08:55:57 +02:00
"Pillow==12.3.0" ,
2026-05-16 08:38:56 +02:00
"propcache==0.5.2" ,
2026-05-12 10:17:56 +02:00
"pyOpenSSL==26.2.0" ,
2026-05-14 07:54:53 +02:00
"orjson==3.11.9" ,
2025-03-26 20:30:03 +01:00
"packaging>=23.1" ,
"psutil-home-assistant==0.0.1" ,
"python-slugify==8.0.4" ,
2025-10-04 16:27:22 +02:00
"PyYAML==6.0.3" ,
2026-05-18 20:18:53 +02:00
"requests==2.34.2" ,
2026-04-07 21:19:51 +02:00
"securetar==2026.4.1" ,
2026-06-22 23:59:00 +02:00
"SQLAlchemy==2.0.51" ,
2025-03-26 20:30:03 +01:00
"standard-aifc==3.13.0" ,
"standard-telnetlib==3.13.0" ,
2025-08-25 19:33:59 +02:00
"typing-extensions>=4.15.0,<5.0" ,
2026-05-25 15:56:22 -05:00
"ulid-transform==2.2.9" ,
2025-06-11 15:11:58 +02:00
"urllib3>=2.0" ,
2026-07-31 09:30:51 +02:00
"uv==0.11.32" ,
2026-01-08 10:25:46 -06:00
"voluptuous==0.15.2" ,
2025-08-19 16:42:49 +02:00
"voluptuous-serialize==2.7.0" ,
2026-06-26 07:12:28 -07:00
"voluptuous-openapi==0.4.1" ,
2026-07-22 13:32:56 -10:00
"yarl==1.24.5" ,
2025-03-26 20:30:03 +01:00
"webrtc-models==0.3.0" ,
2026-06-22 15:29:17 -05:00
"zeroconf==0.150.0" ,
2022-05-26 02:54:49 +02:00
]
2022-05-25 04:01:27 +02:00
[ project . urls ]
2025-03-26 20:30:03 +01:00
"Homepage" = "https://www.home-assistant.io/"
2022-05-25 04:01:27 +02:00
"Source Code" = "https://github.com/home-assistant/core"
"Bug Reports" = "https://github.com/home-assistant/core/issues"
2025-03-26 20:30:03 +01:00
"Docs: Dev" = "https://developers.home-assistant.io/"
"Discord" = "https://www.home-assistant.io/join-chat/"
"Forum" = "https://community.home-assistant.io/"
2022-05-25 04:01:27 +02:00
[ project . scripts ]
hass = "homeassistant.__main__:main"
[ tool . setuptools ]
include-package-data = true
[ tool . setuptools . packages . find ]
include = [ "homeassistant*" ]
2022-06-06 21:43:47 +02:00
[ tool . pylint . MAIN ]
2026-01-28 23:48:27 +01:00
py-version = "3.14"
2020-10-06 12:26:48 +03:00
# Use a conservative default here; 2 should speed up most setups and not hurt
# any too bad. Override on command line as appropriate.
2021-03-01 13:40:46 +01:00
jobs = 2
2022-01-29 23:47:40 +01:00
init-hook = """\
from pathlib import Path; \
import sys; \
from pylint.config import find_default_config_files; \
sys.path.append( \
str(Path(next(find_default_config_files())).parent.joinpath('pylint/plugins'))
) \
"""
2020-10-06 12:26:48 +03:00
load-plugins = [
2025-03-26 20:30:03 +01:00
"pylint.extensions.code_style" ,
"pylint.extensions.typing" ,
2026-05-13 23:12:19 +02:00
"pylint_home_assistant" ,
2025-03-26 20:30:03 +01:00
"pylint_per_file_ignores" ,
2020-10-06 12:26:48 +03:00
]
persistent = false
2021-07-10 22:58:37 +02:00
extension-pkg-allow-list = [
2025-03-26 20:30:03 +01:00
"av.audio.stream" ,
"av.logging" ,
"av.stream" ,
"ciso8601" ,
"orjson" ,
"cv2" ,
2022-07-05 00:04:56 +03:00
]
2025-03-26 20:30:03 +01:00
fail-on = [ "I" ]
2020-10-06 12:26:48 +03:00
[ tool . pylint . BASIC ]
2021-03-30 06:02:56 +02:00
class-const-naming-style = "any"
2020-10-06 12:26:48 +03:00
[ tool . pylint . "MESSAGES CONTROL" ]
# Reasons disabled:
2023-11-27 22:42:11 +02:00
# format - handled by ruff
2020-10-06 12:26:48 +03:00
# locally-disabled - it spams too much
# duplicate-code - unavoidable
# cyclic-import - doesn't test if both import on load
# abstract-class-little-used - prevents from setting right foundation
# unused-argument - generic callbacks and setup methods create a lot of warnings
# too-many-* - are not enforced for the sake of readability
# too-few-* - same as too-many-*
# abstract-method - with intro of async there are always methods missing
# inconsistent-return-statements - doesn't handle raise
# too-many-ancestors - it's too strict.
# wrong-import-order - isort guards this
2024-05-20 09:59:22 +02:00
# possibly-used-before-assignment - too many errors / not necessarily issues
2021-07-19 15:57:06 +02:00
# ---
2023-02-02 12:49:01 +01:00
# Pylint CodeStyle plugin
# consider-using-namedtuple-or-dataclass - too opinionated
# consider-using-assignment-expr - decision to use := better left to devs
2020-10-06 12:26:48 +03:00
disable = [
2025-03-26 20:30:03 +01:00
"format" ,
"abstract-method" ,
"cyclic-import" ,
"duplicate-code" ,
"inconsistent-return-statements" ,
"locally-disabled" ,
"not-context-manager" ,
"too-few-public-methods" ,
"too-many-ancestors" ,
"too-many-arguments" ,
"too-many-instance-attributes" ,
"too-many-lines" ,
"too-many-locals" ,
"too-many-public-methods" ,
"too-many-boolean-expressions" ,
"too-many-positional-arguments" ,
"wrong-import-order" ,
"consider-using-namedtuple-or-dataclass" ,
"consider-using-assignment-expr" ,
"possibly-used-before-assignment" ,
2023-06-27 17:42:46 +02:00
2026-05-14 02:14:12 +02:00
# Disabled while existing violations are being cleaned up
"home-assistant-unused-test-fixture-argument" ,
2025-03-26 20:30:03 +01:00
# Handled by ruff
# Ref: <https://github.com/astral-sh/ruff/issues/970>
"await-outside-async" , # PLE1142
"bad-str-strip-call" , # PLE1310
"bad-string-format-type" , # PLE1307
"bidirectional-unicode" , # PLE2502
"continue-in-finally" , # PLE0116
"duplicate-bases" , # PLE0241
"misplaced-bare-raise" , # PLE0704
"format-needs-mapping" , # F502
"function-redefined" , # F811
# Needed because ruff does not understand type of __all__ generated by a function
# "invalid-all-format", # PLE0605
"invalid-all-object" , # PLE0604
"invalid-character-backspace" , # PLE2510
"invalid-character-esc" , # PLE2513
"invalid-character-nul" , # PLE2514
"invalid-character-sub" , # PLE2512
"invalid-character-zero-width-space" , # PLE2515
"logging-too-few-args" , # PLE1206
"logging-too-many-args" , # PLE1205
"missing-format-string-key" , # F524
"mixed-format-string" , # F506
"no-method-argument" , # N805
"no-self-argument" , # N805
"nonexistent-operator" , # B002
"nonlocal-without-binding" , # PLE0117
"not-in-loop" , # F701, F702
"notimplemented-raised" , # F901
"return-in-init" , # PLE0101
"return-outside-function" , # F706
"syntax-error" , # E999
"too-few-format-args" , # F524
"too-many-format-args" , # F522
"too-many-star-expressions" , # F622
"truncated-format-string" , # F501
"undefined-all-variable" , # F822
"undefined-variable" , # F821
"used-prior-global-declaration" , # PLE0118
"yield-inside-async-function" , # PLE1700
"yield-outside-function" , # F704
"anomalous-backslash-in-string" , # W605
"assert-on-string-literal" , # PLW0129
"assert-on-tuple" , # F631
"bad-format-string" , # W1302, F
"bad-format-string-key" , # W1300, F
"bare-except" , # E722
"binary-op-exception" , # PLW0711
"cell-var-from-loop" , # B023
# "dangerous-default-value", # B006, ruff catches new occurrences, needs more work
"duplicate-except" , # B014
"duplicate-key" , # F601
"duplicate-string-formatting-argument" , # F
"duplicate-value" , # F
"eval-used" , # S307
"exec-used" , # S102
"expression-not-assigned" , # B018
"f-string-without-interpolation" , # F541
"forgotten-debug-statement" , # T100
"format-string-without-interpolation" , # F
# "global-statement", # PLW0603, ruff catches new occurrences, needs more work
"global-variable-not-assigned" , # PLW0602
"implicit-str-concat" , # ISC001
2025-06-19 20:39:09 +02:00
"import-outside-toplevel" , # PLC0415
2025-03-26 20:30:03 +01:00
"import-self" , # PLW0406
"inconsistent-quotes" , # Q000
"invalid-envvar-default" , # PLW1508
"keyword-arg-before-vararg" , # B026
"logging-format-interpolation" , # G
"logging-fstring-interpolation" , # G
"logging-not-lazy" , # G
"misplaced-future" , # F404
"named-expr-without-context" , # PLW0131
"nested-min-max" , # PLW3301
"pointless-statement" , # B018
"raise-missing-from" , # B904
"redefined-builtin" , # A001
"try-except-raise" , # TRY302
"unused-argument" , # ARG001, we don't use it
"unused-format-string-argument" , #F507
"unused-format-string-key" , # F504
"unused-import" , # F401
"unused-variable" , # F841
"useless-else-on-loop" , # PLW0120
"wildcard-import" , # F403
"bad-classmethod-argument" , # N804
"consider-iterating-dictionary" , # SIM118
"empty-docstring" , # D419
"invalid-name" , # N815
"line-too-long" , # E501, disabled globally
"missing-class-docstring" , # D101
"missing-final-newline" , # W292
"missing-function-docstring" , # D103
"missing-module-docstring" , # D100
"multiple-imports" , #E401
"singleton-comparison" , # E711, E712
"subprocess-run-check" , # PLW1510
"superfluous-parens" , # UP034
"ungrouped-imports" , # I001
"unidiomatic-typecheck" , # E721
"unnecessary-direct-lambda-call" , # PLC3002
"unnecessary-lambda-assignment" , # PLC3001
"unnecessary-pass" , # PIE790
"unneeded-not" , # SIM208
"useless-import-alias" , # PLC0414
"wrong-import-order" , # I001
"wrong-import-position" , # E402
"comparison-of-constants" , # PLR0133
"comparison-with-itself" , # PLR0124
"consider-alternative-union-syntax" , # UP007
"consider-merging-isinstance" , # PLR1701
"consider-using-alias" , # UP006
"consider-using-dict-comprehension" , # C402
"consider-using-generator" , # C417
"consider-using-get" , # SIM401
"consider-using-set-comprehension" , # C401
"consider-using-sys-exit" , # PLR1722
"consider-using-ternary" , # SIM108
"literal-comparison" , # F632
"property-with-parameters" , # PLR0206
"super-with-arguments" , # UP008
"too-many-branches" , # PLR0912
"too-many-return-statements" , # PLR0911
"too-many-statements" , # PLR0915
"trailing-comma-tuple" , # COM818
"unnecessary-comprehension" , # C416
"use-a-generator" , # C417
"use-dict-literal" , # C406
"use-list-literal" , # C405
"useless-object-inheritance" , # UP004
"useless-return" , # PLR1711
"no-else-break" , # RET508
"no-else-continue" , # RET507
"no-else-raise" , # RET506
"no-else-return" , # RET505
"broad-except" , # BLE001
"protected-access" , # SLF001
"broad-exception-raised" , # TRY002
"consider-using-f-string" , # PLC0209
# "no-self-use", # PLR6301 # Optional plugin, not enabled
2023-06-27 17:42:46 +02:00
2025-03-26 20:30:03 +01:00
# Handled by mypy
# Ref: <https://github.com/antonagestam/pylint-mypy-overlap>
"abstract-class-instantiated" ,
"arguments-differ" ,
"assigning-non-slot" ,
"assignment-from-no-return" ,
"assignment-from-none" ,
"bad-exception-cause" ,
"bad-format-character" ,
"bad-reversed-sequence" ,
"bad-super-call" ,
"bad-thread-instantiation" ,
"catching-non-exception" ,
"comparison-with-callable" ,
"deprecated-class" ,
"dict-iter-missing-items" ,
"format-combined-specification" ,
"global-variable-undefined" ,
"import-error" ,
"inconsistent-mro" ,
"inherit-non-class" ,
"init-is-generator" ,
"invalid-class-object" ,
"invalid-enum-extension" ,
"invalid-envvar-value" ,
"invalid-format-returned" ,
"invalid-hash-returned" ,
"invalid-metaclass" ,
"invalid-overridden-method" ,
"invalid-repr-returned" ,
"invalid-sequence-index" ,
"invalid-slice-index" ,
"invalid-slots-object" ,
"invalid-slots" ,
"invalid-star-assignment-target" ,
"invalid-str-returned" ,
"invalid-unary-operand-type" ,
"invalid-unicode-codec" ,
"isinstance-second-argument-not-valid-type" ,
"method-hidden" ,
"misplaced-format-function" ,
"missing-format-argument-key" ,
"missing-format-attribute" ,
"missing-kwoa" ,
"no-member" ,
"no-value-for-parameter" ,
"non-iterator-returned" ,
"non-str-assignment-to-dunder-name" ,
"nonlocal-and-global" ,
"not-a-mapping" ,
"not-an-iterable" ,
"not-async-context-manager" ,
"not-callable" ,
"not-context-manager" ,
"overridden-final-method" ,
"raising-bad-type" ,
"raising-non-exception" ,
"redundant-keyword-arg" ,
"relative-beyond-top-level" ,
"self-cls-assignment" ,
"signature-differs" ,
"star-needs-assignment-target" ,
"subclassed-final-class" ,
"super-without-brackets" ,
"too-many-function-args" ,
"typevar-double-variance" ,
"typevar-name-mismatch" ,
"unbalanced-dict-unpacking" ,
"unbalanced-tuple-unpacking" ,
"unexpected-keyword-arg" ,
"unhashable-member" ,
"unpacking-non-sequence" ,
"unsubscriptable-object" ,
"unsupported-assignment-operation" ,
"unsupported-binary-operation" ,
"unsupported-delete-operation" ,
"unsupported-membership-test" ,
"used-before-assignment" ,
"using-final-decorator-in-unsupported-version" ,
"wrong-exception-operation" ,
2020-10-06 12:26:48 +03:00
]
enable = [
2025-03-26 20:30:03 +01:00
#"useless-suppression", # temporarily every now and then to clean them up
"use-symbolic-message-instead" ,
2020-10-06 12:26:48 +03:00
]
2024-02-08 17:40:30 +01:00
per-file-ignores = [
2025-03-26 20:30:03 +01:00
# redefined-outer-name: Tests reference fixtures in the test function
# use-implicit-booleaness-not-comparison: Tests need to validate that a list
# or a dict is returned
2026-04-15 00:41:54 +02:00
"tests/**:redefined-outer-name,use-implicit-booleaness-not-comparison" ,
2024-02-08 17:40:30 +01:00
]
2020-10-06 12:26:48 +03:00
[ tool . pylint . REPORTS ]
score = false
[ tool . pylint . TYPECHECK ]
ignored-classes = [
2025-03-26 20:30:03 +01:00
"_CountingAttr" , # for attrs
2020-10-06 12:26:48 +03:00
]
2021-11-26 00:13:27 +01:00
mixin-class-rgx = ".*[Mm]ix[Ii]n"
2020-10-06 12:26:48 +03:00
[ tool . pylint . FORMAT ]
expected-line-ending-format = "LF"
[ tool . pylint . EXCEPTIONS ]
overgeneral-exceptions = [
2025-03-26 20:30:03 +01:00
"builtins.BaseException" ,
"builtins.Exception" ,
# "homeassistant.exceptions.HomeAssistantError", # too many issues
2020-10-06 12:26:48 +03:00
]
2021-04-25 02:39:24 +02:00
[ tool . pylint . TYPING ]
runtime-typing = false
2021-09-18 13:52:59 +02:00
[ tool . pylint . CODE_STYLE ]
max-line-length-suggestions = 72
2020-10-06 12:26:48 +03:00
[ tool . pytest . ini_options ]
2026-05-13 23:12:19 +02:00
pythonpath = [ "pylint/plugins" ]
2025-03-26 20:30:03 +01:00
testpaths = [ "tests" ]
norecursedirs = [ ".git" , "testing_config" ]
2022-04-05 10:10:16 +02:00
log_format = "%(asctime)s.%(msecs)03d %(levelname)-8s %(threadName)s %(name)s:%(filename)s:%(lineno)s %(message)s"
log_date_format = "%Y-%m-%d %H:%M:%S"
2025-09-13 19:27:47 +02:00
asyncio_debug = true
2022-11-29 22:36:36 +01:00
asyncio_mode = "auto"
2024-09-25 09:30:57 +02:00
asyncio_default_fixture_loop_scope = "function"
2023-08-20 18:30:28 +02:00
filterwarnings = [
2025-03-26 20:30:03 +01:00
"error::sqlalchemy.exc.SAWarning" ,
2025-06-25 21:38:35 +02:00
"error:usefixtures\\(\\) in .* without arguments has no effect:UserWarning" , # pytest
2023-08-20 18:30:28 +02:00
2025-03-26 20:30:03 +01:00
# -- HomeAssistant - aiohttp
# Overwrite web.Application to pass a custom default argument to _make_request
"ignore:Inheritance class HomeAssistantApplication from web.Application is discouraged:DeprecationWarning" ,
# Hass wraps `ClientSession.close` to emit a warning if the session is closed accidentally
"ignore:Setting custom ClientSession.close attribute is discouraged:DeprecationWarning:homeassistant.helpers.aiohttp_client" ,
# Modify app state for testing
"ignore:Changing state of started or joined application is deprecated:DeprecationWarning:tests.components.http.test_ban" ,
2023-08-20 18:30:28 +02:00
2025-04-12 19:15:38 +02:00
# -- Tests
# Ignore custom pytest marks
"ignore:Unknown pytest.mark.disable_autouse_fixture:pytest.PytestUnknownMarkWarning:tests.components.met" ,
"ignore:Unknown pytest.mark.dataset:pytest.PytestUnknownMarkWarning:tests.components.screenlogic" ,
# -- DeprecationWarning already fixed in our codebase
2025-09-10 18:09:11 +02:00
# https://github.com/kurtmckee/feedparser/ - 6.0.12
2025-04-12 19:15:38 +02:00
"ignore:.*a temporary mapping .* from `updated_parsed` to `published_parsed` if `updated_parsed` doesn't exist:DeprecationWarning:feedparser.util" ,
2023-08-20 18:30:28 +02:00
2025-03-26 20:30:03 +01:00
# -- design choice 3rd party
2026-04-09 14:20:59 +02:00
# https://github.com/gwww/elkm1/blob/2.2.13/elkm1_lib/util.py#L8-L19
2025-03-26 20:30:03 +01:00
"ignore:ssl.TLSVersion.TLSv1 is deprecated:DeprecationWarning:elkm1_lib.util" ,
# https://github.com/bachya/regenmaschine/blob/2024.03.0/regenmaschine/client.py#L52
"ignore:ssl.TLSVersion.SSLv3 is deprecated:DeprecationWarning:regenmaschine.client" ,
2023-08-20 18:30:28 +02:00
2025-03-26 20:30:03 +01:00
# -- Setuptools DeprecationWarnings
# https://github.com/Azure/azure-sdk-for-python
2025-10-27 11:43:37 +01:00
"ignore:Deprecated call to `pkg_resources.declare_namespace\\('azure'\\)`:DeprecationWarning:pkg_resources" ,
2023-08-20 18:30:28 +02:00
2025-03-26 20:30:03 +01:00
# -- tracked upstream / open PRs
2025-04-12 19:15:38 +02:00
# https://github.com/hacf-fr/meteofrance-api/pull/688 - v1.4.0 - 2025-03-26
"ignore:datetime.*utcnow\\(\\) is deprecated and scheduled for removal:DeprecationWarning:meteofrance_api.model.forecast" ,
2023-08-20 18:30:28 +02:00
2025-03-26 20:30:03 +01:00
# -- fixed, waiting for release / update
# https://github.com/httplib2/httplib2/pull/226 - >=0.21.0
"ignore:ssl.PROTOCOL_TLS is deprecated:DeprecationWarning:httplib2" ,
2026-04-09 14:20:59 +02:00
# https://github.com/httplib2/httplib2/pull/253 - >=0.31.1
"ignore:'(addParseAction|delimitedList|leaveWhitespace|setName|setParseAction)' deprecated:DeprecationWarning:httplib2.auth" ,
# https://github.com/lawtancool/pyControl4/pull/47 - >=1.6.0
"ignore:with timeout\\(\\) is deprecated, use async with timeout\\(\\) instead:DeprecationWarning:pyControl4.account" ,
# https://pypi.org/project/pyqwikswitch/ - >=1.0
"ignore:client.loop property is deprecated:DeprecationWarning:pyqwikswitch.async_" ,
"ignore:with timeout\\(\\) is deprecated:DeprecationWarning:pyqwikswitch.async_" ,
2025-12-12 13:54:00 +01:00
# https://github.com/allenporter/python-google-nest-sdm/pull/1229 - >9.1.2
"ignore:datetime.*utcnow\\(\\) is deprecated:DeprecationWarning:google_nest_sdm.device" ,
2025-03-26 20:30:03 +01:00
# https://github.com/rytilahti/python-miio/pull/1809 - >=0.6.0.dev0
"ignore:datetime.*utcnow\\(\\) is deprecated and scheduled for removal:DeprecationWarning:miio.protocol" ,
"ignore:datetime.*utcnow\\(\\) is deprecated and scheduled for removal:DeprecationWarning:miio.miioprotocol" ,
2025-04-12 19:15:38 +02:00
# https://github.com/rytilahti/python-miio/pull/1993 - >0.6.0.dev0
"ignore:functools.partial will be a method descriptor in future Python versions; wrap it in enum.member\\(\\) if you want to preserve the old behavior:FutureWarning:miio.miot_device" ,
2026-04-09 14:20:59 +02:00
# https://github.com/pyusb/pyusb/pull/545 - >1.3.1
"ignore:Due to '_pack_', the '.*' Structure will use memory layout compatible with MSVC:DeprecationWarning:usb.backend.libusb0" ,
# https://github.com/xchwarze/samsung-tv-ws-api/pull/151 - >=3.0.0 - 2024-12-06 # wrong stacklevel in aiohttp
2025-06-02 16:01:23 +02:00
"ignore:verify_ssl is deprecated, use ssl=False instead:DeprecationWarning:aiohttp.client" ,
2023-08-20 18:30:28 +02:00
2025-03-26 20:30:03 +01:00
# -- other
# Locale changes might take some time to resolve upstream
# https://github.com/Squachen/micloud/blob/v_0.6/micloud/micloud.py#L35 - v0.6 - 2022-12-08
"ignore:'locale.getdefaultlocale' is deprecated and slated for removal in Python 3.15:DeprecationWarning:micloud.micloud" ,
2025-04-12 19:15:38 +02:00
# https://pypi.org/project/agent-py/ - v0.0.24 - 2024-11-07
"ignore:with timeout\\(\\) is deprecated:DeprecationWarning:agent.a" ,
2025-03-26 20:30:03 +01:00
# https://github.com/MatsNl/pyatag/issues/11 - v0.3.7.1 - 2023-10-09
"ignore:datetime.*utcnow\\(\\) is deprecated and scheduled for removal:DeprecationWarning:pyatag.gateway" ,
# https://github.com/lidatong/dataclasses-json/issues/328
# https://github.com/lidatong/dataclasses-json/pull/351
"ignore:The 'default' argument to fields is deprecated. Use 'dump_default' instead:DeprecationWarning:dataclasses_json.mm" ,
# https://pypi.org/project/emulated-roku/ - v0.3.0 - 2023-12-19
# https://github.com/martonperei/emulated_roku
"ignore:loop argument is deprecated:DeprecationWarning:emulated_roku" ,
2025-12-12 13:54:00 +01:00
# https://github.com/EnergieID/energyid-webhooks-py/ - v0.0.14 - 2025-05-06
"ignore:The V1 WebhookClient is deprecated:DeprecationWarning:energyid_webhooks" ,
2025-04-12 19:15:38 +02:00
# https://pypi.org/project/foobot_async/ - v1.0.1 - 2024-08-16
"ignore:with timeout\\(\\) is deprecated:DeprecationWarning:foobot_async" ,
2025-08-03 09:25:17 +02:00
# https://pypi.org/project/motionblindsble/ - v0.1.3 - 2024-11-12
# https://github.com/LennP/motionblindsble/blob/0.1.3/motionblindsble/device.py#L390
"ignore:Passing additional arguments for BLEDevice is deprecated and has no effect:DeprecationWarning:motionblindsble.device" ,
2025-06-19 13:07:42 +02:00
# https://github.com/thecynic/pylutron - v0.2.18 - 2025-04-15
2025-03-26 20:30:03 +01:00
"ignore:setDaemon\\(\\) is deprecated, set the daemon attribute instead:DeprecationWarning:pylutron" ,
2025-04-12 19:15:38 +02:00
# https://pypi.org/project/PyMetEireann/ - v2024.11.0 - 2024-11-23
"ignore:datetime.*utcnow\\(\\) is deprecated and scheduled for removal:DeprecationWarning:meteireann" ,
2025-03-26 20:30:03 +01:00
# https://github.com/pschmitt/pynuki/blob/1.6.3/pynuki/utils.py#L21 - v1.6.3 - 2024-02-24
"ignore:datetime.*utcnow\\(\\) is deprecated and scheduled for removal:DeprecationWarning:pynuki.utils" ,
2025-06-19 13:07:42 +02:00
# https://github.com/lextudio/pysnmp/blob/v7.1.21/pysnmp/smi/compiler.py#L23-L31 - v7.1.21 - 2025-06-19
2025-03-26 20:30:03 +01:00
"ignore:smiV1Relaxed is deprecated. Please use smi_v1_relaxed instead:DeprecationWarning:pysnmp.smi.compiler" ,
2025-04-12 19:15:38 +02:00
"ignore:getReadersFromUrls is deprecated. Please use get_readers_from_urls instead:DeprecationWarning:pysnmp.smi.compiler" ,
2026-04-09 14:20:59 +02:00
# https://github.com/frenck/python-radios/blob/v0.3.2/src/radios/radio_browser.py#L76 - v0.3.2 - 2024-10-26
"ignore:query\\(\\) is deprecated, use query_dns\\(\\) instead:DeprecationWarning:radios.radio_browser" ,
# https://github.com/python-telegram-bot/python-telegram-bot/blob/v22.7/src/telegram/error.py#L243 - 22.7 - 2026-03-16
"ignore:Deprecated since version v22.2.*attribute `retry_after` will be of type `datetime.timedelta`:DeprecationWarning:telegram.error" ,
2025-03-26 20:30:03 +01:00
# https://github.com/briis/pyweatherflowudp/blob/v1.4.5/pyweatherflowudp/const.py#L20 - v1.4.5 - 2023-10-10
"ignore:This function will be removed in future versions of pint:DeprecationWarning:pyweatherflowudp.const" ,
2026-04-09 14:20:59 +02:00
# - SyntaxWarnings - invalid escape sequence
2025-03-26 20:30:03 +01:00
# https://pypi.org/project/aprslib/ - v0.7.2 - 2022-07-10
2025-06-19 13:07:42 +02:00
"ignore:.*invalid escape sequence:SyntaxWarning:.*aprslib.parsing.common" ,
2025-03-26 20:30:03 +01:00
"ignore:datetime.*utcnow\\(\\) is deprecated and scheduled for removal:DeprecationWarning:aprslib.parsing.common" ,
2026-04-09 14:20:59 +02:00
# https://pypi.org/project/panasonic-viera/ - v0.4.4 - 2025-11-25
2025-11-25 08:59:13 -08:00
# https://github.com/florianholzapfel/panasonic-viera/blob/0.4.4/panasonic_viera/remote_control.py#L665
2025-06-19 13:07:42 +02:00
"ignore:.*invalid escape sequence:SyntaxWarning:.*panasonic_viera" ,
2025-03-26 20:30:03 +01:00
# https://pypi.org/project/pyblackbird/ - v0.6 - 2023-03-15
# https://github.com/koolsb/pyblackbird/pull/9 -> closed
2025-06-19 13:07:42 +02:00
"ignore:.*invalid escape sequence:SyntaxWarning:.*pyblackbird" ,
2025-03-26 20:30:03 +01:00
# https://pypi.org/project/pyws66i/ - v1.1 - 2022-04-05
2025-06-19 13:07:42 +02:00
"ignore:.*invalid escape sequence:SyntaxWarning:.*pyws66i" ,
2025-03-26 20:30:03 +01:00
# https://pypi.org/project/sanix/ - v1.0.6 - 2024-05-01
# https://github.com/tomaszsluszniak/sanix_py/blob/v1.0.6/sanix/__init__.py#L42
2025-06-19 13:07:42 +02:00
"ignore:.*invalid escape sequence:SyntaxWarning:.*sanix" ,
2025-03-26 20:30:03 +01:00
# https://pypi.org/project/sleekxmppfs/ - v1.4.1 - 2022-08-18
2025-06-19 13:07:42 +02:00
"ignore:.*invalid escape sequence:SyntaxWarning:.*sleekxmppfs.thirdparty.mini_dateutil" , # codespell:ignore thirdparty
# - SyntaxWarning - is with literal
# https://github.com/majuss/lupupy/pull/15 - >0.3.2
2025-12-12 13:54:00 +01:00
"ignore:\"is.*\" with '.*' literal:SyntaxWarning:.*lupupy.devices.alarm" ,
2025-06-19 13:07:42 +02:00
# https://pypi.org/project/opuslib/ - v3.0.1 - 2018-01-16
2025-12-12 13:54:00 +01:00
"ignore:\"is.*\" with '.*' literal:SyntaxWarning:.*opuslib.api.decoder" ,
2025-06-19 13:07:42 +02:00
# https://pypi.org/project/pyiss/ - v1.0.1 - 2016-12-19
2025-12-12 13:54:00 +01:00
"ignore:\"is.*\" with '.*' literal:SyntaxWarning:.*pyiss" ,
2025-10-15 20:50:16 +02:00
# - SyntaxWarning - return in finally
2025-10-27 11:43:37 +01:00
# https://github.com/nextcord/nextcord/pull/1268 - >3.1.1 - 2025-08-16
2025-12-12 13:54:00 +01:00
"ignore:'return' in a 'finally' block:SyntaxWarning:.*nextcord.(gateway|player)" ,
2025-10-15 20:50:16 +02:00
# https://pypi.org/project/sleekxmppfs/ - v1.4.1 - 2022-08-18
2025-12-12 13:54:00 +01:00
"ignore:'return' in a 'finally' block:SyntaxWarning:.*sleekxmppfs.(roster.single|xmlstream.xmlstream)" ,
2024-04-11 23:35:15 +02:00
2025-03-26 20:30:03 +01:00
# -- New in Python 3.13
# https://github.com/youknowone/python-deadlib - Backports for aifc, telnetlib
"ignore:aifc was removed in Python 3.13.*'standard-aifc':DeprecationWarning:speech_recognition" ,
"ignore:telnetlib was removed in Python 3.13.*'standard-telnetlib':DeprecationWarning:homeassistant.components.hddtemp.sensor" ,
"ignore:telnetlib was removed in Python 3.13.*'standard-telnetlib':DeprecationWarning:ndms2_client.connection" ,
"ignore:telnetlib was removed in Python 3.13.*'standard-telnetlib':DeprecationWarning:pyws66i" ,
2024-11-10 11:38:56 +01:00
2025-10-15 20:50:16 +02:00
# -- New in Python 3.14
# https://github.com/litl/backoff/pull/220 - v2.2.1 - 2022-10-05 (archived)
"ignore:'asyncio.iscoroutinefunction' is deprecated and slated for removal in Python 3.16:DeprecationWarning:(backoff._decorator|backoff._async)" ,
# https://github.com/albertogeniola/elmax-api - v0.0.6.3 - 2024-11-30
"ignore:'asyncio.iscoroutinefunction' is deprecated and slated for removal in Python 3.16:DeprecationWarning:elmax_api.http" ,
2025-10-27 11:43:37 +01:00
# https://github.com/nextcord/nextcord/pull/1269 - >3.1.1 - 2025-08-16
2025-10-15 20:50:16 +02:00
"ignore:'asyncio.iscoroutinefunction' is deprecated and slated for removal in Python 3.16:DeprecationWarning:nextcord.member" ,
# https://github.com/svinota/pyroute2
"ignore:Due to '_pack_', the '.*' Structure will use memory layout compatible with MSVC:DeprecationWarning:pyroute2.ethtool.ioctl" ,
# https://github.com/googleapis/python-genai
2026-04-09 14:20:59 +02:00
"ignore:Inheritance class AiohttpClientSession from ClientSession is discouraged:DeprecationWarning:google.genai._api_client" ,
2025-10-15 20:50:16 +02:00
"ignore:'_UnionGenericAlias' is deprecated and slated for removal in Python 3.17:DeprecationWarning:google.genai.types" ,
2025-04-12 19:15:38 +02:00
# -- Websockets 14.1
# https://websockets.readthedocs.io/en/stable/howto/upgrade.html
"ignore:websockets.legacy is deprecated:DeprecationWarning:websockets.legacy" ,
2025-03-26 20:30:03 +01:00
# -- unmaintained projects, last release about 2+ years
2026-04-09 14:20:59 +02:00
# https://pypi.org/project/colorthief/ - v0.2.1 - 2017-02-09
"ignore:Image.Image.getdata is deprecated and will be removed in Pillow 14.* Use get_flattened_data instead:DeprecationWarning:colorthief" ,
2025-03-26 20:30:03 +01:00
# https://pypi.org/project/directv/ - v0.4.0 - 2020-09-12
"ignore:with timeout\\(\\) is deprecated:DeprecationWarning:directv.directv" ,
"ignore:datetime.*utcnow\\(\\) is deprecated and scheduled for removal:DeprecationWarning:directv.models" ,
2025-04-13 00:04:50 +02:00
# https://pypi.org/project/enocean/ - v0.50.1 (installed) -> v0.60.1 - 2021-06-18
"ignore:It looks like you're using an HTML parser to parse an XML document:UserWarning:enocean.protocol.eep" ,
2025-03-26 20:30:03 +01:00
# https://pypi.org/project/influxdb/ - v5.3.2 - 2024-04-18 (archived)
"ignore:datetime.*utcfromtimestamp\\(\\) is deprecated and scheduled for removal:DeprecationWarning:influxdb.line_protocol" ,
# https://pypi.org/project/lark-parser/ - v0.12.0 - 2021-08-30 -> moved to `lark`
# https://pypi.org/project/commentjson/ - v0.9.0 - 2020-10-05
# https://github.com/vaidik/commentjson/issues/51
# https://github.com/vaidik/commentjson/pull/52
# Fixed upstream, commentjson depends on old version and seems to be unmaintained
"ignore:module '(sre_parse|sre_constants)' is deprecate:DeprecationWarning:lark.utils" ,
# https://pypi.org/project/lomond/ - v0.3.3 - 2018-09-21
"ignore:ssl.PROTOCOL_TLS is deprecated:DeprecationWarning:lomond.session" ,
# https://pypi.org/project/oauth2client/ - v4.1.3 - 2018-09-07 (archived)
"ignore:datetime.*utcnow\\(\\) is deprecated and scheduled for removal:DeprecationWarning:oauth2client.client" ,
# https://pypi.org/project/pilight/ - v0.1.1 - 2016-10-19
2025-06-02 16:01:23 +02:00
"ignore:pkg_resources is deprecated as an API:UserWarning:pilight" ,
2025-03-26 20:30:03 +01:00
# https://pypi.org/project/pure-python-adb/ - v0.3.0.dev0 - 2020-08-05
2025-06-19 13:07:42 +02:00
"ignore:.*invalid escape sequence:SyntaxWarning:.*ppadb" ,
2025-03-26 20:30:03 +01:00
# https://pypi.org/project/pydub/ - v0.25.1 - 2021-03-10
2025-06-19 13:07:42 +02:00
"ignore:.*invalid escape sequence:SyntaxWarning:.*pydub.utils" ,
2025-03-26 20:30:03 +01:00
# https://pypi.org/project/PyPasser/ - v0.0.5 - 2021-10-21
2025-06-19 13:07:42 +02:00
"ignore:.*invalid escape sequence:SyntaxWarning:.*pypasser.utils" ,
2025-03-26 20:30:03 +01:00
# https://pypi.org/project/rxv/ - v0.7.0 - 2021-10-10
"ignore:defusedxml.cElementTree is deprecated, import from defusedxml.ElementTree instead:DeprecationWarning:rxv.ssdp" ,
2023-08-20 18:30:28 +02:00
]
2023-01-24 13:15:16 +02:00
2024-07-05 11:03:31 +02:00
[ tool . coverage . run ]
source = [ "homeassistant" ]
[ tool . coverage . report ]
exclude_lines = [
2025-03-26 20:30:03 +01:00
# Have to re-enable the standard pragma
"pragma: no cover" ,
# Don't complain about missing debug-only code:
"def __repr__" ,
# Don't complain if tests don't hit defensive assertion code:
"raise AssertionError" ,
"raise NotImplementedError" ,
# TYPE_CHECKING and @overload blocks are never executed during pytest run
"if TYPE_CHECKING:" ,
"@overload" ,
2024-07-05 11:03:31 +02:00
]
2024-03-28 18:45:07 +01:00
[ tool . ruff ]
2026-07-29 12:21:18 +02:00
required-version = ">=0.16.0"
2024-03-28 18:45:07 +01:00
2024-02-06 15:41:34 +01:00
[ tool . ruff . lint ]
2023-01-26 17:17:13 +01:00
select = [
2025-03-26 20:30:03 +01:00
"A001" , # Variable {name} is shadowing a Python builtin
"ASYNC" , # flake8-async
2026-06-01 13:07:36 +02:00
"B" , # flake8-bugbear
2025-03-26 20:30:03 +01:00
"BLE" ,
"C" , # complexity
"COM818" , # Trailing comma on bare tuple prohibited
"D" , # docstrings
"DTZ003" , # Use datetime.now(tz=) instead of datetime.utcnow()
"DTZ004" , # Use datetime.fromtimestamp(ts, tz=) instead of datetime.utcfromtimestamp(ts)
2026-05-14 15:44:08 +02:00
"DTZ011" , # Use datetime.now(tz=).date() instead of date.today()
2025-03-26 20:30:03 +01:00
"E" , # pycodestyle
"F" , # pyflakes/autoflake
"F541" , # f-string without any placeholders
"FLY" , # flynt
"FURB" , # refurb
"G" , # flake8-logging-format
"I" , # isort
"INP" , # flake8-no-pep420
"ISC" , # flake8-implicit-str-concat
"ICN001" , # import concentions; {name} should be imported as {asname}
"LOG" , # flake8-logging
"N804" , # First argument of a class method should be named cls
"N805" , # First argument of a method should be named self
2026-05-26 23:23:39 +02:00
"N806" , # Variable {name} in function should be snake_case
2025-03-26 20:30:03 +01:00
"N815" , # Variable {name} in class scope should not be mixedCase
"PERF" , # Perflint
"PGH" , # pygrep-hooks
"PIE" , # flake8-pie
"PL" , # pylint
"PT" , # flake8-pytest-style
"PTH" , # flake8-pathlib
"PYI" , # flake8-pyi
"RET" , # flake8-return
"RSE" , # flake8-raise
2026-06-01 13:24:51 +02:00
"RUF" , # Ruff-specific rules (see `ignore` for exclusions)
2026-05-13 20:26:12 +02:00
"S107" , # Possible hardcoded password assigned to function default
2025-03-26 20:30:03 +01:00
"S102" , # Use of exec detected
"S103" , # bad-file-permissions
"S108" , # hardcoded-temp-file
2026-05-13 20:43:22 +02:00
"S301" , # suspicious-pickle-usage
2025-03-26 20:30:03 +01:00
"S306" , # suspicious-mktemp-usage
"S307" , # suspicious-eval-usage
"S313" , # suspicious-xmlc-element-tree-usage
"S314" , # suspicious-xml-element-tree-usage
"S315" , # suspicious-xml-expat-reader-usage
"S316" , # suspicious-xml-expat-builder-usage
"S317" , # suspicious-xml-sax-usage
"S318" , # suspicious-xml-mini-dom-usage
"S319" , # suspicious-xml-pull-dom-usage
"S601" , # paramiko-call
"S602" , # subprocess-popen-with-shell-equals-true
"S604" , # call-with-shell-equals-true
"S608" , # hardcoded-sql-expression
"S609" , # unix-command-wildcard-injection
"SIM" , # flake8-simplify
"SLF" , # flake8-self
"SLOT" , # flake8-slots
"T100" , # Trace found: {name} used
"T20" , # flake8-print
"TC" , # flake8-type-checking
"TID" , # Tidy imports
"TRY" , # tryceratops
"UP" , # pyupgrade
"UP031" , # Use format specifiers instead of percent format
"UP032" , # Use f-string instead of `format` call
"W" , # pycodestyle
2023-01-26 17:17:13 +01:00
]
2023-01-24 13:15:16 +02:00
ignore = [
2025-03-26 20:30:03 +01:00
"ASYNC109" , # Async function definition with a `timeout` parameter Use `asyncio.timeout` instead
"ASYNC110" , # Use `asyncio.Event` instead of awaiting `asyncio.sleep` in a `while` loop
2026-02-06 19:39:32 +01:00
"ASYNC240" , # Use an async function for entering the file system
2026-06-01 13:07:36 +02:00
"B008" , # Do not perform function call in argument defaults; commonly used in Home Assistant (e.g. cv.* validators)
"B019" , # Use of functools.lru_cache or functools.cache on methods can lead to memory leaks
2025-03-26 20:30:03 +01:00
"D202" , # No blank lines allowed after function docstring
"D203" , # 1 blank line required before class docstring
"D213" , # Multi-line docstring summary should start at the second line
"D406" , # Section name should end with a newline
"D407" , # Section name underlining
2025-11-25 16:48:37 +01:00
"D417" , # Missing argument descriptions in docstring - to allow documenting only non-obvious parameters
2025-03-26 20:30:03 +01:00
"E501" , # line too long
2023-10-02 21:49:10 +02:00
2025-03-26 20:30:03 +01:00
"PLC1901" , # {existing} can be simplified to {replacement} as an empty string is falsey; too many false positives
"PLR0911" , # Too many return statements ({returns} > {max_returns})
"PLR0912" , # Too many branches ({branches} > {max_branches})
"PLR0913" , # Too many arguments to function call ({c_args} > {max_args})
"PLR0915" , # Too many statements ({statements} > {max_statements})
2026-07-29 12:21:18 +02:00
"PLR0917" , # Too many positional arguments defined for a function ({p_args} > {max_args})
2025-03-26 20:30:03 +01:00
"PLR2004" , # Magic value used in comparison, consider replacing {value} with a constant variable
2026-02-06 19:39:32 +01:00
"PLW0108" , # Unnecessary lambda wrapping a function call; can often be replaced by the function itself
2025-06-19 20:39:09 +02:00
"PLW1641" , # __eq__ without __hash__
2025-03-26 20:30:03 +01:00
"PLW2901" , # Outer {outer_kind} variable {name} overwritten by inner {inner_kind} target
"PT011" , # pytest.raises({exception}) is too broad, set the `match` parameter or use a more specific exception
"PT018" , # Assertion should be broken down into multiple parts
"RUF001" , # String contains ambiguous unicode character.
2026-06-01 13:24:51 +02:00
"RUF012" , # Mutable class attributes should be annotated with typing.ClassVar
2025-03-26 20:30:03 +01:00
"RUF015" , # Prefer next(...) over single element slice
2026-06-01 13:24:51 +02:00
"RUF043" , # Pattern passed to match= contains metacharacters but is neither escaped nor raw
2025-03-26 20:30:03 +01:00
"SIM102" , # Use a single if statement instead of nested if statements
"SIM103" , # Return the condition {condition} directly
"SIM108" , # Use ternary operator {contents} instead of if-else-block
"SIM115" , # Use context handler for opening files
2024-08-28 18:51:50 +02:00
2025-03-26 20:30:03 +01:00
# Moving imports into type-checking blocks can mess with pytest.patch()
"TC001" , # Move application import {} into a type-checking block
"TC002" , # Move third-party import {} into a type-checking block
"TC003" , # Move standard library import {} into a type-checking block
# Quotes for typing.cast generally not necessary, only for performance critical paths
"TC006" , # Add quotes to type expression in typing.cast()
2024-08-28 18:01:41 +02:00
2025-03-26 20:30:03 +01:00
"TRY003" , # Avoid specifying long messages outside the exception class
"TRY400" , # Use `logging.exception` instead of `logging.error`
2025-09-10 20:48:31 +02:00
2025-06-19 20:39:09 +02:00
"UP047" , # Non PEP 696 generic function
"UP049" , # Avoid private type parameter names
2023-06-27 17:42:46 +02:00
2025-03-26 20:30:03 +01:00
# May conflict with the formatter, https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
"W191" ,
"E111" ,
"E114" ,
"E117" ,
"D206" ,
"D300" ,
"Q" ,
"COM812" ,
"COM819" ,
2024-01-05 11:46:45 +01:00
2025-03-26 20:30:03 +01:00
# Disabled because ruff does not understand type of __all__ generated by a function
"PLE0605" ,
2025-09-10 20:48:31 +02:00
2025-11-26 17:15:29 +00:00
"FURB116" ,
2026-07-29 12:21:18 +02:00
# Disabled to implement in follow up PRs after ruff 0.16 bump
"ISC004" ,
"LOG004" ,
2023-01-24 13:15:16 +02:00
]
2024-02-06 15:41:34 +01:00
[ tool . ruff . lint . flake8-import-conventions . extend-aliases ]
2023-02-09 13:41:50 +01:00
voluptuous = "vol"
2024-06-26 14:22:52 +02:00
"homeassistant.components.air_quality.PLATFORM_SCHEMA" = "AIR_QUALITY_PLATFORM_SCHEMA"
"homeassistant.components.alarm_control_panel.PLATFORM_SCHEMA" = "ALARM_CONTROL_PANEL_PLATFORM_SCHEMA"
"homeassistant.components.binary_sensor.PLATFORM_SCHEMA" = "BINARY_SENSOR_PLATFORM_SCHEMA"
"homeassistant.components.button.PLATFORM_SCHEMA" = "BUTTON_PLATFORM_SCHEMA"
"homeassistant.components.calendar.PLATFORM_SCHEMA" = "CALENDAR_PLATFORM_SCHEMA"
"homeassistant.components.camera.PLATFORM_SCHEMA" = "CAMERA_PLATFORM_SCHEMA"
"homeassistant.components.climate.PLATFORM_SCHEMA" = "CLIMATE_PLATFORM_SCHEMA"
"homeassistant.components.conversation.PLATFORM_SCHEMA" = "CONVERSATION_PLATFORM_SCHEMA"
"homeassistant.components.cover.PLATFORM_SCHEMA" = "COVER_PLATFORM_SCHEMA"
"homeassistant.components.date.PLATFORM_SCHEMA" = "DATE_PLATFORM_SCHEMA"
"homeassistant.components.datetime.PLATFORM_SCHEMA" = "DATETIME_PLATFORM_SCHEMA"
"homeassistant.components.device_tracker.PLATFORM_SCHEMA" = "DEVICE_TRACKER_PLATFORM_SCHEMA"
"homeassistant.components.event.PLATFORM_SCHEMA" = "EVENT_PLATFORM_SCHEMA"
"homeassistant.components.fan.PLATFORM_SCHEMA" = "FAN_PLATFORM_SCHEMA"
"homeassistant.components.geo_location.PLATFORM_SCHEMA" = "GEO_LOCATION_PLATFORM_SCHEMA"
"homeassistant.components.humidifier.PLATFORM_SCHEMA" = "HUMIDIFIER_PLATFORM_SCHEMA"
"homeassistant.components.image.PLATFORM_SCHEMA" = "IMAGE_PLATFORM_SCHEMA"
"homeassistant.components.image_processing.PLATFORM_SCHEMA" = "IMAGE_PROCESSING_PLATFORM_SCHEMA"
"homeassistant.components.lawn_mower.PLATFORM_SCHEMA" = "LAWN_MOWER_PLATFORM_SCHEMA"
"homeassistant.components.light.PLATFORM_SCHEMA" = "LIGHT_PLATFORM_SCHEMA"
"homeassistant.components.lock.PLATFORM_SCHEMA" = "LOCK_PLATFORM_SCHEMA"
"homeassistant.components.media_player.PLATFORM_SCHEMA" = "MEDIA_PLAYER_PLATFORM_SCHEMA"
2024-06-26 10:02:24 +02:00
"homeassistant.components.notify.PLATFORM_SCHEMA" = "NOTIFY_PLATFORM_SCHEMA"
2024-06-26 14:22:52 +02:00
"homeassistant.components.number.PLATFORM_SCHEMA" = "NUMBER_PLATFORM_SCHEMA"
"homeassistant.components.remote.PLATFORM_SCHEMA" = "REMOTE_PLATFORM_SCHEMA"
"homeassistant.components.scene.PLATFORM_SCHEMA" = "SCENE_PLATFORM_SCHEMA"
"homeassistant.components.select.PLATFORM_SCHEMA" = "SELECT_PLATFORM_SCHEMA"
"homeassistant.components.sensor.PLATFORM_SCHEMA" = "SENSOR_PLATFORM_SCHEMA"
"homeassistant.components.siren.PLATFORM_SCHEMA" = "SIREN_PLATFORM_SCHEMA"
"homeassistant.components.stt.PLATFORM_SCHEMA" = "STT_PLATFORM_SCHEMA"
"homeassistant.components.switch.PLATFORM_SCHEMA" = "SWITCH_PLATFORM_SCHEMA"
"homeassistant.components.text.PLATFORM_SCHEMA" = "TEXT_PLATFORM_SCHEMA"
"homeassistant.components.time.PLATFORM_SCHEMA" = "TIME_PLATFORM_SCHEMA"
"homeassistant.components.todo.PLATFORM_SCHEMA" = "TODO_PLATFORM_SCHEMA"
"homeassistant.components.tts.PLATFORM_SCHEMA" = "TTS_PLATFORM_SCHEMA"
"homeassistant.components.vacuum.PLATFORM_SCHEMA" = "VACUUM_PLATFORM_SCHEMA"
"homeassistant.components.valve.PLATFORM_SCHEMA" = "VALVE_PLATFORM_SCHEMA"
"homeassistant.components.update.PLATFORM_SCHEMA" = "UPDATE_PLATFORM_SCHEMA"
"homeassistant.components.wake_word.PLATFORM_SCHEMA" = "WAKE_WORD_PLATFORM_SCHEMA"
"homeassistant.components.water_heater.PLATFORM_SCHEMA" = "WATER_HEATER_PLATFORM_SCHEMA"
"homeassistant.components.weather.PLATFORM_SCHEMA" = "WEATHER_PLATFORM_SCHEMA"
2024-07-29 22:10:44 +02:00
"homeassistant.core.DOMAIN" = "HOMEASSISTANT_DOMAIN"
2023-03-01 18:40:26 +01:00
"homeassistant.helpers.area_registry" = "ar"
2024-03-15 13:25:16 +01:00
"homeassistant.helpers.category_registry" = "cr"
2023-02-09 13:41:50 +01:00
"homeassistant.helpers.config_validation" = "cv"
2023-03-01 18:40:26 +01:00
"homeassistant.helpers.device_registry" = "dr"
"homeassistant.helpers.entity_registry" = "er"
2024-02-17 21:21:15 +01:00
"homeassistant.helpers.floor_registry" = "fr"
2023-03-01 18:40:26 +01:00
"homeassistant.helpers.issue_registry" = "ir"
2024-02-19 11:59:08 +01:00
"homeassistant.helpers.label_registry" = "lr"
2025-01-21 15:58:23 +01:00
"homeassistant.util.color" = "color_util"
2023-05-30 23:30:31 +03:00
"homeassistant.util.dt" = "dt_util"
2025-01-21 15:58:23 +01:00
"homeassistant.util.json" = "json_util"
"homeassistant.util.location" = "location_util"
"homeassistant.util.logging" = "logging_util"
"homeassistant.util.network" = "network_util"
"homeassistant.util.ulid" = "ulid_util"
"homeassistant.util.uuid" = "uuid_util"
"homeassistant.util.yaml" = "yaml_util"
2023-02-09 13:41:50 +01:00
2024-02-06 15:41:34 +01:00
[ tool . ruff . lint . flake8-pytest-style ]
2023-01-26 18:05:05 +01:00
fixture-parentheses = false
2024-03-21 09:43:27 +01:00
mark-parentheses = false
2023-01-26 18:05:05 +01:00
2024-02-06 15:41:34 +01:00
[ tool . ruff . lint . flake8-tidy-imports . banned-api ]
2023-10-04 18:19:19 +02:00
"async_timeout" . msg = "use asyncio.timeout instead"
2023-08-18 20:10:29 +03:00
"pytz" . msg = "use zoneinfo instead"
2024-12-24 08:40:05 +01:00
"tests" . msg = "You should not import tests"
2026-05-05 18:42:10 +02:00
"__future__.annotations" . msg = "It should not be needed because Home Assistant requires Python 3.14+"
2023-08-18 20:10:29 +03:00
2024-02-06 15:41:34 +01:00
[ tool . ruff . lint . isort ]
2023-06-08 23:43:56 +02:00
force-sort-within-sections = true
2025-03-26 20:30:03 +01:00
known-first-party = [ "homeassistant" ]
2023-06-08 23:43:56 +02:00
combine-as-imports = true
2023-08-10 14:27:03 +02:00
split-on-trailing-comma = false
2023-06-08 23:43:56 +02:00
2024-02-06 15:41:34 +01:00
[ tool . ruff . lint . per-file-ignores ]
2023-01-24 13:15:16 +02:00
2023-01-24 14:24:21 +01:00
# Allow for main entry & scripts to write to stdout
"homeassistant/__main__.py" = [ "T201" ]
"homeassistant/scripts/*" = [ "T201" ]
"script/*" = [ "T20" ]
2026-05-26 23:23:39 +02:00
# Some utils have constants that benefit from being uppercase
"homeassistant/util/*" = [ "N806" ]
2024-09-20 12:25:51 +02:00
# Allow relative imports within auth and within components
"homeassistant/auth/*/*" = [ "TID252" ]
"homeassistant/components/*/*/*" = [ "TID252" ]
"tests/components/*/*/*" = [ "TID252" ]
2024-09-06 11:33:01 +02:00
# Temporary
"homeassistant/**" = [ "PTH" ]
"tests/**" = [ "PTH" ]
2024-02-06 15:41:34 +01:00
[ tool . ruff . lint . mccabe ]
2023-01-24 13:15:16 +02:00
max-complexity = 25
2024-10-03 13:11:02 -05:00
[ tool . ruff . lint . pydocstyle ]
2025-07-04 16:00:37 +02:00
convention = "google"
2025-01-21 08:58:22 -01:00
property-decorators = [ "propcache.api.cached_property" ]