-
-
Notifications
You must be signed in to change notification settings - Fork 97
Expand file tree
/
Copy pathpyproject.toml
More file actions
138 lines (131 loc) · 5.3 KB
/
pyproject.toml
File metadata and controls
138 lines (131 loc) · 5.3 KB
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
[tool.ruff]
required-version = ">=0.5.0"
target-version = "py311"
exclude = [
"aioesphomeapi/api_pb2.py",
"aioesphomeapi/api_options_pb2.py",
]
[tool.ruff.lint]
select = [
"A", # flake8-builtins
"ANN", # flake8-annotations (ANN401 ignored below — see "Code style")
"ARG", # flake8-unused-arguments
"ASYNC", # async rules
"B", # flake8-bugbear
"BLE", # flake8-blind-except
"C4", # flake8-comprehensions
"C90", # mccabe complexity
"D", # pydocstyle (formatting only — D10x undocumented checks ignored below)
"DTZ", # flake8-datetimez
"E", # pycodestyle
"EM", # flake8-errmsg
"ERA", # eradicate (commented-out code)
"EXE", # flake8-executable
"F", # pyflakes/autoflake
"FA", # flake8-future-annotations
"FIX", # flake8-fixme
"FLY", # flynt
"FURB", # refurb
"G", # flake8-logging-format
"I", # isort
"ICN", # flake8-import-conventions
"INP", # flake8-no-pep420 (implicit namespace packages)
"ISC", # flake8-implicit-str-concat
"LOG", # flake8-logging
"N", # pep8-naming
"NPY", # numpy-specific rules
"PERF", # Perflint
"PGH", # pygrep-hooks
"PIE", # flake8-pie
"PL", # pylint
"PT", # flake8-pytest-style
"PTH", # flake8-use-pathlib
"PYI", # flake8-pyi
"Q", # flake8-quotes
"UP", # pyupgrade
"RET", # flake8-return
"RSE", # flake8-raise
"RUF", # ruff
"S", # flake8-bandit
"SIM", # flake8-SIM
"SLF", # flake8-self
"SLOT", # flake8-slots
"T10", # flake8-debugger
"T20", # flake8-print
"TC", # flake8-type-checking
"TD", # flake8-todos
"TID", # Tidy imports
"TRY", # try rules
"PERF", # performance
"W", # pycodestyle warnings
"YTT", # flake8-2020
]
ignore = [
# flake8-annotations: require type annotations on production functions, but
# allow typing.Any where it is genuinely the right type — protobuf message
# dispatch (send_message_await_response), the from_pb/convert/converter_field
# machinery that duck-types proto-or-dict input, and *args/**kwargs
# pass-through wrappers. These accept arbitrary inputs by design.
"ANN401", # any-type
"ASYNC109", # `timeout` parameters are part of the public async API
# pydocstyle: enforce docstring formatting where docstrings exist, but do
# not require docstrings on every public symbol (CLAUDE.md prefers terse,
# default-to-none docstrings — see "Code style").
"D100", # undocumented-public-module
"D101", # undocumented-public-class
"D102", # undocumented-public-method
"D103", # undocumented-public-function
"D104", # undocumented-public-package
"D105", # undocumented-magic-method
"D106", # undocumented-public-nested-class
"D107", # undocumented-public-init
# D203 and D211 are mutually exclusive; D213 and D212 are mutually
# exclusive. Pick D211/D212 (no blank line before class; multi-line
# summary on the first line — the predominant style in this repo).
"D203", # incorrect-blank-line-before-class (incompatible with D211)
"D213", # multi-line-summary-second-line (incompatible with D212)
"E501", # line too long
"E721", # We want type() check for protobuf messages
"PLR0911", # Too many return statements ({returns} > {max_returns})
"PLR0912", # Too many branches ({branches} > {max_branches})
"PLR0913", # Too many arguments to function call ({c_args} > {max_args})
"PLR0915", # Too many statements ({statements} > {max_statements})
"PLR2004", # Magic value used in comparison, consider replacing {value} with a constant variable
"PLW2901", # Outer {outer_kind} variable {name} overwritten by inner {inner_kind} target
"TRY003", # Too many to fix - Avoid specifying long messages outside the exception class
"TID252", # Prefer absolute imports over relative imports from parent modules
]
[tool.ruff.lint.per-file-ignores]
# pytest fixtures are routinely "unused" — they're requested for their
# setup side effects, not their return value. The ARG family flags this
# as noise; the rest of the family still applies to production code.
# SLF: tests and benchmarks legitimately reach into private state to
# pin invariants and to swap out hot-path methods for measurement.
# S101: pytest assertions are the entire point of the test suite.
# S106: test fixtures use literal "password" strings to exercise the
# password-auth code paths; they are not real credentials.
# ANN: test functions and fixtures need not be annotated — pytest discovers
# them by name and the bodies are self-documenting; annotations are noise here.
"tests/**" = ["ANN", "ARG", "S101", "S106", "SLF"]
# CLI entry points and benchmark scripts emit to stdout by design; T20
# would flag every line of their intended output. SLF: benchmark harness
# constructs APIConnection from APIClient internals to measure hot paths.
# S101: benchmark sanity asserts are intentional. ANN: benchmark helpers are
# throwaway timing scaffolding, not API — annotations add noise without value.
"aioesphomeapi/discover.py" = ["T20"]
"aioesphomeapi/log_reader.py" = ["T20"]
"bench/**" = ["ANN", "S101", "SLF", "T20"]
[tool.ruff.lint.isort]
force-sort-within-sections = true
known-first-party = [
"aioesphomeapi", "tests"
]
combine-as-imports = true
split-on-trailing-comma = false
[build-system]
requires = ['setuptools>=82.0.1', 'wheel', 'Cython>=3.2.5']
[tool.pytest.ini_options]
asyncio_mode = "auto"
[tool.cibuildwheel.linux]
# Re-enable 32-bit builds (disabled by default in cibuildwheel 3.0)
archs = ["auto", "auto32"]