fix: skip pyright on pre-commit.ci (#3)#7
Merged
Conversation
pyright runs via `uv run pyright`, which needs uv on PATH plus network access to install the package and its deps so imports resolve. pre-commit.ci provides neither at hook runtime, so the hook can't work there. Skip it on pre-commit.ci via `ci.skip`; it still runs locally (uv present) and in GitHub Actions CI (`uv run pyright` in .github/workflows/ci.yaml), which stays authoritative for type-checking. Closes #3 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #3.
Problem
The
pyrighthook runsentry: uv run pyrightwithlanguage: system. On pre-commit.ci this can't work:uvon PATH —language: systemuses whatever the pre-commit.ci image provides;uvisn't installed.uv,uv run/uv synccan't install the package +fastapi/pydanticthat pyright needs to resolve imports.The only "in-service" workaround is the node-based pyright hook with every dependency hand-listed in
additional_dependencies— brittle, duplicates the dep list, and still can't install the local package. So there's no clean fix on pre-commit.ci; disabling it there (the issue's own suggestion) is the right call.Change
Add a top-level
ci.skip: [pyright]to.pre-commit-config.yaml. This is scoped to pre-commit.ci only:uvx prek/pre-commit), whereuvis present.uv run pyrightalready executes in.github/workflows/ci.yaml, which stays authoritative for type-checking.Verification
uvx prek run --all-files→pyright ... Passed(local run unaffected).SKIP=pyright uvx prek run --all-files(the local equivalent ofci.skip) → only ruff hooks run, pyright skipped.🤖 Generated with Claude Code