Skip to content

bug(pip): pip in Windows is now called via py #822

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ jobs:
tests:
strategy:
matrix:
os: [ubuntu-latest]
os: [ubuntu-latest, windows-latest]
gcc_v: [11]
node-version: [18.x]
fail-fast: false
Expand Down Expand Up @@ -33,6 +33,16 @@ jobs:
--slave /usr/bin/g++ g++ /usr/bin/g++-${GCC_V} \
--slave /usr/bin/gcov gcov /usr/bin/gcov-${GCC_V}

- name: Install GCC compilers Windows
if: contains(matrix.os, 'windows')
run: |
Invoke-WebRequest -Uri $Env:GCC_DOWNLOAD -OutFile mingw-w64.zip
Expand-Archive mingw-w64.zip
echo "$pwd\mingw-w64\mingw64\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
env:
GCC_DOWNLOAD: |
https://github.com/brechtsanders/winlibs_mingw/releases/download/13.0.1-snapshot20230122-10.0.0-msvcrt-r1/winlibs-i686-posix-dwarf-gcc-13.0.1-snapshot20230122-mingw-w64msvcrt-10.0.0-r1.zip

- name: Installing Extension
run: npm ci
- name: Compile
Expand All @@ -42,12 +52,12 @@ jobs:
- name: Test Syntax Highlighting
run: npm run test:grammar
- name: Test Unittests
uses: GabrielBB/xvfb-action@v1
uses: GabrielBB/xvfb-action@v1.6
with:
run: npm run test
# This will not fail the job if tests fail so we have to npm test separately
- name: Coverage report
uses: GabrielBB/xvfb-action@v1
uses: GabrielBB/xvfb-action@v1.6
with:
run: npm run coverage
- name: Upload coverage to Codecov
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

### Changed

- Changed the way Python is invoked in Windows machines uses `py` instead of `python`
- Changed the `npm vsce` package to `@vscode/vsce` for publishing
([#814](https://github.com/fortran-lang/vscode-fortran-support/issues/814))
- Changed logger to draw focus on certain error messages
Expand Down
5 changes: 4 additions & 1 deletion src/lib/tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,10 @@ export async function promptForMissingTool(
* @param pyPackage name of python package in PyPi
*/
export async function pipInstall(pyPackage: string): Promise<string> {
const py = 'python3'; // Fetches the top-most python in the Shell
// Fetches the top-most python in the Shell
// For Windows, use py instead of python3, see:
// https://packaging.python.org/en/latest/tutorials/installing-packages/#installing-from-pypi
const py = process.platform === 'win32' ? 'py' : 'python3';
const args = ['-m', 'pip', 'install', '--user', '--upgrade', pyPackage];
return await shellTask(py, args, `pip: ${pyPackage}`);
}
Expand Down
4 changes: 3 additions & 1 deletion test/fortran/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,7 @@
"fortran.fortls.excludeSuffixes": [".snap"],
"fortran.fortls.excludeDirectories": [".vscode/"],
"fortran.fortls.notifyInit": true,
"fortran.linter.compiler": "gfortran"
"fortran.linter.compiler": "gfortran",
// Supress Git pop-up interfering with UI testing
"git.openRepositoryInParentFolders": "always"
}
5 changes: 5 additions & 0 deletions test/fortran/fypp/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"fortran.linter.fypp.enabled": true,
// Supress Git pop-up interfering with UI testing
"git.openRepositoryInParentFolders": "always"
}
10 changes: 10 additions & 0 deletions test/fortran/lint/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"fortran.fortls.preprocessor.definitions": {
"REALTYPEWIDTH": "64",
"IDXTYPEWIDTH": "64"
},
"fortran.linter.extraArgs": ["-DIDXTYPEWIDTH=64", "-DREALTYPEWIDTH=64"],
"fortran.logging.level": "Debug",
// Supress Git pop-up interfering with UI testing
"git.openRepositoryInParentFolders": "always"
}