From 103d86d9b42eb43cb97ca3fb7249dd3cdb625b56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niko=20B=C3=B6ckerman?= Date: Tue, 3 Mar 2026 21:01:48 +0200 Subject: [PATCH 1/2] Switch from pyright to basedpyright --- .github/workflows/ci-python-project.yaml | 6 +++--- .github/workflows/ci.yaml | 6 +++--- aoc-main/mise.toml | 6 +++--- mise.toml | 8 ++++---- solvers/python/mise.toml | 6 +++--- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci-python-project.yaml b/.github/workflows/ci-python-project.yaml index 184fb0b..9afbc88 100644 --- a/.github/workflows/ci-python-project.yaml +++ b/.github/workflows/ci-python-project.yaml @@ -38,13 +38,13 @@ jobs: directory: ${{ inputs.directory }} task: check:mypy - check-pyright: + check-basedpyright: if: always() && contains(fromJSON('["skipped", "success"]'), needs.uv-cache.result) needs: uv-cache uses: ./.github/workflows/mise-uv-task.yaml with: directory: ${{ inputs.directory }} - task: check:pyright + task: check:basedpyright run-all: if: inputs.directory != 'aoc-main' @@ -65,7 +65,7 @@ jobs: if: always() needs: - check-mypy - - check-pyright + - check-basedpyright - run-all - test-pytest runs-on: ubuntu-24.04 diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 98af7cd..83dfa6a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -81,12 +81,12 @@ jobs: directory: . task: check:prettier - check-pyright-repo: + check-basedpyright-repo: needs: mise-cache-ubuntu uses: ./.github/workflows/mise-task.yaml with: directory: . - task: check:pyright-repo + task: check:basedpyright-repo check-ruff: needs: mise-cache-ubuntu @@ -179,7 +179,7 @@ jobs: if: always() needs: - check-prettier - - check-pyright-repo + - check-basedpyright-repo - check-ruff - check-ruff-format - check-shellcheck diff --git a/aoc-main/mise.toml b/aoc-main/mise.toml index a1c177c..e5e0a26 100644 --- a/aoc-main/mise.toml +++ b/aoc-main/mise.toml @@ -4,7 +4,7 @@ [tasks.check] depends = [ "check:mypy", - "check:pyright", + "check:basedpyright", "check:pytest", ] @@ -16,8 +16,8 @@ pythonVersion=$(cat pyproject.toml | yq -p toml '.project.requires-python' | sed mypy --python-executable "${pythonExecutable}" --python-version "${pythonVersion}" . """ -[tasks."check:pyright"] -run = "uv run pyright" +[tasks."check:basedpyright"] +run = "uv run basedpyright" [tasks."check:pytest"] run = "uv run pytest" diff --git a/mise.toml b/mise.toml index 60d0e84..2951547 100644 --- a/mise.toml +++ b/mise.toml @@ -4,7 +4,7 @@ python = "3.14.3" uv = "0.10.7" # Common tools -"npm:pyright" = "1.1.408" +"npm:basedpyright" = "1.38.2" "pipx:shellcheck-gha" = "0.1.2" prettier = "3.6.2" ruff = "0.15.4" @@ -69,7 +69,7 @@ shell = "sh -c" [tasks.check] depends = [ "check:prettier", - "check:pyright-repo", + "check:basedpyright-repo", "check:ruff", "check:ruff:format", "check:shellcheck", @@ -100,8 +100,8 @@ fi prettier --ignore-path=.gitignore --ignore-path=.prettierignore "$userIgnoreArg" --check . """ -[tasks."check:pyright-repo"] -run = "pyright" +[tasks."check:basedpyright-repo"] +run = "basedpyright" [tasks."check:ruff"] run = "ruff check" diff --git a/solvers/python/mise.toml b/solvers/python/mise.toml index a1c177c..e5e0a26 100644 --- a/solvers/python/mise.toml +++ b/solvers/python/mise.toml @@ -4,7 +4,7 @@ [tasks.check] depends = [ "check:mypy", - "check:pyright", + "check:basedpyright", "check:pytest", ] @@ -16,8 +16,8 @@ pythonVersion=$(cat pyproject.toml | yq -p toml '.project.requires-python' | sed mypy --python-executable "${pythonExecutable}" --python-version "${pythonVersion}" . """ -[tasks."check:pyright"] -run = "uv run pyright" +[tasks."check:basedpyright"] +run = "uv run basedpyright" [tasks."check:pytest"] run = "uv run pytest" From c58dc0711e824a2cf1a6385f3e7b254cad02ffeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niko=20B=C3=B6ckerman?= Date: Tue, 3 Mar 2026 21:31:15 +0200 Subject: [PATCH 2/2] Enable recommended mode for basedpyright --- aoc-main/pyrightconfig.json | 2 +- pyrightconfig.json | 2 +- solvers/python/pyrightconfig.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/aoc-main/pyrightconfig.json b/aoc-main/pyrightconfig.json index 0e4f20f..9f328fe 100644 --- a/aoc-main/pyrightconfig.json +++ b/aoc-main/pyrightconfig.json @@ -1,4 +1,4 @@ { "include": ["**"], - "typeCheckingMode": "strict" + "typeCheckingMode": "recommended" } diff --git a/pyrightconfig.json b/pyrightconfig.json index c53c106..7751ef9 100644 --- a/pyrightconfig.json +++ b/pyrightconfig.json @@ -1,5 +1,5 @@ { "include": ["**"], "exclude": ["aoc-main/", "solvers/cpp/cmake-conan/", "solvers/python/"], - "typeCheckingMode": "strict" + "typeCheckingMode": "recommended" } diff --git a/solvers/python/pyrightconfig.json b/solvers/python/pyrightconfig.json index 0e4f20f..9f328fe 100644 --- a/solvers/python/pyrightconfig.json +++ b/solvers/python/pyrightconfig.json @@ -1,4 +1,4 @@ { "include": ["**"], - "typeCheckingMode": "strict" + "typeCheckingMode": "recommended" }