forked from zigpy/zha-device-handlers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
201 lines (179 loc) · 5.72 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
[build-system]
requires = ["setuptools>=61.0.0", "wheel", "setuptools-git-versioning<2"]
build-backend = "setuptools.build_meta"
[project]
name = "zha-quirks"
dynamic = ["version"]
description = "Library implementing Zigpy quirks for ZHA in Home Assistant"
urls = {repository = "https://github.com/zigpy/zha-device-handlers"}
authors = [
{name = "David F. Mulcahey", email = "[email protected]"}
]
readme = "README.md"
license = {text = "Apache License Version 2.0"}
requires-python = ">=3.8"
dependencies = [
"zigpy>=0.56.0",
]
[tool.setuptools.packages.find]
exclude = ["tests", "tests.*"]
[project.optional-dependencies]
testing = [
"pytest",
]
[tool.setuptools-git-versioning]
enabled = true
[tool.isort]
# https://github.com/timothycrosley/isort
# https://github.com/timothycrosley/isort/wiki/isort-Settings
# splits long import on multiple lines indented by 4 spaces
profile = "black"
# by default isort don't check module indexes
not_skip = ["__init__.py"]
# will group `import x` and `from x import` of the same module.
force_sort_within_sections = true
sections = ["FUTURE", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"]
default_section = "THIRDPARTY"
known_first_party = ["zhaquirks", "tests"]
forced_separate = "tests"
combine_as_imports = true
use_parentheses = true
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
line_length = 88
indent = " "
[tool.mypy]
python_version = "3.9"
check_untyped_defs = true
disallow_incomplete_defs = true
disallow_untyped_calls = true
disallow_untyped_defs = true
follow_imports = "silent"
ignore_missing_imports = true
no_implicit_optional = 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
show_error_codes = true
show_error_context = true
error_summary = true
install_types = true
non_interactive = true
disable_error_code = [
"arg-type",
"assignment",
"attr-defined",
"call-arg",
"dict-item",
"index",
"misc",
"no-any-return",
"no-untyped-call",
"no-untyped-def",
"override",
"return-value",
"union-attr",
"var-annotated",
]
[tool.pytest.ini_options]
asyncio_mode = "auto"
testpaths = "tests"
norecursedirs = ".git testing_config"
[tool.flake8]
exclude = [".venv", ".git", ".tox", "docs", "venv", "bin", "lib", "deps", "build"]
# To work with Black
max-line-length = 88
ignore = [
"E501", # E501: line too long
"W503", # W503: Line break occurred before a binary operator
"E203", # E203: Whitespace before ':'
"D202", # D202 No blank lines allowed after function docstring
]
[tool.autoflake]
in-place = true
recursive = false
expand-star-imports = false
exclude = [".venv", ".git", ".tox", "docs", "venv", "bin", "lib", "deps", "build"]
[tool.pydocstyle]
ignore = [
"D202",
"D203",
"D213",
]
[tool.pyupgrade]
py37plus = true
[tool.codespell]
exclude = "pyproject.toml"
ignore-words-list = "hass,dout"
skip = "./.*,test/*"
quiet-level = 2
[tool.ruff]
target-version = "py38"
select = [
"B007", # Loop control variable {name} not used within loop body
"B014", # Exception handler with duplicate exception
"C", # complexity
"D", # docstrings
"E", # pycodestyle
"F", # pyflakes/autoflake
"ICN001", # import concentions; {name} should be imported as {asname}
"PGH004", # Use specific rule codes when using noqa
"PLC0414", # Useless import alias. Import alias does not rename original package.
"SIM105", # Use contextlib.suppress({exception}) instead of try-except-pass
"SIM117", # Merge with-statements that use the same scope
"SIM118", # Use {key} in {dict} instead of {key} in {dict}.keys()
"SIM201", # Use {left} != {right} instead of not {left} == {right}
"SIM212", # Use {a} if {a} else {b} instead of {b} if not {a} else {a}
"SIM300", # Yoda conditions. Use 'age == 42' instead of '42 == age'.
"SIM401", # Use get from dict with default instead of an if block
"T20", # flake8-print
"TRY004", # Prefer TypeError exception for invalid type
"RUF006", # Store a reference to the return value of asyncio.create_task
"UP", # pyupgrade
"W", # pycodestyle
]
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
"D106", # Missing docstring in public nested class
"D107", # Missing docstring in `__init__`
"D202", # No blank lines allowed after function docstring
"D203", # 1 blank line required before class docstring
"D205", # 1 blank line required between summary line and description
"D213", # Multi-line docstring summary should start at the second line
"D400", # First line should end with a period
"D401", # First line of docstring should be in imperative mood:
"D406", # Section name should end with a newline
"D407", # Section name underlining
"D415", # First line should end with a period, question mark, or exclamation point
"E501", # line too long
# the rules below this line should be corrected
"PGH004", # Use specific rule codes when using `noqa`
]
extend-exclude = [
"tests"
]
[tool.ruff.flake8-pytest-style]
fixture-parentheses = false
[tool.ruff.pyupgrade]
keep-runtime-typing = true
[tool.ruff.isort]
# will group `import x` and `from x import` of the same module.
force-sort-within-sections = true
known-first-party = [
"zhaquirks",
"tests",
]
forced-separate = ["tests"]
combine-as-imports = true
[tool.ruff.mccabe]
max-complexity = 25