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 #85

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

Find an alternative to Pyre #85

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.
(mypy-django hasn't been
updated since 2017.)

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
Copy link
Member Author

dirn commented Oct 7, 2020

At this point I'm leaning towards figuring out a way to make mypy work with pyright as plan b, but I'm open to hearing thoughts from others.

@dirn dirn added the request for comments Feedback is requested before work on this issue can proceed label Oct 7, 2020
dirn added a commit that referenced this issue Oct 12, 2020
This is a work-in-progress attempt at switching over to mypy as part of
 #85. There's still some work to be done (e.g. pyre ignore comments need
to be removed, mypy ignore comments need to be added where appropriate)
and I'm currently working with some local changes pyre's stubs, but I
wanted to track the work being done.
@dirn dirn mentioned this issue Oct 12, 2020
dirn added a commit that referenced this issue Oct 12, 2020
This is a work-in-progress attempt at switching over to mypy as part of
 #85. There's still some work to be done (e.g. mypy ignore comments need
 to be added where appropriate) and I'm currently working with some
 local changes pyre's stubs, but I wanted to track the work being done.
dirn added a commit that referenced this issue Oct 12, 2020
This is a work-in-progress attempt at switching over to mypy as part of
 #85. There's still some work to be done (e.g. mypy ignore comments need
to be added where appropriate) and I'm currently working with some
local changes pyre's stubs, but I wanted to track the work being done.
dirn added a commit that referenced this issue Nov 6, 2020
This is a work-in-progress attempt at switching over to mypy as part of
 #85. At the moment everything seems to be working except for the some
changes to pyre's stubs that are addressed in facebook/pyre-check#321.
dirn added a commit that referenced this issue Nov 6, 2020
This is a work-in-progress attempt at switching over to mypy as part of
 #85. There's still some work to be done (e.g. mypy ignore comments need
to be added where appropriate) and I'm currently working with some
local changes pyre's stubs, but I wanted to track the work being done.
dirn added a commit that referenced this issue Nov 6, 2020
This is a work-in-progress attempt at switching over to mypy as part of
 #85. There's still some work to be done (e.g. mypy ignore comments need
to be added where appropriate) and I'm currently working with some
local changes pyre's stubs, but I wanted to track the work being done.
dirn added a commit that referenced this issue Nov 10, 2020
This is a work-in-progress attempt at switching over to mypy as part of
 #85. There's still some work to be done (e.g. mypy ignore comments need
to be added where appropriate) and I'm currently working with some
local changes pyre's stubs, but I wanted to track the work being done.
dirn added a commit that referenced this issue Nov 10, 2020
This is a work-in-progress attempt at switching over to mypy as part of
 #85. There's still some work to be done (e.g. mypy ignore comments need
to be added where appropriate) and I'm currently working with some
local changes pyre's stubs, but I wanted to track the work being done.
dirn added a commit that referenced this issue Nov 10, 2020
This is a work-in-progress attempt at switching over to mypy as part of
 #85. There's still some work to be done (e.g. mypy ignore comments need
to be added where appropriate) and I'm currently working with some
local changes pyre's stubs, but I wanted to track the work being done.
dirn added a commit that referenced this issue Jan 11, 2021
This is a work-in-progress attempt at switching over to mypy as part of
 #85. There's still some work to be done (e.g. mypy ignore comments need
to be added where appropriate) and I'm currently working with some
local changes pyre's stubs, but I wanted to track the work being done.
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