From 5fcf7ab6a6696be81c94babc766bf8dfbb5088e4 Mon Sep 17 00:00:00 2001 From: Avasam Date: Sat, 14 Jan 2023 16:31:48 -0500 Subject: [PATCH] pin requests and allow pyright warnings (#193) --- .github/workflows/lint-and-build.yml | 1 - pyproject.toml | 4 +++- scripts/lint.ps1 | 2 +- scripts/requirements.txt | 4 ++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/lint-and-build.yml b/.github/workflows/lint-and-build.yml index 60316e46..e8ca03ee 100644 --- a/.github/workflows/lint-and-build.yml +++ b/.github/workflows/lint-and-build.yml @@ -97,7 +97,6 @@ jobs: uses: jakebailey/pyright-action@v1 with: working-directory: src/ - extra-args: --warnings Pylint: runs-on: windows-latest strategy: diff --git a/pyproject.toml b/pyproject.toml index 495b3a6e..2350488c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,6 +12,8 @@ ignore = [ # https://github.com/microsoft/pyright/blob/main/docs/configuration.md#sample-pyprojecttoml-file [tool.pyright] typeCheckingMode = "strict" +# Prefer `pyright: ignore` +enableTypeIgnoreComments = false # Extra strict reportImplicitStringConcatenation = "error" reportCallInDefaultInitializer = "error" @@ -21,7 +23,7 @@ reportUninitializedInstanceVariable = "error" reportUnnecessaryTypeIgnoreComment = "error" # Exclude from scanning when running pyright exclude = [ - # Auto generated, produces unecessary `# type: ignore` + # Auto generated, fails some strict pyright checks "src/gen/", ] # Ignore must be specified for Pylance to stop displaying errors diff --git a/scripts/lint.ps1 b/scripts/lint.ps1 index 69ba1820..b45edcf1 100644 --- a/scripts/lint.ps1 +++ b/scripts/lint.ps1 @@ -10,7 +10,7 @@ add-trailing-comma $(git ls-files '**.py*') --py36-plus Write-Host "`nRunning Pyright..." $Env:PYRIGHT_PYTHON_FORCE_VERSION = 'latest' -pyright src/ --warnings +pyright src/ $exitCodes += $LastExitCode if ($LastExitCode -gt 0) { Write-Host "`Pyright failed ($LastExitCode)" -ForegroundColor Red diff --git a/scripts/requirements.txt b/scripts/requirements.txt index 7d11f5e6..4c488716 100644 --- a/scripts/requirements.txt +++ b/scripts/requirements.txt @@ -16,13 +16,13 @@ git+https://github.com/boppreh/keyboard.git#egg=keyboard # Fix install on macos numpy>=1.23.2 # Python 3.11 wheels opencv-python-headless>=4.6 # Breaking changes importing cv2.cv2 packaging -Pillow>=9.2 # gnome-screeshot checks +Pillow>=9.2 # gnome-screeshot checks psutil PyAutoGUI # 6.4.1 fixes the rare Illegal Operation issue from RTADan, but the dev wheels are currently broken :/ # 2.0.0-beta.2 contains the fixes if anyone needs it. PyQt6>=6.4.0 # Python 3.11 support -requests +requests<=2.28.1 # 2.28.2 has issues with PyInstaller https://github.com/pyinstaller/pyinstaller-hooks-contrib/issues/534 toml # # Build and compile resources