forked from zigpy/zigpy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
183 lines (162 loc) · 4.7 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
[build-system]
requires = ["setuptools>=61.0.0", "wheel", "setuptools-git-versioning<2"]
build-backend = "setuptools.build_meta"
[project]
name = "zigpy"
dynamic = ["version"]
description = "Library implementing a Zigbee stack"
urls = {repository = "https://github.com/zigpy/zigpy"}
authors = [
{name = "Russell Cloran", email = "[email protected]"}
]
readme = "README.md"
license = {text = "GPL-3.0"}
requires-python = ">=3.8"
dependencies = [
"attrs",
"aiohttp",
"aiosqlite>=0.20.0",
"async_timeout",
"crccheck",
"cryptography",
'importlib_resources; python_version<"3.9"',
'async-timeout; python_version<"3.11"',
"voluptuous",
"jsonschema",
'pyserial-asyncio; platform_system!="Windows"',
'pyserial-asyncio!=0.5; platform_system=="Windows"',
"typing_extensions",
]
[tool.setuptools.packages.find]
exclude = ["tests", "tests.*"]
[tool.setuptools.package-data]
"*" = ["appdb_schemas/schema_v*.sql"]
[project.optional-dependencies]
testing = [
"tomli",
"asynctest",
"coveralls",
"coverage[toml]",
"pytest",
"pytest-asyncio",
"pytest-cov",
"pytest-timeout",
"freezegun",
'pysqlite3-binary; platform_system=="Linux" and python_version<"3.12"',
]
[tool.setuptools-git-versioning]
enabled = true
[tool.pytest.ini_options]
asyncio_mode = "auto"
[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
"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
"RUF006", # Store a reference to the return value of asyncio.create_task
"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
"D406", # Section name should end with a newline
"D407", # Section name underlining
"E501", # line too long
"E731", # do not assign a lambda expression, use a def
"SIM117", # Use a single `with` statement with multiple contexts
"D", # FIXME: docstrings
"C901", # is too complex (15 > 10)
]
exclude = [
".venv",
".git",
".tox",
"docs",
"venv",
"bin",
"lib",
"deps",
"build",
]
line-length = 88
[tool.ruff.per-file-ignores]
"tests/*.py" = ["F811"]
"zigpy/ota/provider.py" = ["SIM117"]
[tool.pyupgrade]
py38plus = true
[tool.autoflake8]
in-place = true
recursive = false
expand-star-imports = false
exclude = [".venv", ".git", ".tox", "docs", "venv", "bin", "lib", "deps", "build"]
[tool.flake8]
exclude = [".venv", ".git", ".tox", "docs", "venv", "bin", "lib", "deps", "build"]
# To work with Black
max-line-length = 88
ignore = [
"W503", # W503: Line break occurred before a binary operator
"E203", # E203: Whitespace before ':'
"E501", # E501: line too long
]
per-file-ignores = """
tests/*.py: F811
"""
[tool.isort]
profile = "black"
# will group `import x` and `from x import` of the same module.
force_sort_within_sections = true
known_first_party = ["zigpy", "tests"]
forced_separate = "tests"
combine_as_imports = true
[tool.codespell]
ignore-words-list = "ser,nd,hass"
skip = "./.*,tests/*,pyproject.toml"
quiet-level = 2
[tool.mypy]
ignore_missing_imports = true
install_types = true
non_interactive = true
show_error_codes = true
show_error_context = true
error_summary = true
disable_error_code = [
# Only a few notifications left:
"type-arg",
# Only a few notifications left:
"return-value",
# operator breaks in CI (zigpy.types.basic), but not locally
"operator",
"valid-type",
"misc",
"attr-defined",
"assignment",
"arg-type"
]
# Only report on selected files
follow_imports = "silent"
[tool.coverage.run]
source = ["zigpy"]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"if TYPE_CHECKING:",
"if typing.TYPE_CHECKING:",
"raise NotImplementedError",
"raise NotImplementedError()",
]