Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
197 lines (177 loc) · 5.88 KB
/
Copy pathpyproject.toml
File metadata and controls
197 lines (177 loc) · 5.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
[build-system]
requires = ["setuptools==84.2.1", "wheel>=0.43,<0.49"]
build-backend = "setuptools.build_meta"
[project]
name = "esphome"
license = "MIT"
description = "ESPHome is a system to configure your microcontrollers by simple yet powerful configuration files and control them remotely through Home Automation systems."
readme = "README.md"
authors = [
{name = "The ESPHome Authors", email = "esphome@openhomefoundation.org"}
]
keywords = ["home", "automation"]
classifiers = [
"Environment :: Console",
"Intended Audience :: Developers",
"Intended Audience :: End Users/Desktop",
"Programming Language :: C++",
"Programming Language :: Python :: 3",
"Topic :: Home Automation",
]
requires-python = ">=3.12.0,<3.16"
dynamic = ["dependencies", "optional-dependencies", "version"]
[project.urls]
"Documentation" = "https://esphome.io"
"Source Code" = "https://github.com/esphome/esphome"
"Bug Tracker" = "https://github.com/esphome/esphome/issues"
"Feature Request Tracker" = "https://github.com/orgs/esphome/discussions"
"Discord" = "https://discord.gg/KhAMKrd"
"Forum" = "https://community.home-assistant.io/c/esphome"
"Twitter" = "https://twitter.com/esphome_"
[project.scripts]
esphome = "esphome.__main__:main"
[tool.setuptools]
platforms = ["any"]
zip-safe = false
include-package-data = true
[tool.setuptools.dynamic]
dependencies = {file = ["requirements.txt"]}
version = {attr = "esphome.const.__version__"}
[tool.setuptools.dynamic.optional-dependencies]
dev = { file = ["requirements_dev.txt"] }
test = { file = ["requirements_test.txt"] }
[tool.setuptools.packages.find]
include = ["esphome*"]
[tool.pytest.ini_options]
testpaths = [
"tests",
]
# Prepend the repo root so in-process esphome imports resolve to THIS tree,
# not wherever the venv's editable install points (e.g. another git worktree).
pythonpath = ["."]
addopts = [
"--cov=esphome",
"--cov-branch",
]
[tool.pylint.MAIN]
py-version = "3.12"
ignore = [
"api_pb2.py",
]
persistent = false
[tool.pylint.REPORTS]
score = false
[tool.pylint."MESSAGES CONTROL"]
disable = [
"format",
"missing-docstring",
"fixme",
"unused-argument",
"global-statement",
"too-few-public-methods",
"too-many-lines",
"too-many-locals",
"too-many-ancestors",
"too-many-branches",
"too-many-statements",
"too-many-arguments",
"too-many-positional-arguments",
"too-many-return-statements",
"too-many-instance-attributes",
"duplicate-code",
"invalid-name",
"cyclic-import",
"redefined-builtin",
"undefined-loop-variable",
"useless-object-inheritance",
"stop-iteration-return",
"import-outside-toplevel",
# Broken
"unsupported-membership-test",
"unsubscriptable-object",
]
[tool.pylint.FORMAT]
expected-line-ending-format = "LF"
[tool.ruff]
required-version = ">=0.5.0"
target-version = "py312"
exclude = ['generated']
[tool.ruff.lint]
# Preview mode is scoped: with explicit-preview-rules only rules named in
# select run in preview, prefixes like "PL" keep their stable set.
preview = true
explicit-preview-rules = true
select = [
"B", # flake8-bugbear
"BLE", # flake8-blind-except
"C4", # flake8-comprehensions
"D", # pydocstyle
"DTZ", # flake8-datetimez
"E", # pycodestyle
"EXE", # flake8-executable
"F", # pyflakes/autoflake
"FA", # flake8-future-annotations
"FLY", # flynt: convert string formatting to f-strings
"FURB", # refurb
"G", # flake8-logging-format
"I", # isort
"ICN", # flake8-import-conventions
"ISC", # flake8-implicit-str-concat
"LOG", # flake8-logging
"NPY", # numpy-specific rules
"PERF", # performance
"PGH", # pygrep-hooks
"PIE", # flake8-pie
"PL", # pylint
"PLW1514", # require explicit encoding on text file I/O (Windows defaults to cp1252)
"PTH", # flake8-use-pathlib
"PYI", # flake8-pyi
"Q", # flake8-quotes
"RSE", # flake8-raise
"SIM", # flake8-simplify
"SLOT", # flake8-slots
"RET", # flake8-ret
"T10", # flake8-debugger
"UP", # pyupgrade
"W", # pycodestyle warnings
"YTT", # flake8-2020
]
ignore = [
"D100", # Missing docstring in public module
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"D104", # Missing docstring in public package
"D105", # Missing docstring in magic method
"D107", # Missing docstring in __init__
"D200", # One-line docstring should fit on one line
"D202", # No blank lines allowed after function docstring
"D205", # 1 blank line required between summary line and description
"D209", # Multi-line docstring closing quotes should be on a separate line
"D400", # First line should end with a period
"D401", # First line should be in imperative mood
"D419", # Docstring is empty (not checked by pydocstyle 5.1.1)
"E501", # line too long
"PLC0415", # `import` should be at the top-level of a file
"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})
"PLR0917", # Too many positional arguments ({c_pos} > {max_pos})
"PLW1641", # Object does not implement `__hash__` method
"PLR2004", # Magic value used in comparison, consider replacing {value} with a constant variable
"PLW2901", # Outer {outer_kind} variable {name} overwritten by inner {inner_kind} target
]
[tool.ruff.lint.per-file-ignores]
# Docstring rules only apply to the esphome package and its tests.
"!{esphome,tests}/**" = ["D"]
"**/api_pb2.py" = ["D"]
[tool.ruff.lint.pydocstyle]
convention = "pep257"
[tool.ruff.lint.isort]
force-sort-within-sections = true
known-first-party = [
"esphome",
]
combine-as-imports = true
split-on-trailing-comma = false