-
Notifications
You must be signed in to change notification settings - Fork 77
/
pyproject.toml
259 lines (236 loc) · 6.64 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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
[build-system]
build-backend = "setuptools.build_meta"
requires = ["setuptools>=62.3"]
[project]
authors = [
{name = "The Home Assistant Authors", email = "[email protected]"},
]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Environment :: Console",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Home Automation",
]
dependencies = [
"aiohttp",
"aiorun",
"async-timeout",
"coloredlogs",
"orjson",
"home-assistant-chip-clusters==2024.9.0",
]
description = "Python Matter WebSocket Server"
license = {text = "Apache-2.0"}
name = "python-matter-server"
readme = "README.md"
requires-python = ">=3.11"
# The version is set by GH action on release!
version = "0.0.0"
[project.optional-dependencies]
server = [
"aiohttp==3.10.10",
"aiorun==2024.8.1",
"async-timeout==5.0.0",
"coloredlogs==15.0.1",
"cryptography==43.0.3",
"orjson==3.10.11",
"zeroconf==0.136.0",
"home-assistant-chip-core==2024.9.0",
]
test = [
"aioresponses==0.7.6",
"codespell==2.3.0",
"isort==5.13.2",
"mypy==1.11.2",
"pre-commit==4.0.1",
"pre-commit-hooks==5.0.0",
"pylint==3.3.1",
"pytest==8.3.3",
"pytest-asyncio==0.24.0",
"pytest-aiohttp==1.0.5",
"pytest-cov==6.0.0",
"ruff==0.7.2",
"tomli==2.0.2",
]
[project.scripts]
matter-server = "matter_server.server.__main__:main"
[tool.codespell]
ignore-words-list = "requestor"
skip = "dashboard/package-lock.json,tests/fixtures/nodes/lighting-example-app.json,dashboard/src/client/models/descriptions.ts"
[tool.setuptools]
include-package-data = true
platforms = ["any"]
zip-safe = false
[tool.setuptools.package-data]
matter_server = ["py.typed", "dashboard/**"]
[tool.setuptools.packages.find]
include = ["matter_server*"]
[tool.mypy]
check_untyped_defs = true
disallow_any_generics = false # TEMPORARY DISABLED
disallow_incomplete_defs = true
disallow_subclassing_any = true
disallow_untyped_calls = true
disallow_untyped_decorators = true
disallow_untyped_defs = true
follow_imports = "normal"
ignore_missing_imports = true
no_implicit_optional = true
no_implicit_reexport = true
platform = "linux"
python_version = "3.11"
strict_optional = true
warn_incomplete_stub = true
warn_no_return = true
warn_redundant_casts = true
warn_return_any = true
warn_unreachable = true
warn_unused_configs = true
warn_unused_ignores = true
[tool.pylint.MAIN]
extension-pkg-allow-list = [
"chip.*",
"orjson",
]
ignore-paths = [
"scripts/beautify_diagnostics.py", # TEMPORARY DISABLED
"scripts/generate_devices.py", # TEMPORARY DISABLED
]
[tool.pylint.BASIC]
good-names = [
"_",
"T",
]
[tool.pylint.DESIGN]
max-args = 10
max-attributes = 12
max-positional-arguments = 10
[tool.pylint."MESSAGES CONTROL"]
disable = [
"duplicate-code", # unavoidable
"format", # unavoidable
"unsubscriptable-object", # unavoidable
"unused-argument", # handled by ruff
"unspecified-encoding", # handled by ruff
"isinstance-second-argument-not-valid-type", # conflict with ruff
"fixme", # we're still developing
"too-few-public-methods", # unavoidable
]
[tool.pylint.SIMILARITIES]
ignore-imports = true
[tool.pylint.FORMAT]
max-line-length = 88
[tool.pytest.ini_options]
addopts = "--cov"
asyncio_mode = "auto"
[tool.ruff]
fix = true
line-length = 88
show-fixes = true
target-version = "py311"
[tool.ruff.lint.pydocstyle]
# Use Google-style docstrings.
convention = "pep257"
[tool.ruff.lint]
ignore = [
"ANN002", # Just annoying, not really useful
"ANN003", # Just annoying, not really useful
"ANN101", # Self... explanatory
"ANN401", # Opinioated warning on disallowing dynamically typed expressions
"D203", # Conflicts with other rules
"D213", # Conflicts with other rules
"D417", # False positives in some occasions
"EM102", # Just annoying, not really useful
"FIX002", # Just annoying, not really useful
"PLR2004", # Just annoying, not really useful
"PD011", # Just annoying, not really useful
"S101", # assert is often used to satisfy type checking
"TD002", # Just annoying, not really useful
"TD003", # Just annoying, not really useful
"TD004", # Just annoying, not really useful
"COM812", # Conflict with the Ruff formatter
"ISC001", # Conflict with the Ruff formatter
"TID252", # TEMPORARY DISABLED
"N805", # TEMPORARY DISABLED
"EXE002", # TEMPORARY DISABLED
"T201", # TEMPORARY DISABLED
"ANN201", # TEMPORARY DISABLED
"UP032", # TEMPORARY DISABLED
"E711", # TEMPORARY DISABLED
"E501", # TEMPORARY DISABLED
"D104", # TEMPORARY DISABLED
"B018", # TEMPORARY DISABLED
"FBT003", # TEMPORARY DISABLED
"PT012", # TEMPORARY DISABLED
"UP007", # TEMPORARY DISABLED
"D400", # TEMPORARY DISABLED
"D204", # TEMPORARY DISABLED
"PLW2901", # TEMPORARY DISABLED
"RET507", # TEMPORARY DISABLED
"INP001", # TEMPORARY DISABLED
"ARG001", # TEMPORARY DISABLED
"RUF006", # TEMPORARY DISABLED
"SIM108", # TEMPORARY DISABLED
"ANN001", # TEMPORARY DISABLED
"SIM117", # TEMPORARY DISABLED
"TRY003", # TEMPORARY DISABLED
"UP037", # TEMPORARY DISABLED
"UP006", # TEMPORARY DISABLED
"UP041", # TEMPORARY DISABLED
"D202", # TEMPORARY DISABLED
"FBT002", # TEMPORARY DISABLED
"FBT001", # TEMPORARY DISABLED
"PTH123", # TEMPORARY DISABLED
"ANN204", # TEMPORARY DISABLED
"EM102", # TEMPORARY DISABLED
"PLR0915", # TEMPORARY DISABLED
"EM101", # TEMPORARY DISABLED
"EM102", # TEMPORARY DISABLED
"ERA001", # TEMPORARY DISABLED
"PYI036", # TEMPORARY DISABLED
"ANN204", # TEMPORARY DISABLED
"N818", # TEMPORARY DISABLED
"N815", # TEMPORARY DISABLED
"N801", # TEMPORARY DISABLED
"N813", # TEMPORARY DISABLED
"RUF012", # TEMPORARY DISABLED
"ANN102", # TEMPORARY DISABLED
"B007", # TEMPORARY DISABLED
"SIM102", # TEMPORARY DISABLED
"C901", # TEMPORARY DISABLED
"PLR0911", # TEMPORARY DISABLED
"PLR0912", # TEMPORARY DISABLED
"SLF001", # TEMPORARY DISABLED
"RUF010", # TEMPORARY DISABLED
"TRY300", # TEMPORARY DISABLED
"UP038", # TEMPORARY DISABLED
"PTH118", # TEMPORARY DISABLED
"PTH112", # TEMPORARY DISABLED
"PTH102", # TEMPORARY DISABLED
"TRY400", # TEMPORARY DISABLED
"DTZ001", # TEMPORARY DISABLED
"TRY201", # TEMPORARY DISABLED
"A002", # TEMPORARY DISABLED
"DTZ003", # TEMPORARY DISABLED
"N803", # TEMPORARY DISABLED
"ARG002", # TEMPORARY DISABLED
"S104", # TEMPORARY DISABLED
"UP015", # TEMPORARY DISABLED
]
select = ["ALL"]
[tool.ruff.lint.flake8-pytest-style]
fixture-parentheses = false
mark-parentheses = false
[tool.ruff.lint.isort]
combine-as-imports = true
force-sort-within-sections = true
known-first-party = ["matter_server"]
[tool.ruff.lint.mccabe]
max-complexity = 25
[tool.ruff.lint.pylint]
max-args = 10
max-branches = 25
max-returns = 15
max-statements = 50