-
Notifications
You must be signed in to change notification settings - Fork 3
/
pyproject.toml
213 lines (194 loc) · 6.47 KB
/
pyproject.toml
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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
[build-system]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"
[project]
name = "homeassistant-stubs"
description = "PEP 484 typing stubs for Home Assistant Core"
authors = [{name = "Ruslan Sayfutdinov", email = "ruslan@sayfutdinov.com"}]
readme = "README.md"
license = {text = "MIT"}
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.12",
"Topic :: Home Automation",
"Topic :: Software Development",
"Typing :: Typed",
]
keywords = ["homeassistant", "typing", "pep484"]
# Forbid 3.14 because of home-assistant-bluetooth package.
requires-python = ">=3.12,<3.14"
dynamic = ["version"]
dependencies = [
"homeassistant==2024.11.2",
]
[dependency-groups]
dev = [
"awesomeversion>=24.6.0",
"codespell>=2.3.0",
"mypy>=1.13.0",
"pygithub>=2.4.0",
"pylint>=3.3.1",
"ruff>=0.7.0",
"types-requests>=2.31.0.6",
]
[project.urls]
"Homepage" = "https://github.com/KapJI/homeassistant-stubs"
"Bug Tracker" = "https://github.com/KapJI/homeassistant-stubs/issues"
"Release Notes" = "https://github.com/KapJI/homeassistant-stubs/releases"
[tool.hatch.build]
packages = ["homeassistant-stubs"]
[tool.hatch.version]
source = "vcs"
[tool.uv.sources]
mypy = { git = "https://github.com/python/mypy", rev = "3e52d0c1d37344a58c53d4b7a0920b4e38ebedff" }
[tool.pylint.format]
expected-line-ending-format = "LF"
max-line-length = 88
[tool.pylint.basic]
good-names = ["ex", "fp", "i"]
[tool.pylint.messages_control]
disable = [
"duplicate-code",
"format",
"invalid-unary-operand-type",
"too-few-public-methods",
"too-many-arguments",
"too-many-branches",
"too-many-instance-attributes",
"too-many-locals",
"too-many-positional-arguments",
"too-many-return-statements",
"too-many-statements",
"wrong-import-order",
"consider-using-namedtuple-or-dataclass",
"consider-using-assignment-expr",
]
[tool.pylint.main]
py-version = "3.12"
load-plugins = [
"pylint.extensions.code_style",
"pylint.extensions.typing",
]
[tool.pylint.typing]
runtime-typing = false
[tool.pylint.code_style]
max-line-length-suggestions = 72
[tool.ruff]
required-version = ">=0.6.0"
target-version = "py312"
[tool.ruff.lint]
select = [
"A001", # Variable {name} is shadowing a Python builtin
"ASYNC", # flake8-async
"B", # flake8-bugbear
"BLE",
"C", # complexity, including flake8-comprehensions
"COM818", # Trailing comma on bare tuple prohibited
"D", # flake8-docstrings
"DTZ003", # Use datetime.now(tz=) instead of datetime.utcnow()
"DTZ004", # Use datetime.fromtimestamp(ts, tz=) instead of datetime.utcfromtimestamp(ts)
"E", # pycodestyle
"F", # pyflakes/autoflake
"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
"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-use-pathlib
"PYI", # flake8-pyi
"RET", # flake8-return
"RSE", # flake8-raise
"RUF005", # Consider iterable unpacking instead of concatenation
"RUF006", # Store a reference to the return value of asyncio.create_task
"RUF010", # Use explicit conversion flag
"RUF013", # PEP 484 prohibits implicit Optional
"RUF017", # Avoid quadratic list summation
"RUF018", # Avoid assignment expressions in assert statements
"RUF019", # Unnecessary key check before dictionary access
# "RUF100", # Unused `noqa` directive; temporarily every now and then to clean them up
"S102", # Use of exec detected
"S103", # bad-file-permissions
"S108", # hardcoded-temp-file
"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
"S320", # suspicious-xmle-tree-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
"TCH", # flake8-type-checking
"TID251", # Banned imports
"TRY", # tryceratops
"UP", # pyupgrade
"W", # pycodestyle
]
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
"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})
"PLW2901", # Outer {outer_kind} variable {name} overwritten by inner {inner_kind} target
"TRY003", # Avoid specifying long messages outside the exception class
# May conflict with the formatter, https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
"W191",
"E111",
"E114",
"E117",
"D206",
"D300",
"Q",
"COM812",
"COM819",
"ISC001",
]
[tool.ruff.lint.isort]
force-sort-within-sections = true
combine-as-imports = true
split-on-trailing-comma = false
[tool.ruff.lint.flake8-pytest-style]
fixture-parentheses = false
mark-parentheses = false
[tool.ruff.lint.mccabe]
max-complexity = 25
[tool.mypy]
python_version = "3.12"
show_error_codes = true
strict = true
disallow_any_explicit = true
disallow_any_unimported = true
show_none_errors = true
warn_no_return = true
warn_unreachable = true
[tool.codespell]
quiet-level = 2
skip = "uv.lock,./.git/*,./.mypy_cache/*,./.venv/*,./dist/*,./env/*,*.egg-info,./homeassistant_core/*,./homeassistant-stubs/*"
ignore-words-list = "hass"