-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Summary
Currently users must manually install reqstool before the extension works:
pipx install "reqstool[lsp]"
This means the extension fails silently on first install for most users.
Proposed Solution
On activation, automatically install reqstool[lsp] from PyPI into a managed virtual environment stored in VS Code's globalStorageUri. This follows the same pattern used by Microsoft's Python tool extensions (vscode-pylint, vscode-black-formatter, vscode-mypy).
Resolution priority:
- If
reqstool.serverCommandis explicitly user-configured → use it (no change) - Otherwise → use managed venv (
globalStorageUri/env/bin/reqstool lsp) - If venv setup fails → fall back to PATH
Behaviour:
- First activation: show progress notification while pip-installing
reqstool[lsp] - Subsequent activations: venv already exists, starts immediately
- Extension version upgrade: old venv is invalidated and recreated
- Power users: set
reqstool.serverCommandto any command to bypass the managed venv entirely
Implementation
ensureManagedVenv(context)insrc/extension.ts: creates venv, runspip install reqstool[lsp]findPython(): triespython3thenpythonto locate a system interpreterresolveServerCommand(managedBin?): respects explicit user config, falls back to managed venv, then PATH- No bundled wheels — always fetches from PyPI
References
- vscode-pylint — reference implementation of this pattern
- VS Code Python Tools Extension Template
Signed-off-by: jimisola jimisola@users.noreply.github.com
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels