Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a pre-commit hook #14618

Closed
GideonBear opened this issue Feb 6, 2023 · 3 comments
Closed

Add a pre-commit hook #14618

GideonBear opened this issue Feb 6, 2023 · 3 comments
Labels

Comments

@GideonBear
Copy link

Feature

Add a pre-commit hook to mypy (see mirrors-mypy/.pre-commit-hooks.yaml).
The only major roadblock is building it using mypyc, but that could use mypy_mypyc-wheels.

Pitch

Currently, to use mypy as a pre-commit hook, you need to use mirrors-mypy. It works fine, the only problem is you're not able to use arbitrary commits or branches (including master), just versions released on PyPI. If mypy were to add pre-commit hooks to the repo itself, it would be possible.


Also see pre-commit/mirrors-mypy#80

@hauntsaninja
Copy link
Collaborator

Thanks for the suggestion, but we won't be doing this. In addition to the wheels issue (which is very important to resolve, compilation makes mypy 4x faster), pre-commit just often is not a great fit for running mypy. It results in enough issues that I wouldn't feel comfortable having an official setup for it. See #13916

@hauntsaninja hauntsaninja closed this as not planned Won't fix, can't repro, duplicate, stale Feb 6, 2023
@GideonBear
Copy link
Author

Hi @hauntsaninja,
Thanks for the reply! I completely understand why you don't want to add it. Any chance there can be alpha/beta/dev releases released once in a while, especially when there's a long time before the next update? I don't know if it's necessary before 1.0, seems like it'll get released soon, but it's something that will help with using mypy with pre-commit.

@hauntsaninja
Copy link
Collaborator

Yeah, mypy's release frequency is a painpoint :-(

I think more releases, and more prereleases would be great! See #12210 (comment)

(In fairness to the Dropbox folks, who are in charge of new version releases, we were much better about release frequency for parts of 2022. I think the big "1.0" number has put some pressure on this release)

It sounds like you're aware of https://github.com/mypyc/mypy_mypyc-wheels ; you can specify URLs in requirements, so maybe there's a way to get pre-commit to use one of those wheels too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants