Skip to content

Commit

Permalink
Fix #252, py-launcher compatibility
Browse files Browse the repository at this point in the history
Signed-off-by: paulober <[email protected]>
  • Loading branch information
paulober committed Sep 16, 2024
1 parent 3811c02 commit f3032e4
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ All notable changes to the "MicroPico" extension will be documented in this file

---

## [4.0.5] - 2024-09-16

### Changed

- Fix #252, py-launcher compatibility

## [4.0.4] - 2024-09-13

### Added
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "pico-w-go",
"displayName": "MicroPico",
"description": "Auto-completion, remote workspace and a REPL console integration for the Raspberry Pi Pico boards running MicroPython firmware.",
"version": "4.0.4",
"version": "4.0.5",
"publisher": "paulober",
"license": "MPL-2.0",
"homepage": "https://github.com/paulober/MicroPico/blob/main/README.md",
Expand Down
7 changes: 3 additions & 4 deletions src/stubs.mts
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,6 @@ export async function installStubsByVersion(

const pyCmd = python3 ?? py;
if (pyCmd !== null) {
// TODO: check windows pylauncher compatibility
const result = execSync(pyCmd + " -m pip");
if (result.toString("utf-8").toLowerCase().includes("no module named")) {
void window.showErrorMessage(
Expand All @@ -313,7 +312,7 @@ export async function installStubsByVersion(

return false;
}
command = `${pyCmd} -m pip`;
command = `"${pyCmd}" -m pip`;
} else {
void window.showErrorMessage(
"python3 or py is required (in PATH) to install" +
Expand All @@ -324,7 +323,7 @@ export async function installStubsByVersion(
}
} else {
assert(pip3 !== null || pip !== null);
command = (pip3 ?? pip)!;
command = `"${(pip3 ?? pip)!}"`;
}

const folderName = `${port}==${version}`;
Expand All @@ -334,7 +333,7 @@ export async function installStubsByVersion(
const isWin = process.platform === "win32";
// install stubs with pip vscode user directory
const result = execSync(
`${isWin ? "&" : ""}"${command}" install ${port}==${version} ` +
`${isWin ? "&" : ""}${command} install ${port}==${version} ` +
`--target "${target}" --no-user`,
isWin ? { shell: "powershell" } : {}
);
Expand Down

0 comments on commit f3032e4

Please sign in to comment.