Repository navigation
update.ps1 installs and updates the VS Code extension - #222
Merged
Merged
Conversation
A new step, before Docker: when VS Code is there, update.ps1 runs the new scripts/install-vscode-extension.ps1. It builds editors/vscode (npm ci and vsce) and installs it with code --install-extension when it is not installed, another version is, or any of its files changed since the last install (a hash kept in .py-doc/vscode-extension.sha256). Otherwise it says it is up to date. A failure is reported and the update goes on. -NoVSCode skips the step and -Code names VS Code's command line when it is not on the PATH. The script is tested against a fake VS Code command line where PowerShell and Node.js are present, as on GitHub's runners. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WHtcxeRPPmXcydfxoEHGJ4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
scripts/update.ps1now installs py-doc's VS Code extension when VS Code is present, and installs it again when the extension changes.What it does
py-doccommand check and before Docker, so a Docker problem doesn't block it. It runs the newscripts/install-vscode-extension.ps1, which:-Code, elsecodeon the PATH, else the usual Windows install folders). Without one, it says so and does nothing.npm ci,npx @vscode/vsce@3.6.2 package,code --install-extension … --force) when:.py-doc/vscode-extension.sha256, which Git ignores..vsixafter installing, and tells you to reload open VS Code windows.update.ps1:-NoVSCodeskips the step, and-Codenamescode.cmdwhen VS Code isn't on the PATH. The script can also run on its own, and-Forcereinstalls even when it's up to date.Docs
The install guide's update-steps table, the root README and the extension README describe it.
Testing
PowerShell wasn't available where this was written, so neither script has run yet; this PR's CI is the first run.
tests/test_vscode_install_script.pyruns the script against a fake VS Code command line:-Codepath that doesn't exist fails with the reason.It needs PowerShell and Node.js, which GitHub's Ubuntu and Windows runners have, and is skipped elsewhere. The
update.ps1change itself is untested: worth running.\scripts\update.ps1 -NoPullonce on Windows before merging.ruffand the docs lint are clean.Generated by Claude Code