Skip to content

馃敡 build(type): replace mypy with pyrefly - #1168

Merged
gaborbernat merged 6 commits into
pypa:mainfrom
gaborbernat:switch-to-pyrefly
Aug 27, 2026
Merged

馃敡 build(type): replace mypy with pyrefly#1168
gaborbernat merged 6 commits into
pypa:mainfrom
gaborbernat:switch-to-pyrefly

Conversation

@gaborbernat

@gaborbernat gaborbernat commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

#1159 bundled three type checkers. Running all three in development and CI feels like overkill. I have kept this PR to switching from mypy to Pyrefly for the project and its public types as requested by @layday.

Maintainers reviewing pypa#1159 favored one checker and rejected ty. Pyrefly now checks the project and enforces 100% package type coverage in the existing tox environment. The configuration promotes the two diagnostics that caught omissions in the mutation test.
`strict` leaves most Pyrefly diagnostics at their default severity. With
`all`, new diagnostics fail CI until maintainers resolve or disable them.

Resolve the actionable findings and install `colorama` in the type
environment. Keep two style diagnostics off because they reject 288
intentional uses; the override diagnostic would add a runtime
`typing_extensions` dependency on Python 3.10.
@gaborbernat
gaborbernat marked this pull request as ready for review August 25, 2026 06:25
@gaborbernat
gaborbernat enabled auto-merge (squash) August 25, 2026 06:32

@layday layday left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

A couple of these were too verbose I thought, otherwise looks good.

Comment thread src/build/_ctx.py Outdated
Comment thread src/build/env.py Outdated
gaborbernat and others added 3 commits August 26, 2026 14:44
Co-authored-by: layday <layday@protonmail.com>
Co-authored-by: layday <layday@protonmail.com>
Comment thread tox.toml Outdated
@layday

layday commented Aug 27, 2026

Copy link
Copy Markdown
Member

I'm okay with this but let's wait for Henry's input as well.

@layday
layday disabled auto-merge August 27, 2026 20:45
@gaborbernat
gaborbernat merged commit 5711d25 into pypa:main Aug 27, 2026
60 checks passed
@gaborbernat

Copy link
Copy Markdown
Contributor Author

I'm okay with this but let's wait for Henry's input as well.

Sorry missed that, if Henry has anything to add happy to open follow-uyp PR.

henryiii pushed a commit that referenced this pull request Sep 9, 2026
Co-authored-by: layday <layday@protonmail.com>
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.

2 participants