This repository has been archived by the owner on Oct 2, 2021. It is now read-only.
Find an alternative to Pyre #86
Labels
request for comments
Feedback is requested before work on this issue can proceed
When we switched to Django in #22, we switched from mypy to Pyre. The main
reason was that the latter included stubs for Django, whereas the former
requires an additional plugin which requires executing the code;
this is problematic because of how our settings are structured.
Pyre's stubs seem to suffer from some breakage between releases (as noted by the
CI logs for #78). While looking into one of the errors, I discovered a URL while
reading a comment about an import in a stub file that points to Facebook's
internal Phabricator. It's pretty clear that this is Facebook's source of truth
for Pyre. I'd rather use an open source tool that is developed in the public.
There are a few options for what to use. We can go back to mypy. We'll still
have the problem of getting stubs for Django. mypy-django is a project that
provides stubs but isn't installable; using it would require cloning the
repository as part of the tox environment.
Another option would be to use pyright. This is written in TypeScript. I'm not
sure how that would work with tox. It seems to support generating type stubs
for libraries that don't have them which could be useful.
The final option that I know of is pytype. Unlike mypy, pytype infers types
from your code instead of using gradual typing. It's also more lenient and
allows any operations that would succeed at runtime. I prefer mypy's approach.
The text was updated successfully, but these errors were encountered: