Skip to content

Run Pyrefly in CI#14499

Open
yangdanny97 wants to merge 6 commits into
sphinx-doc:masterfrom
yangdanny97:pyrefly-ci
Open

Run Pyrefly in CI#14499
yangdanny97 wants to merge 6 commits into
sphinx-doc:masterfrom
yangdanny97:pyrefly-ci

Conversation

@yangdanny97

@yangdanny97 yangdanny97 commented Jun 24, 2026

Copy link
Copy Markdown

Per discussion on #14496, this PR replaces the ty github action with pyrefly, another Rust-based Python type checker.

Pyrefly was already included as a development dependency, but it was not pinned to a specific version. This PR pins it to 1.1.1, so that updates do not break the CI unless maintainers choose to upgrade. The local Pyrefly configuration has been updated to better-reflect mypy's configurations, and newly-introduced errors have been suppressed (~50 total).

closes #14496
fixes #14238

Comment thread sphinx/_cli/__init__.py
Comment on lines +273 to 274
# pyrefly: ignore [bad-assignment]
module: _SubcommandModule = importlib.import_module(_COMMANDS[command_name])

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the problem here?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The exact error is

ModuleType is not assignable to _SubcommandModule
ModuleType.parser_description or _SubcommandModule.parser_description uses __getattr__, which cannot be checked for override compatibility

It comes from here: https://github.com/facebook/pyrefly/blob/ce5d522246ead87f02dc58fb28731fd9f51e2a16/pyrefly/lib/alt/attr.rs#L1456

Maybe it's a gap in Pyrefly that we can address (I've filed facebook/pyrefly#4077) but I don't think it's necessarily blocking here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci: the 'ty' typechecking is failing

2 participants