Skip to content

Commit 35d3017

Browse files
committed
bug(pip): pip in Windows is now called via py
Instead of the incorrect `python3`
1 parent 3a6b8e4 commit 35d3017

File tree

5 files changed

+23
-2
lines changed

5 files changed

+23
-2
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
4949

5050
### Changed
5151

52+
- Changed the way Python is invoked in Windows machines uses `py` instead of `python`
5253
- Changed the `npm vsce` package to `@vscode/vsce` for publishing
5354
([#814](https://github.com/fortran-lang/vscode-fortran-support/issues/814))
5455
- Changed logger to draw focus on certain error messages

src/lib/tools.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,10 @@ export async function promptForMissingTool(
142142
* @param pyPackage name of python package in PyPi
143143
*/
144144
export async function pipInstall(pyPackage: string): Promise<string> {
145-
const py = 'python3'; // Fetches the top-most python in the Shell
145+
let py = 'python3'; // Fetches the top-most python in the Shell
146+
// For Windows, use py instead of python3, see:
147+
// https://packaging.python.org/en/latest/tutorials/installing-packages/#installing-from-pypi
148+
if (process.platform === 'win32') py = 'py';
146149
const args = ['-m', 'pip', 'install', '--user', '--upgrade', pyPackage];
147150
return await shellTask(py, args, `pip: ${pyPackage}`);
148151
}

test/fortran/.vscode/settings.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,7 @@
2020
"fortran.fortls.excludeSuffixes": [".snap"],
2121
"fortran.fortls.excludeDirectories": [".vscode/"],
2222
"fortran.fortls.notifyInit": true,
23-
"fortran.linter.compiler": "gfortran"
23+
"fortran.linter.compiler": "gfortran",
24+
// Supress Git pop-up interfering with UI testing
25+
"git.openRepositoryInParentFolders": "always"
2426
}
+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"fortran.linter.fypp.enabled": true,
3+
// Supress Git pop-up interfering with UI testing
4+
"git.openRepositoryInParentFolders": "always"
5+
}
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"fortran.fortls.preprocessor.definitions": {
3+
"REALTYPEWIDTH": "64",
4+
"IDXTYPEWIDTH": "64"
5+
},
6+
"fortran.linter.extraArgs": ["-DIDXTYPEWIDTH=64", "-DREALTYPEWIDTH=64"],
7+
"fortran.logging.level": "Debug",
8+
// Supress Git pop-up interfering with UI testing
9+
"git.openRepositoryInParentFolders": "always"
10+
}

0 commit comments

Comments
 (0)