Skip to content

Commit eb6df9a

Browse files
authored
feat(tasks): add shell task for check-python with venv activation (#25686)
fixes #24121 since extension developers are frequently changing their shell activation settings, this provides a way to activate the venv then run the task to allow for consistent checks by developers that mirror CI
1 parent 336d699 commit eb6df9a

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

.vscode/tasks.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,24 @@
3939
"problemMatcher": ["$python"],
4040
"label": "npm: check-python",
4141
"detail": "npm run check-python:ruff && npm run check-python:pyright"
42+
},
43+
{
44+
"label": "npm: check-python (venv)",
45+
"type": "shell",
46+
"command": "bash",
47+
"args": ["-lc", "source .venv/bin/activate && npm run check-python"],
48+
"problemMatcher": [],
49+
"detail": "Activates the repo .venv first (avoids pyenv/shim Python) then runs: npm run check-python",
50+
"windows": {
51+
"command": "pwsh",
52+
"args": [
53+
"-NoProfile",
54+
"-ExecutionPolicy",
55+
"Bypass",
56+
"-Command",
57+
".\\.venv\\Scripts\\Activate.ps1; npm run check-python"
58+
]
59+
}
4260
}
4361
]
4462
}

0 commit comments

Comments
 (0)