Skip to content

Commit 0bcc42d

Browse files
committed
tooling: Migrate Pylance settings from VSCode to pyproject.toml.
Pylance ignores python.analysis.* in settings.json when a pyproject.toml exists and warns "cannot be set when a pyproject.toml is being used". Move typeCheckingMode, extraPaths, stubPath, and diagnosticSeverityOverrides into [tool.pyright] in pyproject.toml where Pylance reads them. This also makes the configuration IDE-agnostic (works for any pyright-based tool, not just VSCode).
1 parent 47ee02a commit 0bcc42d

2 files changed

Lines changed: 26 additions & 26 deletions

File tree

.vscode/settings.json

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,4 @@
11
{
22
"python.languageServer": "Pylance",
3-
"python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python",
4-
"python.analysis.typeCheckingMode": "basic",
5-
"python.analysis.extraPaths": [
6-
"lib/apds9960",
7-
"lib/bme280",
8-
"lib/bq27441",
9-
"lib/daplink_bridge",
10-
"lib/daplink_flash",
11-
"lib/gc9a01",
12-
"lib/hts221",
13-
"lib/im34dt05",
14-
"lib/ism330dl",
15-
"lib/lis2mdl",
16-
"lib/mcp23009e",
17-
"lib/ssd1327",
18-
"lib/steami_config",
19-
"lib/steami_screen",
20-
"lib/vl53l1x",
21-
"lib/wsen-hids",
22-
"lib/wsen-pads"
23-
],
24-
"python.analysis.stubPath": "typings",
25-
"python.analysis.diagnosticSeverityOverrides": {
26-
"reportMissingModuleSource": "none",
27-
"reportWildcardImportFromLibrary": "none"
28-
}
3+
"python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python"
294
}

pyproject.toml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,3 +128,28 @@ quote-style = "double"
128128
indent-style = "space"
129129
skip-magic-trailing-comma = false
130130
line-ending = "auto"
131+
132+
[tool.pyright]
133+
typeCheckingMode = "basic"
134+
stubPath = "typings"
135+
extraPaths = [
136+
"lib/apds9960",
137+
"lib/bme280",
138+
"lib/bq27441",
139+
"lib/daplink_bridge",
140+
"lib/daplink_flash",
141+
"lib/gc9a01",
142+
"lib/hts221",
143+
"lib/im34dt05",
144+
"lib/ism330dl",
145+
"lib/lis2mdl",
146+
"lib/mcp23009e",
147+
"lib/ssd1327",
148+
"lib/steami_config",
149+
"lib/steami_screen",
150+
"lib/vl53l1x",
151+
"lib/wsen-hids",
152+
"lib/wsen-pads",
153+
]
154+
reportMissingModuleSource = "none"
155+
reportWildcardImportFromLibrary = "none"

0 commit comments

Comments
 (0)