pyrefly icon indicating copy to clipboard operation
pyrefly copied to clipboard

Integration with mypy_primer?

Open hauntsaninja opened this issue 9 months ago • 5 comments

Hello! Let me know if I can make https://github.com/hauntsaninja/mypy_primer useful for pyrefly

hauntsaninja avatar Apr 18 '25 20:04 hauntsaninja

Hi! We would love to integrate into mypy_primer. What would be the best way to go about it? We can put up a PR and collaborate that way?

maggiemoss avatar Apr 18 '25 22:04 maggiemoss

Yup! I also added a few lines on how to get set up here: https://github.com/hauntsaninja/mypy_primer#adding-support-for-a-new-type-checker

hauntsaninja avatar Apr 18 '25 23:04 hauntsaninja

Last week I got pyrefly working with mypy_primer in a fork at https://github.com/yangdanny97/mypy_primer, the basic behavior should be there but the per-project commands/configs need some changes.

If I opened a PR and we merged it now, would it affect the CI jobs for everyone that uses the primer? If so, we may want to wait till Pyrefly is more stable to reduce churn.

We're also running a version of mypy_primer in our internal CI, but it's an entirely new script that only reuses the per-project configs from the original mypy_primer. The main differences are that it uses mercurial instead of git, and it doesn't do a diff of before/after - it just runs once and logs the errors to a table for us to track the errors over time.

We'd like to run the regular version of mypy_primer in CI at some point though.

yangdanny97 avatar Apr 19 '25 10:04 yangdanny97

Sounds good! I think some of your diff would no longer be needed given some of my latest changes. See also https://github.com/hauntsaninja/mypy_primer/pull/155

The pyrefly branches are self-contained, so it won't really affect other projects' jobs if it were to be merged, so happy to have it upstreamed now

Also happy to grant some of y'all commit access, in case that makes anything easier

hauntsaninja avatar Apr 19 '25 20:04 hauntsaninja

Just keeping this thread updated: we got Pyrefly working on mypy primer with typeshed injected to the build last weekend.

An issue that we will need to work out later is how to get Pyrefly config it needs; @migeed-z and @yangdanny97 have both been injecting modifications (mainly around config handling) to our internal fork to fast-track type checking projects that don't work out of the box, and those changes will need to either be upstreamed or subsumed by @Solumin's work making Pyrefly read mypy and Pyright configs

For upstreaming, it will be fairly easy to tweak the pyrefly command with some flags but not so easy to write pyrefly config files

stroxler avatar Apr 30 '25 14:04 stroxler

This issue has someone assigned, but has not had recent activity for more than 2 weeks.

If you are still working on this issue, please add a comment so everyone knows. Otherwise, please unassign yourself and allow someone else to take over.

Thank you for your contributions!

github-actions[bot] avatar Jul 07 '25 00:07 github-actions[bot]

This issue has someone assigned, but has not had recent activity for more than 2 weeks.

If you are still working on this issue, please add a comment so everyone knows. Otherwise, please unassign yourself and allow someone else to take over.

Thank you for your contributions!

github-actions[bot] avatar Aug 05 '25 00:08 github-actions[bot]

@yangdanny97 With https://github.com/hauntsaninja/mypy_primer/pull/186, can we close this issue?

stroxler avatar Aug 11 '25 20:08 stroxler