Repository navigation
feat: typecheck python with pyrefly - #171
Open
iloveitaly wants to merge 1 commit into
Open
iloveitaly wants to merge 1 commit into
iloveitaly wants to merge 1 commit into
Conversation
Replace the pyright dev dependency, project config, and lint recipe with pyrefly, and point the editor at the Pyrefly language server. Co-authored-by: Michael Bianco <mike@mikebian.co>
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.
Motivation
Pyright was the Python type checker in lint, config, and the editor. Pyrefly is the replacement.
Description
pyright[nodejs]dev dependency forpyrefly1.4.0.[tool.pyright]with[tool.pyrefly].infer-with-first-use = falsekeeps empty containers asAny, matching pyright standard mode. Project excludes stay on local clones, generated migrations, playground, and tmp. Pyrefly already excludes node_modules, caches, and virtualenvs.just py_lintrunspyrefly check. The default.passes no paths soproject-excludesapply. CI uses--output-format=full-text-with-githuband rewrites absolute paths to repo-relative annotation paths.meta.pyrefly, setpython.languageServertoNone, and disable Cursor's Pyright language services.PYRIGHT_PYTHON_PYLANCE_VERSION.Nonemadebreakpoint()raiseTypeError), location fixtures are aTypedDict, and invalid quarters go throughmodel_validate.posthog.default_clientandTypeIDType.raw()keep a pyrefly ignore because the stubs do not describe the runtime types.Screenshots / Test
just py_lintexits 0. Pyrefly reports 0 errors.CI=1 just py_lintexits 0, including the GitHub annotation format.just py_lint app/utils/address.py app/routes/utils/pydantic_lists.pyexits 0 after the old pyright ignores were removed.ValidationError.pytest tests/unit/dates_test.pydid not collect here: app startup could not resolveredis.workspace.orb.local.Three warnings do not fail the command: deprecated
client.charges, unreachable code after the early return inmigrations/sanitize_production.py, and missing stubs forpsutil.Links