Skip to content
This repository has been archived by the owner on Oct 2, 2021. It is now read-only.

Find an alternative to Pyre #86

Closed
dirn opened this issue Oct 7, 2020 · 1 comment
Closed

Find an alternative to Pyre #86

dirn opened this issue Oct 7, 2020 · 1 comment
Labels
request for comments Feedback is requested before work on this issue can proceed

Comments

@dirn
Copy link
Member

dirn commented Oct 7, 2020

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.

@dirn dirn added the request for comments Feedback is requested before work on this issue can proceed label Oct 7, 2020
@dirn
Copy link
Member Author

dirn commented Oct 7, 2020

When I originally tried to create this issue, GitHub gave me a 404. I had no idea it succeeded until making a second one. I'm closing this in favor of that one (#85). I'm not including a reference to the issue to avoid noise on it.

@dirn dirn closed this as completed Oct 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
request for comments Feedback is requested before work on this issue can proceed
Projects
None yet
Development

No branches or pull requests

1 participant