Skip to content

Commit 76af88f

Browse files
committed
tooling: Add MicroPython stubs and Pylance config to reduce false errors.
1 parent 4b03ce1 commit 76af88f

3 files changed

Lines changed: 24 additions & 1 deletion

File tree

.devcontainer/devcontainer.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,14 @@
5555
},
5656

5757
"python.defaultInterpreterPath": "/usr/local/bin/python",
58+
"python.languageServer": "Pylance",
59+
"python.analysis.typeCheckingMode": "basic",
60+
"python.analysis.extraPaths": ["lib"],
61+
"python.analysis.diagnosticSeverityOverrides": {
62+
"reportMissingModuleSource": "none",
63+
"reportWildcardImportFromLibrary": "none",
64+
"reportGeneralTypeIssues": "warning"
65+
},
5866
"python.testing.pytestEnabled": true,
5967
"python.testing.pytestArgs": ["-v", "-k", "mock"],
6068

@@ -72,6 +80,7 @@
7280
"extensions": [
7381
"charliermarsh.ruff",
7482
"ms-python.python",
83+
"ms-python.vscode-pylance",
7584
"ms-vscode.vscode-serial-monitor",
7685
"esbenp.prettier-vscode",
7786
"github.vscode-pull-request-github",

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ license = {text = "GPL-3.0-or-later"}
1010
requires-python = ">=3.7"
1111

1212
[project.optional-dependencies]
13-
dev = ["ruff==0.11.6"]
13+
dev = ["ruff==0.11.6", "micropython-stm32-stubs>=1.24"]
1414
test = ["pytest==7.4.0", "pyyaml==6.0.2", "mpremote>=1.0"]
1515

1616
[tool.setuptools]

pyrightconfig.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"pythonVersion": "3.7",
3+
"pythonPlatform": "All",
4+
"typeCheckingMode": "basic",
5+
"extraPaths": ["lib"],
6+
"exclude": [
7+
".build",
8+
"node_modules",
9+
"**/__pycache__"
10+
],
11+
"reportMissingModuleSource": false,
12+
"reportWildcardImportFromLibrary": false,
13+
"reportGeneralTypeIssues": "warning"
14+
}

0 commit comments

Comments
 (0)