-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpyproject.toml
More file actions
160 lines (147 loc) · 5.19 KB
/
pyproject.toml
File metadata and controls
160 lines (147 loc) · 5.19 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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
[build-system]
requires = ["setuptools>=64"]
build-backend = "setuptools.build_meta"
[project]
name = "micropython-steami-lib"
version = "0.23.1"
description = "MicroPython driver library for the STeaMi board."
license = {text = "GPL-3.0-or-later"}
requires-python = ">=3.7"
[project.optional-dependencies]
dev = ["ruff==0.11.6", "micropython-stm32-stubs>=1.24"]
test = ["pytest==7.4.0", "pyyaml==6.0.2", "mpremote>=1.0"]
flash = ["pyocd>=0.44"]
[tool.setuptools]
# No Python packages to install — this project contains MicroPython drivers
packages = []
[project.urls]
Homepage = "https://www.steami.cc/"
Repository = "https://github.com/steamicc/micropython-steami-lib"
Documentation = "https://wiki.steami.cc/"
Issues = "https://github.com/steamicc/micropython-steami-lib/issues"
[tool.pytest.ini_options]
testpaths = ["tests"]
markers = [
"mock: tests using FakeI2C (no hardware needed)",
"hardware: tests requiring a real board (use --port)",
"manual: tests requiring human validation",
"board: board qualification tests (no driver, hardware only)",
]
[tool.ruff]
line-length = 99
target-version = "py310"
[tool.ruff.lint]
preview = true
explicit-preview-rules = true
select = [
"A", # flake8-builtins: prevent shadowing builtins
"ASYNC", # flake8-async
"B", # flake8-bugbear: common bug patterns
"C4", # flake8-comprehensions
"C90", # McCabe cyclomatic complexity
"DTZ", # flake8-datetimez
"E", # pycodestyle
"E203", # (preview) whitespace before ':', ';', or ','
"E225", # (preview) missing whitespace around operator
"E231", # (preview) missing whitespace after ','
"E261", # (preview) at least two spaces before inline comment
"E262", # (preview) inline comment must start with '# '
"E265", # (preview) block comment must start with '# '
"E275", # (preview) missing whitespace after keyword
"E301", # (preview) blank line between methods
"E302", # (preview) expected 2 blank lines before function/class definition
"E303", # (preview) too many blank lines
"E305", # (preview) expected 2 blank lines after function/class definition
"EXE", # flake8-executable
"F", # Pyflakes
"G", # flake8-logging-format
"I", # isort
"ICN", # flake8-import-conventions
"INT", # flake8-gettext
"ISC", # flake8-implicit-str-concat
"N802", # pep8-naming: function name should be lowercase
"N803", # pep8-naming: argument name should be lowercase
"N806", # pep8-naming: variable in function should be lowercase
"PGH", # pygrep-hooks
"PIE", # flake8-pie
"PL", # Pylint
"PYI", # flake8-pyi
"RSE", # flake8-raise
"RUF", # Ruff-specific rules
"S110", # flake8-bandit: try-except-pass (no silent exception suppression)
"SIM", # flake8-simplify
"T10", # flake8-debugger
"PERF", # Perflint
"T20", # flake8-print: no print() in production code
"TCH", # flake8-type-checking
"W", # pycodestyle
"W391", # (preview) too many newlines at end of file
"YTT", # flake8-2020
]
ignore = [
"B905", # zip() strict= not available in micropython
"E501", # line length, recommended to disable
"E741", # 'l' is currently widely used
"ISC001", # conflicts with formatter
"ISC003", # micropython does not support implicit concatenation of f-strings
"PIE810", # micropython does not support passing tuples to .startswith or .endswith
"PLC1901", # compare to empty string
"PLR1704", # sometimes desirable to redefine an argument to save code size
"PLR1714", # consider merging multiple comparisons
"PLR5501", # use elif instead of else+if
"PLW0602", # global variable not assigned
"PLW0603", # global statement
"PLW2901", # overwriting loop variable
"RUF012", # mutable class variable
"RUF100", # unused noqa
"SIM101", # merge isinstance calls (micropython compat)
"SIM105", # contextlib.suppress not available in micropython
"W191", # tab-indent, redundant when using formatter
]
[tool.ruff.lint.isort]
known-third-party = ["micropython"]
[tool.ruff.lint.mccabe]
max-complexity = 25
[tool.ruff.lint.pylint]
allow-magic-value-types = ["bytes", "int", "str"]
max-args = 10
max-branches = 25
max-returns = 8
max-statements = 65
[tool.ruff.lint.per-file-ignores]
# manifest.py files are evaluated with some global names pre-defined
"**/manifest.py" = ["F821"]
"**/examples/*.py" = ["T20", "N806"]
"lib/mcp23009e/examples/i2c_scan.py" = ["PERF203"]
"tests/**/*.py" = ["T20", "PLR0911", "PLR0912", "PLR0915"]
"lib/lis2mdl/**/*.py" = ["RUF001", "RUF002", "RUF003"] # µ (microtesla) is intentional
"scripts/**/*.py" = ["T20", "PERF203"]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
[tool.pyright]
typeCheckingMode = "basic"
stubPath = "typings"
extraPaths = [
"lib/apds9960",
"lib/bme280",
"lib/bq27441",
"lib/daplink_bridge",
"lib/daplink_flash",
"lib/gc9a01",
"lib/hts221",
"lib/im34dt05",
"lib/ism330dl",
"lib/lis2mdl",
"lib/mcp23009e",
"lib/ssd1327",
"lib/steami_config",
"lib/steami_screen",
"lib/vl53l1x",
"lib/wsen-hids",
"lib/wsen-pads",
]
reportMissingModuleSource = "none"
reportWildcardImportFromLibrary = "none"