From 1f9104e323cbbfb3d185f2d1dbeca2ee592f8134 Mon Sep 17 00:00:00 2001 From: gnikit Date: Sun, 5 Feb 2023 13:37:55 +0000 Subject: [PATCH 1/4] bug(pip): pip in Windows is now called via `py` Instead of the incorrect `python3` --- CHANGELOG.md | 1 + src/lib/tools.ts | 5 ++++- test/fortran/.vscode/settings.json | 4 +++- test/fortran/fypp/.vscode/settings.json | 5 +++++ test/fortran/lint/.vscode/settings.json | 10 ++++++++++ 5 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 test/fortran/fypp/.vscode/settings.json create mode 100644 test/fortran/lint/.vscode/settings.json diff --git a/CHANGELOG.md b/CHANGELOG.md index fd97c284..41861d76 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/src/lib/tools.ts b/src/lib/tools.ts index 20c31fa6..38c20834 100644 --- a/src/lib/tools.ts +++ b/src/lib/tools.ts @@ -142,7 +142,10 @@ export async function promptForMissingTool( * @param pyPackage name of python package in PyPi */ export async function pipInstall(pyPackage: string): Promise { - 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}`); } diff --git a/test/fortran/.vscode/settings.json b/test/fortran/.vscode/settings.json index eaeedcc4..64f99b73 100644 --- a/test/fortran/.vscode/settings.json +++ b/test/fortran/.vscode/settings.json @@ -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" } diff --git a/test/fortran/fypp/.vscode/settings.json b/test/fortran/fypp/.vscode/settings.json new file mode 100644 index 00000000..1ff6b43c --- /dev/null +++ b/test/fortran/fypp/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "fortran.linter.fypp.enabled": true, + // Supress Git pop-up interfering with UI testing + "git.openRepositoryInParentFolders": "always" +} diff --git a/test/fortran/lint/.vscode/settings.json b/test/fortran/lint/.vscode/settings.json new file mode 100644 index 00000000..431b43bf --- /dev/null +++ b/test/fortran/lint/.vscode/settings.json @@ -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" +} From fb407b51f89848c3efd4b96f9cdfa37bb153b4c9 Mon Sep 17 00:00:00 2001 From: gnikit Date: Sun, 5 Feb 2023 16:23:14 +0000 Subject: [PATCH 2/4] ci: enable windows testing --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 94ae6e86..e8c851f3 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -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 From de0aa0d8eebd2585be773c8a7c7e99e3d2132d86 Mon Sep 17 00:00:00 2001 From: gnikit Date: Sun, 5 Feb 2023 16:52:49 +0000 Subject: [PATCH 3/4] ci: add GCC 13.0.1 for Windows --- .github/workflows/main.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index e8c851f3..bb11c605 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -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 From 5138827fce99c58d63d03273e97101c0a8757ed8 Mon Sep 17 00:00:00 2001 From: gnikit Date: Sun, 5 Feb 2023 16:22:35 +0000 Subject: [PATCH 4/4] ci: update action release --- .github/workflows/main.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index bb11c605..4d75e1f0 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -52,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