fix(scaffold): use cross-platform venv path in vscode settings#100
Conversation
Drop the OS-specific bin/python suffix so Python extension auto-resolves the interpreter on both Windows (Scripts/python.exe) and Linux/macOS (bin/python). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request updates the VS Code settings template for scaffolded projects. It modifies the python.defaultInterpreterPath to point to the .venv directory instead of the Python executable. Feedback suggests removing this setting entirely, as pointing to a directory is invalid for the VS Code Python extension, and standard virtual environments like .venv are already auto-detected across platforms.
| "python.defaultInterpreterPath": "${workspaceFolder}/.venv", | ||
| "python.testing.pytestEnabled": true, |
There was a problem hiding this comment.
Setting python.defaultInterpreterPath to a directory (${workspaceFolder}/.venv) is invalid because the VS Code Python extension expects a path to the Python executable (e.g., bin/python or Scripts/python.exe). Pointing it to a directory will cause VS Code to fail to resolve the interpreter, leading to errors when running Python tools, tests, or formatters.
Since the VS Code Python extension automatically detects standard virtual environments like .venv in the workspace root on all platforms (Windows, macOS, and Linux), the best cross-platform solution is to omit this setting entirely.
| "python.defaultInterpreterPath": "${workspaceFolder}/.venv", | |
| "python.testing.pytestEnabled": true, | |
| "python.testing.pytestEnabled": true, |
Summary
bin/pythonsuffix frompython.defaultInterpreterPathin the scaffold's.vscode/settings.jsonScripts/python.exe) and Linux/macOS (bin/python)Test plan
act newon Linux and confirm VS Code picks up.venv/bin/python.venv/Scripts/python.exe🤖 Generated with Claude Code