From 9fab4988149d647275fb33b8fa1619f7874da792 Mon Sep 17 00:00:00 2001 From: mrjarnould Date: Fri, 15 May 2026 21:08:49 +0200 Subject: [PATCH 1/2] Pin workspace Python interpreter to project .venv Add `python.defaultInterpreterPath` set to `${workspaceFolder}/.venv/bin/python` so the VS Code Python extension consistently resolves this workspace's interpreter on reload, rather than falling back to a user-level default that may point at an unrelated project's venv. Why: without an explicit workspace-level pin, the picker selection is transient and the Python extension can re-activate the wrong interpreter in integrated terminals on window reload, which causes `uv pip install` and type checkers (e.g. Pyrefly) to silently target the wrong site-packages. This mirrors the common Python project convention of a `.venv/` directory at the repo root. Contributors using a different venv location can override locally via the interpreter picker. Co-Authored-By: Claude Opus 4.7 --- .vscode/settings.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 702afb77..354f5d3a 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -28,5 +28,6 @@ "pylint.importStrategy": "fromEnvironment", "python.analysis.diagnosticMode": "openFilesOnly", "sonarlint.testFilePattern": "**/tests/**", - "python.languageServer": "Pylance" + "python.languageServer": "Pylance", + "python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python" } From 2ffc38acded7ff1ddbb168ff26020b9e0485ac42 Mon Sep 17 00:00:00 2001 From: mrjarnould Date: Fri, 15 May 2026 21:44:58 +0200 Subject: [PATCH 2/2] Document Windows interpreter path override Address CodeRabbit feedback on the workspace interpreter pin: the path `${workspaceFolder}/.venv/bin/python` is Unix-only and won't resolve on Windows. Add a JSONC comment above the setting documenting the Windows equivalent (`${workspaceFolder}/.venv/Scripts/python.exe`) so contributors on that platform know to override locally via User Settings or the interpreter picker. `.vscode/settings.json` is officially JSONC, so the `//` comment is valid. Co-Authored-By: Claude Opus 4.7 --- .vscode/settings.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.vscode/settings.json b/.vscode/settings.json index 354f5d3a..a21024ee 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -29,5 +29,8 @@ "python.analysis.diagnosticMode": "openFilesOnly", "sonarlint.testFilePattern": "**/tests/**", "python.languageServer": "Pylance", + // Windows contributors: this Unix-style path won't resolve. Override locally + // (e.g. via User Settings or the interpreter picker) to + // "${workspaceFolder}/.venv/Scripts/python.exe". "python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python" }