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

Switch static type checker from pyre to mypy #729

Open
kiukchung opened this issue Apr 17, 2023 · 0 comments
Open

Switch static type checker from pyre to mypy #729

kiukchung opened this issue Apr 17, 2023 · 0 comments

Comments

@kiukchung
Copy link
Collaborator

Description

Switch static type checker to mypy and include mypy compatible type stubs (PEP 561 compliant) by adding a py.typed file at the root of torchx module (see https://mypy.readthedocs.io/en/stable/installed_packages.html#creating-pep-561-compatible-packages).

Motivation/Background

TorchX currently uses pyre which works well for Meta's internal builds but is sub-optimal in OSS for several reasons:

  1. mypy is more widely used (by up and downstream projects)
  2. mypy has better plugins for IDEs and such in OSS.
  3. mypy is used by pytorch (and there's an RFC being written to propose torchx be upstreamed to pytorch)

Detailed Proposal

Switching over to mypy would involve a few changes:

  1. Creating a mypy.ini file and updating dev-requirements.txt with a dependency to mypy (instead of pyre)
  2. Changing the pyre CI script to use mypy
  3. A one-time codemod to make the torchx.* mypy compliant since pyre and mypy rules are slightly different

Alternatives

N/A - mypy is itself an alternative to pyre.

Additional context/links

N/A

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

No branches or pull requests

1 participant