2022-01-28 22:09:05 +00:00
|
|
|
[build-system]
|
2022-05-25 02:01:27 +00:00
|
|
|
requires = ["setuptools~=62.3", "wheel~=0.37.1"]
|
2022-01-28 22:09:05 +00:00
|
|
|
build-backend = "setuptools.build_meta"
|
|
|
|
|
2022-05-25 02:01:27 +00:00
|
|
|
[project]
|
|
|
|
name = "homeassistant"
|
2023-01-25 19:50:44 +00:00
|
|
|
version = "2023.3.0.dev0"
|
2022-05-25 02:01:27 +00:00
|
|
|
license = {text = "Apache-2.0"}
|
|
|
|
description = "Open-source home automation platform running on Python 3."
|
|
|
|
readme = "README.rst"
|
|
|
|
authors = [
|
2022-05-26 00:54:49 +00:00
|
|
|
{name = "The Home Assistant Authors", email = "hello@home-assistant.io"}
|
2022-05-25 02:01:27 +00:00
|
|
|
]
|
|
|
|
keywords = ["home", "automation"]
|
|
|
|
classifiers = [
|
|
|
|
"Development Status :: 5 - Production/Stable",
|
|
|
|
"Intended Audience :: End Users/Desktop",
|
|
|
|
"Intended Audience :: Developers",
|
|
|
|
"License :: OSI Approved :: Apache Software License",
|
|
|
|
"Operating System :: OS Independent",
|
|
|
|
"Programming Language :: Python :: 3.10",
|
|
|
|
"Topic :: Home Automation",
|
|
|
|
]
|
2023-01-22 19:40:33 +00:00
|
|
|
requires-python = ">=3.10.0"
|
2022-05-26 00:54:49 +00:00
|
|
|
dependencies = [
|
2023-02-13 21:52:20 +00:00
|
|
|
"aiohttp==3.8.4",
|
2022-05-26 00:54:49 +00:00
|
|
|
"astral==2.2",
|
|
|
|
"async_timeout==4.0.2",
|
2022-12-29 14:09:39 +00:00
|
|
|
"attrs==22.2.0",
|
2022-07-08 21:17:56 +00:00
|
|
|
"atomicwrites-homeassistant==1.4.1",
|
2022-09-15 12:05:34 +00:00
|
|
|
"awesomeversion==22.9.0",
|
2023-01-21 16:16:28 +00:00
|
|
|
"bcrypt==4.0.1",
|
2022-05-26 00:54:49 +00:00
|
|
|
"certifi>=2021.5.30",
|
2022-12-22 20:01:59 +00:00
|
|
|
"ciso8601==2.3.0",
|
2022-05-26 00:54:49 +00:00
|
|
|
# When bumping httpx, please check the version pins of
|
|
|
|
# httpcore, anyio, and h11 in gen_requirements_all
|
2023-01-25 10:40:46 +00:00
|
|
|
"httpx==0.23.3",
|
2023-02-14 04:28:30 +00:00
|
|
|
"home-assistant-bluetooth==1.9.3",
|
2022-05-26 00:54:49 +00:00
|
|
|
"ifaddr==0.1.7",
|
|
|
|
"jinja2==3.1.2",
|
2022-07-10 22:11:43 +00:00
|
|
|
"lru-dict==1.1.8",
|
2022-09-20 18:17:49 +00:00
|
|
|
"PyJWT==2.5.0",
|
2022-05-26 00:54:49 +00:00
|
|
|
# PyJWT has loose dependency. We want the latest one.
|
2023-02-08 01:30:16 +00:00
|
|
|
"cryptography==39.0.1",
|
2023-01-14 00:58:01 +00:00
|
|
|
# pyOpenSSL 23.0.0 is required to work with cryptography 39+
|
|
|
|
"pyOpenSSL==23.0.0",
|
2023-02-14 20:26:52 +00:00
|
|
|
"orjson==3.8.6",
|
2023-02-03 20:02:35 +00:00
|
|
|
"pip>=21.0,<23.1",
|
2022-05-26 00:54:49 +00:00
|
|
|
"python-slugify==4.0.1",
|
|
|
|
"pyyaml==6.0",
|
2022-06-30 01:40:58 +00:00
|
|
|
"requests==2.28.1",
|
2023-02-16 10:21:54 +00:00
|
|
|
"typing-extensions>=4.5.0,<5.0",
|
2022-05-26 00:54:49 +00:00
|
|
|
"voluptuous==0.13.1",
|
2023-02-15 22:14:45 +00:00
|
|
|
"voluptuous-serialize==2.6.0",
|
2022-09-21 11:59:42 +00:00
|
|
|
"yarl==1.8.1",
|
2022-05-26 00:54:49 +00:00
|
|
|
]
|
2022-05-25 02:01:27 +00:00
|
|
|
|
|
|
|
[project.urls]
|
|
|
|
"Source Code" = "https://github.com/home-assistant/core"
|
|
|
|
"Bug Reports" = "https://github.com/home-assistant/core/issues"
|
|
|
|
"Docs: Dev" = "https://developers.home-assistant.io/"
|
|
|
|
"Discord" = "https://www.home-assistant.io/join-chat/"
|
|
|
|
"Forum" = "https://community.home-assistant.io/"
|
|
|
|
|
|
|
|
[project.scripts]
|
|
|
|
hass = "homeassistant.__main__:main"
|
|
|
|
|
|
|
|
[tool.setuptools]
|
|
|
|
platforms = ["any"]
|
|
|
|
zip-safe = false
|
|
|
|
include-package-data = true
|
|
|
|
|
|
|
|
[tool.setuptools.packages.find]
|
|
|
|
include = ["homeassistant*"]
|
|
|
|
|
2019-07-30 23:59:12 +00:00
|
|
|
[tool.black]
|
2022-12-04 22:12:37 +00:00
|
|
|
extend-exclude = "/generated/"
|
2020-10-06 09:26:48 +00:00
|
|
|
|
|
|
|
[tool.isort]
|
|
|
|
# https://github.com/PyCQA/isort/wiki/isort-Settings
|
|
|
|
profile = "black"
|
|
|
|
# will group `import x` and `from x import` of the same module.
|
|
|
|
force_sort_within_sections = true
|
|
|
|
known_first_party = [
|
|
|
|
"homeassistant",
|
|
|
|
"tests",
|
|
|
|
]
|
|
|
|
forced_separate = [
|
|
|
|
"tests",
|
|
|
|
]
|
|
|
|
combine_as_imports = true
|
|
|
|
|
2022-06-06 19:43:47 +00:00
|
|
|
[tool.pylint.MAIN]
|
2023-01-23 06:56:15 +00:00
|
|
|
py-version = "3.10"
|
2020-10-06 09:26:48 +00:00
|
|
|
ignore = [
|
|
|
|
"tests",
|
|
|
|
]
|
|
|
|
# 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 12:40:46 +00:00
|
|
|
jobs = 2
|
2022-01-29 22:47:40 +00: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 09:26:48 +00:00
|
|
|
load-plugins = [
|
2021-07-19 13:57:06 +00:00
|
|
|
"pylint.extensions.code_style",
|
2021-04-25 00:39:24 +00:00
|
|
|
"pylint.extensions.typing",
|
2022-01-24 12:38:56 +00:00
|
|
|
"hass_enforce_type_hints",
|
2021-05-22 08:15:30 +00:00
|
|
|
"hass_imports",
|
2021-05-20 17:00:10 +00:00
|
|
|
"hass_logger",
|
2023-01-22 16:26:24 +00:00
|
|
|
"pylint_per_file_ignores",
|
2020-10-06 09:26:48 +00:00
|
|
|
]
|
|
|
|
persistent = false
|
2021-07-10 20:58:37 +00:00
|
|
|
extension-pkg-allow-list = [
|
|
|
|
"av.audio.stream",
|
|
|
|
"av.stream",
|
2020-10-06 09:26:48 +00:00
|
|
|
"ciso8601",
|
2022-06-22 19:59:51 +00:00
|
|
|
"orjson",
|
2020-10-06 09:26:48 +00:00
|
|
|
"cv2",
|
|
|
|
]
|
2022-07-04 21:04:56 +00:00
|
|
|
fail-on = [
|
|
|
|
"I",
|
|
|
|
]
|
2020-10-06 09:26:48 +00:00
|
|
|
|
|
|
|
[tool.pylint.BASIC]
|
2021-03-30 04:02:56 +00:00
|
|
|
class-const-naming-style = "any"
|
2020-10-06 09:26:48 +00:00
|
|
|
good-names = [
|
|
|
|
"_",
|
|
|
|
"ev",
|
|
|
|
"ex",
|
|
|
|
"fp",
|
|
|
|
"i",
|
|
|
|
"id",
|
|
|
|
"j",
|
|
|
|
"k",
|
|
|
|
"Run",
|
2021-11-25 23:13:27 +00:00
|
|
|
"ip",
|
2020-10-06 09:26:48 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
[tool.pylint."MESSAGES CONTROL"]
|
|
|
|
# Reasons disabled:
|
|
|
|
# format - handled by black
|
|
|
|
# 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
|
2021-09-18 11:52:59 +00:00
|
|
|
# consider-using-f-string - str.format sometimes more readable
|
2021-07-19 13:57:06 +00:00
|
|
|
# ---
|
2023-02-02 11:49:01 +00: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 09:26:48 +00:00
|
|
|
disable = [
|
|
|
|
"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-branches",
|
|
|
|
"too-many-instance-attributes",
|
|
|
|
"too-many-lines",
|
|
|
|
"too-many-locals",
|
|
|
|
"too-many-public-methods",
|
|
|
|
"too-many-return-statements",
|
|
|
|
"too-many-statements",
|
|
|
|
"too-many-boolean-expressions",
|
|
|
|
"unused-argument",
|
|
|
|
"wrong-import-order",
|
2021-09-18 11:52:59 +00:00
|
|
|
"consider-using-f-string",
|
2021-07-19 13:57:06 +00:00
|
|
|
"consider-using-namedtuple-or-dataclass",
|
2021-09-18 11:52:59 +00:00
|
|
|
"consider-using-assignment-expr",
|
2020-10-06 09:26:48 +00:00
|
|
|
]
|
|
|
|
enable = [
|
|
|
|
#"useless-suppression", # temporarily every now and then to clean them up
|
|
|
|
"use-symbolic-message-instead",
|
|
|
|
]
|
|
|
|
|
|
|
|
[tool.pylint.REPORTS]
|
|
|
|
score = false
|
|
|
|
|
|
|
|
[tool.pylint.TYPECHECK]
|
|
|
|
ignored-classes = [
|
|
|
|
"_CountingAttr", # for attrs
|
|
|
|
]
|
2021-11-25 23:13:27 +00:00
|
|
|
mixin-class-rgx = ".*[Mm]ix[Ii]n"
|
2020-10-06 09:26:48 +00:00
|
|
|
|
|
|
|
[tool.pylint.FORMAT]
|
|
|
|
expected-line-ending-format = "LF"
|
|
|
|
|
|
|
|
[tool.pylint.EXCEPTIONS]
|
|
|
|
overgeneral-exceptions = [
|
2023-02-02 11:49:01 +00:00
|
|
|
"builtins.BaseException",
|
|
|
|
"builtins.Exception",
|
|
|
|
# "homeassistant.exceptions.HomeAssistantError", # too many issues
|
2020-10-06 09:26:48 +00:00
|
|
|
]
|
|
|
|
|
2021-04-25 00:39:24 +00:00
|
|
|
[tool.pylint.TYPING]
|
|
|
|
runtime-typing = false
|
|
|
|
|
2021-09-18 11:52:59 +00:00
|
|
|
[tool.pylint.CODE_STYLE]
|
|
|
|
max-line-length-suggestions = 72
|
|
|
|
|
2023-01-22 16:26:24 +00:00
|
|
|
[tool.pylint-per-file-ignores]
|
2023-01-27 11:51:58 +00:00
|
|
|
# hass-component-root-import: Tests test non-public APIs
|
|
|
|
# protected-access: Tests do often test internals a lot
|
|
|
|
# redefined-outer-name: Tests reference fixtures in the test function
|
|
|
|
"/tests/"="hass-component-root-import,protected-access,redefined-outer-name"
|
2023-01-22 16:26:24 +00:00
|
|
|
|
2020-10-06 09:26:48 +00:00
|
|
|
[tool.pytest.ini_options]
|
|
|
|
testpaths = [
|
|
|
|
"tests",
|
|
|
|
]
|
|
|
|
norecursedirs = [
|
|
|
|
".git",
|
|
|
|
"testing_config",
|
|
|
|
]
|
2022-04-05 08:10:16 +00: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"
|
2022-11-29 21:36:36 +00:00
|
|
|
asyncio_mode = "auto"
|
2023-02-17 18:17:06 +00:00
|
|
|
filterwarnings = ["error::sqlalchemy.exc.SAWarning"]
|
2023-01-24 11:15:16 +00:00
|
|
|
|
|
|
|
[tool.ruff]
|
|
|
|
target-version = "py310"
|
2023-01-26 16:17:13 +00:00
|
|
|
|
|
|
|
select = [
|
|
|
|
"C", # complexity
|
|
|
|
"D", # docstrings
|
|
|
|
"E", # pycodestyle
|
|
|
|
"F", # pyflakes/autoflake
|
2023-02-15 22:14:45 +00:00
|
|
|
"ICN001", # import concentions; {name} should be imported as {asname}
|
2023-01-26 17:05:05 +00:00
|
|
|
"PGH004", # Use specific rule codes when using noqa
|
2023-01-27 15:32:04 +00:00
|
|
|
"PLC0414", # Useless import alias. Import alias does not rename original package.
|
2023-01-27 02:06:22 +00:00
|
|
|
"SIM105", # Use contextlib.suppress({exception}) instead of try-except-pass
|
2023-01-27 10:52:49 +00:00
|
|
|
"SIM117", # Merge with-statements that use the same scope
|
2023-02-15 11:39:12 +00:00
|
|
|
"SIM118", # Use {key} in {dict} instead of {key} in {dict}.keys()
|
2023-02-15 13:43:02 +00:00
|
|
|
"SIM201", # Use {left} != {right} instead of not {left} == {right}
|
2023-02-15 14:22:34 +00:00
|
|
|
"SIM212", # Use {a} if {a} else {b} instead of {b} if not {a} else {a}
|
2023-01-30 10:03:23 +00:00
|
|
|
"SIM300", # Yoda conditions. Use 'age == 42' instead of '42 == age'.
|
2023-01-27 12:08:44 +00:00
|
|
|
"SIM401", # Use get from dict with default instead of an if block
|
2023-01-26 16:17:13 +00:00
|
|
|
"T20", # flake8-print
|
2023-01-30 13:06:52 +00:00
|
|
|
"TRY004", # Prefer TypeError exception for invalid type
|
2023-01-26 16:17:13 +00:00
|
|
|
"UP", # pyupgrade
|
2023-01-26 17:05:05 +00:00
|
|
|
"W", # pycodestyle
|
2023-01-26 16:17:13 +00:00
|
|
|
]
|
2023-01-24 11:15:16 +00:00
|
|
|
|
|
|
|
ignore = [
|
|
|
|
"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
|
|
|
|
"D404", # First word of the docstring should not be This
|
|
|
|
"D406", # Section name should end with a newline
|
|
|
|
"D407", # Section name underlining
|
|
|
|
"D411", # Missing blank line before section
|
|
|
|
"E501", # line too long
|
|
|
|
"E731", # do not assign a lambda expression, use a def
|
|
|
|
]
|
|
|
|
|
2023-02-09 12:41:50 +00:00
|
|
|
[tool.ruff.flake8-import-conventions.extend-aliases]
|
|
|
|
voluptuous = "vol"
|
|
|
|
"homeassistant.helpers.config_validation" = "cv"
|
|
|
|
|
2023-01-26 17:05:05 +00:00
|
|
|
[tool.ruff.flake8-pytest-style]
|
|
|
|
fixture-parentheses = false
|
|
|
|
|
2023-02-04 19:42:36 +00:00
|
|
|
[tool.ruff.pyupgrade]
|
|
|
|
keep-runtime-typing = true
|
|
|
|
|
2023-01-24 11:15:16 +00:00
|
|
|
[tool.ruff.per-file-ignores]
|
|
|
|
|
|
|
|
# TODO: these files have functions that are too complex, but flake8's and ruff's
|
|
|
|
# complexity (and/or nested-function) handling differs; trying to add a noqa doesn't work
|
|
|
|
# because the flake8-noqa plugin then disagrees on whether there should be a C901 noqa
|
|
|
|
# on that line. So, for now, we just ignore C901s on these files as far as ruff is concerned.
|
|
|
|
|
|
|
|
"homeassistant/components/light/__init__.py" = ["C901"]
|
|
|
|
"homeassistant/components/mqtt/discovery.py" = ["C901"]
|
|
|
|
"homeassistant/components/websocket_api/http.py" = ["C901"]
|
|
|
|
|
2023-01-24 13:24:21 +00:00
|
|
|
# Allow for main entry & scripts to write to stdout
|
|
|
|
"homeassistant/__main__.py" = ["T201"]
|
|
|
|
"homeassistant/scripts/*" = ["T201"]
|
|
|
|
"script/*" = ["T20"]
|
|
|
|
|
2023-01-24 11:15:16 +00:00
|
|
|
[tool.ruff.mccabe]
|
|
|
|
max-complexity = 25
|