-
Notifications
You must be signed in to change notification settings - Fork 1
/
pyproject.toml
418 lines (392 loc) · 13.8 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
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
[tool.black]
target-version = ["py39"]
[tool.coverage.report]
exclude_lines = ["raise NotImplementedError", "TYPE_CHECKING", "# pragma: no cover"]
fail_under = 100
show_missing = true
[tool.coverage.run]
source = ["aioguardian"]
[tool.isort]
known_first_party = "aioguardian,examples,tests"
multi_line_output = 3
profile = "black"
[tool.mypy]
check_untyped_defs = true
disallow_incomplete_defs = true
disallow_subclassing_any = true
disallow_untyped_calls = true
disallow_untyped_decorators = true
disallow_untyped_defs = true
follow_imports = "silent"
ignore_missing_imports = true
no_implicit_optional = true
platform = "linux"
python_version = "3.10"
show_error_codes = true
strict_equality = true
warn_incomplete_stub = true
warn_redundant_casts = true
warn_return_any = true
warn_unreachable = true
warn_unused_configs = true
warn_unused_ignores = true
[tool.poetry]
name = "aioguardian"
version = "2023.12.0"
description = "A Python3 library for Elexa Guardian water valves and sensors"
readme = "README.md"
authors = ["Aaron Bach <[email protected]>"]
license = "MIT"
repository = "https://github.com/bachya/aioguardian"
classifiers = [
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]
[tool.poetry.dependencies]
aiohttp = ">=3.9.0"
asyncio_dgram = "^2.0.0"
certifi = ">=2023.07.22"
frozenlist = "^1.4.0"
python = "^3.10"
voluptuous = ">=0.11.7"
yarl = ">=1.9.2"
[tool.poetry.group.dev.dependencies]
GitPython = ">=3.1.35"
Pygments = ">=2.15.0"
aresponses = ">=2.1.6,<4.0.0"
asynctest = "^0.13.0"
blacken-docs = "^1.12.1"
codespell = "^2.2.2"
coverage = {version = ">=6.5,<8.0", extras = ["toml"]}
darglint = "^1.8.1"
isort = "^5.10.1"
mypy = "^1.2.0"
pre-commit = ">=2.20,<5.0"
pre-commit-hooks = ">=4.3,<6.0"
pylint = ">=2.15.5,<4.0.0"
pytest = ">=7.2,<9.0"
pytest-aiohttp = "^1.0.0"
pytest-asyncio = ">=0.20.1,<0.25.0"
pytest-cov = ">=4,<7"
pyupgrade = "^3.1.0"
pyyaml = "^6.0.1"
requests = ">=2.31.0"
ruff = ">=0.5.1,<0.7.4"
sphinx-rtd-theme = ">=1,<4"
yamllint = "^1.28.0"
[tool.poetry.group.docs.dependencies]
Sphinx = ">=5,<9"
myst-parser = ">=0.18,<4.1"
[tool.poetry.urls]
"Bug Tracker" = "https://github.com/bachya/aioguardian/issues"
Changelog = "https://github.com/bachya/aioguardian/releases"
[tool.pylint.BASIC]
class-const-naming-style = "any"
expected-line-ending-format = "LF"
[tool.pylint.DESIGN]
max-attributes = 20
[tool.pylint.FORMAT]
max-line-length = 88
[tool.pylint.MAIN]
py-version = "3.12"
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.
jobs = 2
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'))
) \
"""
load-plugins = [
"pylint.extensions.code_style",
"pylint.extensions.typing",
]
persistent = false
fail-on = [
"I",
]
[tool.pylint."MESSAGES CONTROL"]
disable = [
# These are subjective and should be left up to the developer:
"too-many-arguments",
"too-many-lines",
"too-many-locals",
"duplicate-code",
# Handled by ruff:
# Ref: <https://github.com/astral-sh/ruff/issues/970>
"anomalous-backslash-in-string", # W605
"assert-on-string-literal", # PLW0129
"assert-on-tuple", # F631
"await-outside-async", # PLE1142
"bad-classmethod-argument", # N804
"bad-format-string", # W1302, F
"bad-format-string-key", # W1300, F
"bad-str-strip-call", # PLE1310
"bad-string-format-type", # PLE1307
"bare-except", # E722
"bidirectional-unicode", # PLE2502
"binary-op-exception", # PLW0711
"broad-exception-caught", # W0718
"cell-var-from-loop", # B023
"comparison-of-constants", # PLR0133
"comparison-with-itself", # PLR0124
"consider-alternative-union-syntax", # UP007
"consider-iterating-dictionary", # SIM118
"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
"continue-in-finally", # PLE0116
"duplicate-bases", # PLE0241
"duplicate-except", # B014
"duplicate-key", # F601
"duplicate-string-formatting-argument", # F
"duplicate-value", # F
"empty-docstring", # D419
"eval-used", # S307
"exec-used", # S102
"expression-not-assigned", # B018
"f-string-without-interpolation", # F541
"forgotten-debug-statement", # T100
"format-needs-mapping", # F502
"format-string-without-interpolation", # F
"function-redefined", # F811
"global-variable-not-assigned", # PLW0602
"implicit-str-concat", # ISC001
"import-self", # PLW0406
"inconsistent-quotes", # Q000
"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
"invalid-envvar-default", # PLW1508
"invalid-name", # N815
"keyword-arg-before-vararg", # B026
"line-too-long", # E501
"literal-comparison", # F632
"logging-format-interpolation", # G
"logging-fstring-interpolation", # G
"logging-not-lazy", # G
"logging-too-few-args", # PLE1206
"logging-too-many-args", # PLE1205
"misplaced-future", # F404
"missing-class-docstring", # D101
"missing-final-newline", # W292
"missing-format-string-key", # F524
"missing-function-docstring", # D103
"missing-module-docstring", # D100
"mixed-format-string", # F506
"multiple-imports", #E401
"named-expr-without-context", # PLW0131
"nested-min-max", # PLW3301
"no-method-argument", # N805
"no-self-argument", # N805
"nonexistent-operator", # B002
"nonlocal-without-binding", # PLE0117
"not-in-loop", # F701, F702
"notimplemented-raised", # F901
"pointless-statement", # B018
"property-with-parameters", # PLR0206
"raise-missing-from", # B904
"return-in-init", # PLE0101
"return-outside-function", # F706
"singleton-comparison", # E711, E712
"subprocess-run-check", # PLW1510
"super-with-arguments", # UP008
"superfluous-parens", # UP034
"syntax-error", # E999
"too-few-format-args", # F524
"too-many-branches", # PLR0912
"too-many-format-args", # F522
"too-many-return-statements", # PLR0911
"too-many-star-expressions", # F622
"too-many-statements", # PLR0915
"trailing-comma-tuple", # COM818
"truncated-format-string", # F501
"try-except-raise", # TRY302
"undefined-all-variable", # F822
"undefined-variable", # F821
"ungrouped-imports", # I001
"unidiomatic-typecheck", # E721
"unnecessary-comprehension", # C416
"unnecessary-direct-lambda-call", # PLC3002
"unnecessary-lambda-assignment", # PLC3001
"unnecessary-pass", # PIE790
"unneeded-not", # SIM208
"unused-argument", # ARG001
"unused-format-string-argument", # F507
"unused-format-string-key", # F504
"unused-import", # F401
"unused-variable", # F841
"use-a-generator", # C417
"use-dict-literal", # C406
"use-list-literal", # C405
"used-prior-global-declaration", # PLE0118
"useless-else-on-loop", # PLW0120
"useless-import-alias", # PLC0414
"useless-object-inheritance", # UP004
"useless-return", # PLR1711
"wildcard-import", # F403
"wrong-import-order", # I001
"wrong-import-position", # E402
"yield-inside-async-function", # PLE1700
"yield-outside-function", # F704
# 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",
"invalid-slots-object",
"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",
]
enable = [
"useless-suppression",
"use-symbolic-message-instead",
]
[tool.pylint.TYPING]
runtime-typing = false
[tool.pylint.CODE_STYLE]
max-line-length-suggestions = 72
[tool.ruff.lint]
select = [
"ALL"
]
ignore = [
"ANN101", # Missing type annotation for self
"D202", # No blank lines allowed after function docstring
"D203", # 1 blank line required before class docstring
"PLR0913", # This is subjective
"PLW2901", # Outer {outer_kind} variable {name} overwritten by inner {inner_kind} target
"PT012", # `pytest.raises()` block should contain a single simple statement
"TCH", # flake8-type-checking
# May conflict with the formatter:
# https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
"COM812",
"COM819",
"D206",
"D300",
"E111",
"E114",
"E117",
"ISC001",
"ISC002",
"Q000",
"Q001",
"Q002",
"Q003",
"W191",
]
[tool.ruff.lint.isort]
force-sort-within-sections = true
known-first-party = [
"aioguardian",
"examples",
"tests",
]
combine-as-imports = true
split-on-trailing-comma = false
[tool.ruff.lint.per-file-ignores]
"aioambient/util/climate_utils.py" = [
"PLR2004", # Climate utils utilize a ton of inline constants
]
"tests/*" = [
"ARG001", # Tests ofen have unused arguments
"FBT001", # Test fixtures may be boolean values
"PLR2004", # Checking for magic values in tests isn't helpful
"S101", # Assertions are fine in tests
"SLF001", # We'll access a lot of private third-party members in tests
]