From 751bca43f7397c9a233357a9a8bef986c6ec7572 Mon Sep 17 00:00:00 2001 From: cgasgarth <64235119+cgasgarth@users.noreply.github.com> Date: Sun, 12 Apr 2026 21:26:35 -0500 Subject: [PATCH] Replace Pyright with ty --- .github/workflows/ci.yml | 2 +- README.md | 2 +- pyproject.toml | 17 +++++++++++------ scripts/typecheck-python.sh | 2 +- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f405715..d51e9fe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,7 +57,7 @@ jobs: run: uv run pytest server/tests - name: Run Python type checks - run: uvx pyright server shared + run: uv run ty check darktable-build: runs-on: ubuntu-latest diff --git a/README.md b/README.md index 5856291..9c27cdc 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,7 @@ uv run pytest server/tests Run Python type checking: ```bash -uvx pyright server shared +uv run ty check ``` Run local pre-commit checks: diff --git a/pyproject.toml b/pyproject.toml index e1207d0..31044c1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,7 +20,7 @@ dependencies = [ [project.optional-dependencies] dev = [ "pre-commit>=4.3,<5.0", - "pyright>=1.1.408,<2.0", + "ty>=0.0.1a15,<0.1", "pytest>=8.3,<9.0", ] @@ -34,10 +34,15 @@ include = ["server*", "shared*"] [tool.setuptools.package-data] server = ["codex_bridge/prompts/**/*.txt", "codex_bridge/prompts/**/*.j2"] -[tool.pyright] +[tool.ty.src] include = ["server", "shared"] exclude = ["server/tests"] -venvPath = "." -venv = ".venv" -pythonVersion = "3.14" -typeCheckingMode = "basic" + +[tool.ty.environment] +python = ".venv" +python-version = "3.14" + +[tool.ty.rules] +invalid-assignment = "ignore" +invalid-return-type = "ignore" +unresolved-attribute = "ignore" diff --git a/scripts/typecheck-python.sh b/scripts/typecheck-python.sh index 5522fb6..6c23ff0 100644 --- a/scripts/typecheck-python.sh +++ b/scripts/typecheck-python.sh @@ -1,4 +1,4 @@ #!/usr/bin/env bash set -euo pipefail -uvx pyright server shared +uv run ty check