From a37b9c5117d7657d47ce226a21c326eeb7a2d266 Mon Sep 17 00:00:00 2001 From: Avasam Date: Wed, 22 Oct 2025 20:20:12 -0400 Subject: [PATCH] run CI checkers on Ubuntu --- .gitattributes | 1 + .github/workflows/main.yml | 8 +++++--- mypy.ini | 2 ++ pyrightconfig.json | 4 ++++ 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.gitattributes b/.gitattributes index 31c7886001..ae0cdf2f70 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2,3 +2,4 @@ AutoDuck/*.fmt text eol=crlf *.dsp text eol=crlf *.dsw text eol=crlf +*.py text eol=crlf diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a3a4a9ab9b..4589fbfa80 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -127,7 +127,7 @@ jobs: if-no-files-found: error merge: - runs-on: windows-latest + runs-on: ubuntu-latest needs: [test, build_arm64] steps: - name: Merge Artifacts @@ -142,7 +142,7 @@ jobs: # This job can be run locally by running `pre-commit run` checkers: - runs-on: windows-2022 + runs-on: ubuntu-latest timeout-minutes: 30 steps: - uses: actions/checkout@v4 @@ -167,14 +167,16 @@ jobs: - run: | clang-format --Werror --dry-run $(git ls-files '*.cpp' ':!:com/win32comext/mapi/src/MAPIStubLibrary/') if ($LastExitCode -ne 0) { exit $LastExitCode } + shell: pwsh if: ${{ !cancelled() }} - run: | clang-format --Werror --dry-run $(git ls-files '*.h' ':!:Pythonwin/Scintilla/' ':!:com/win32comext/mapi/src/MAPIStubLibrary/') if ($LastExitCode -ne 0) { exit $LastExitCode } + shell: pwsh if: ${{ !cancelled() }} type-checkers: - runs-on: windows-2022 + runs-on: ubuntu-latest timeout-minutes: 30 strategy: fail-fast: false diff --git a/mypy.ini b/mypy.ini index b1ab835088..dca81efa03 100644 --- a/mypy.ini +++ b/mypy.ini @@ -1,5 +1,7 @@ [mypy] show_column_numbers = true +; Needs to be set for non-Windows CI runners +platform = win32 ; Target the oldest supported version in editors and default CLI python_version = 3.8 diff --git a/pyrightconfig.json b/pyrightconfig.json index 7f57a32bbb..fb664ff160 100644 --- a/pyrightconfig.json +++ b/pyrightconfig.json @@ -1,5 +1,7 @@ { "typeCheckingMode": "basic", + // Needs to be set for non-Windows CI runners + "pythonPlatform": "Windows", // Target the oldest supported version in editors and default CLI "pythonVersion": "3.9", // Keep it simple for now by allowing both mypy and pyright to use `type: ignore` @@ -7,6 +9,7 @@ // Exclude from scanning when running pyright "exclude": [ ".git/", // Avoids scanning git branch names ending in ".py" + ".venv/", "build/", // Vendored "Pythonwin/Scintilla/", @@ -16,6 +19,7 @@ "**/Test/", "**/test/", "**/Demos/", + "**/demos/", "**/demo/", ], // Packages that will be accessible globally.