-
-
Notifications
You must be signed in to change notification settings - Fork 17
/
pyproject.toml
265 lines (200 loc) · 6.75 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
#
### project ##########################################################################
# last checked/updated: 2024-09-10
#
[project]
name = "ramses_rf"
dynamic = ["version"]
description = "A stateful RAMSES-II protocol decoder & analyser."
readme = "README.md"
authors = [{name = "David Bonnes", email = "[email protected]"}]
maintainers = [{name = "David Bonnes", email = "[email protected]"}]
dependencies = [
"colorlog>=6.8.2",
"paho-mqtt>=1.6.1,<2.0.0",
"pyserial-asyncio-fast>=0.13",
"voluptuous>=0.15.2",
]
requires-python = ">=3.11" # e.g. @enum.verify(enum.EnumCheck)
license = "MIT"
keywords = [
"evohome",
"honeywell",
"resideo",
"round thermostat",
"ramses",
"sundial",
"chronotherm",
"hometronics",
"airios",
"itho",
"nuaire",
"orcon",
]
classifiers = [
"Topic :: Home Automation",
]
#
[project.urls]
"Homepage" = "https://github.com/zxdavb/ramses_rf"
"Bug Tracker" = "https://github.com/zxdavb/ramses_rf/issues"
"Wiki" = "https://github.com/zxdavb/ramses_rf/wiki"
#
[project.scripts]
client = "ramses_cli.client:main"
#
### build-system #####################################################################
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build]
sources = ["src"]
artifacts = ["misc/ser2net.yaml",]
[tool.hatch.build.targets.wheel]
packages = ["src/ramses_rf", "src/ramses_tx", "src/ramses_cli"]
[tool.hatch.version]
path = "src/ramses_rf/version.py"
#
### pytest ###########################################################################
[tool.pytest.ini_options]
asyncio_default_fixture_loop_scope = "function"
asyncio_mode = "auto"
norecursedirs = "deprecated/*"
#
### mypy #############################################################################
[tool.mypy]
files = [
"client.py",
"src",
"tests"
]
exclude = [
"src/ramses_cli/client.py",
"src/ramses_cli/utils",
"tests/deprecated",
"tests/wip",
]
# ### Import discovery...
# - https://mypy.readthedocs.io/en/stable/command_line.html#import-discovery
# ignore_missing_imports = true # only used per-module
# follow_imports = normal # avoid skip/silent, prefer normal (default) over error
# ### Strict typing (--strict) if all following are set to true (excl. zxdavb)
# - https://mypy.readthedocs.io/en/stable/existing_code.html#introduce-stricter-options
# # Config file & Configuring warning
# - https://mypy.readthedocs.io/en/stable/command_line.html#config-file
# Start off with these
warn_unused_configs = true
warn_redundant_casts = true # from: Configuring warning
warn_unused_ignores = true # from: Configuring warning
# # Miscellaneous strictness flags
# - https://mypy.readthedocs.io/en/stable/command_line.html#miscellaneous-strictness-flags
# Getting these passing should be easy
extra_checks = true # now incl.: strict_concatenate = true
strict_equality = true
# Strongly recommend enabling this one as soon as you can
check_untyped_defs = true
# allow_redefinition = false # default is false
no_implicit_reexport = true # added by zxdavb
# # Disallow dynamic typing...
# - https://mypy.readthedocs.io/en/stable/command_line.html#disallow-dynamic-typing
# These shouldn't be too much additional work, but may be tricky to
# get passing if you use a lot of untyped libraries
disallow_subclassing_any = true
disallow_untyped_decorators = true # from: Untyped definitions and calls
disallow_any_generics = true
# disallow_any_explicit = true # TODO: added by zxdavb
# # Untyped definitions and calls
# - https://mypy.readthedocs.io/en/stable/command_line.html#untyped-definitions-and-calls
# These next few are various gradations of forcing use of type annotations
disallow_untyped_calls = true
disallow_incomplete_defs = true
disallow_untyped_defs = true
# disallow-untyped-decorators = true # added by zxdavb
# This one isn't too hard to get passing, but return on investment is lower
# no_implicit_reexport = true # 242 # from: Miscellaneous strictness flags
# # Configuring warnings
# - https://mypy.readthedocs.io/en/stable/command_line.html#configuring-warnings
# This one can be tricky to get passing if you use a lot of untyped libraries
warn_return_any = true
disallow_any_unimported = true # from: Disallow dynamic typing
warn_no_return = true
warn_unreachable = true
# # None and Optional handling
# - https://mypy.readthedocs.io/en/stable/command_line.html#none-and-optional-handling
no_implicit_optional = true
#
[[tool.mypy.overrides]]
module = "ramses_tx.parsers"
disallow_any_generics = false # 89 - will be lots of work
[[tool.mypy.overrides]]
module = "ramses_rf.entity_base.*"
disallow_any_generics = false # 14
no_implicit_optional = false # 12
disable_error_code = [
"arg-type", # 13 (but a can of worms)
"unreachable", # 13 (but a can of worms)
]
[[tool.mypy.overrides]]
module = "ramses_rf.device.*"
disable_error_code = [
"assignment", # 18 - doable
"return-value", # 64
"type-arg", # 10 - doable
"unreachable", # 14
]
[[tool.mypy.overrides]]
module = "ramses_rf.system.zones"
disable_error_code = [
"assignment", # 6
"unreachable", # 10
]
[[tool.mypy.overrides]]
module = "tests.*"
disable_error_code = [
"arg-type", # 30
"type-arg", # 22
]
[[tool.mypy.overrides]]
module = "tests_rf.*"
disable_error_code = [
"arg-type", # 54
"type-arg", # 11
]
[[tool.mypy.overrides]]
module = [
"ramses_cli.*",
"ramses_rf.*",
"ramses_tx.parsers",
"tests",
]
disallow_any_explicit = false
#
## ruff ##############################################################################
[tool.ruff]
exclude = ["tests/deprecated/*.py"]
src = ["src", "tests"]
target-version = "py312"
[tool.ruff.lint]
select = [
"ASYNC", # flake8-async
"B", # flake8-bugbear
"E", # pycodestyle
"F", # Pyflakes
"I", # isort
"SIM", # flake8-simplify
"UP", # pyupgrade
]
ignore = ["ASYNC109", "ASYNC110", "B011", "E501", "SIM102", "SIM114", "UP040"]
# B011 - Do not call assert False since python -O removes these calls
# E501 - Line too long
# SIM102 - Use a single `if` statement instead of nested `if` statements
# SIM114 - Combine `if` branches using logical `or` operator
# UP040 - Type alias uses `TypeAlias` annotation instead of the `type` keyword
[tool.ruff.lint.flake8-import-conventions.extend-aliases]
voluptuous = "vol"
[tool.ruff.lint.isort]
combine-as-imports = true
force-sort-within-sections = false
split-on-trailing-comma = false
[tool.ruff.lint.per-file-ignores]
"tests/*" = ["ASYNC"]