MLH-Fellowship / pyre-check

Performant type-checking for python.
https://pyre-check.org/
MIT License
3 stars 1 forks source link

[Fall 2021] Step 1: Pyre - Fix type checking errors in Pytorch `torch/utils/hipify/hipify_python.py` #78

Open 0xedward opened 2 years ago

0xedward commented 2 years ago

This task is part of a bigger effort to migrate Pytorch from Mypy to Pyre. The goal of this task for you is to gain comfort with the Python type system and the types of errors Pyre gives. Future Pysa project work and debugging builds on this foundation.

Development Environment Setup

Task Description

Fix the Pyre type checking errors in torch/utils/hipify/hipify_python.py:

torch/utils/hipify/hipify_python.py:196:8 Incompatible variable type [9]: clean_ctx is declared to have type `GeneratedFileCleaner` but is used as type `None`.
torch/utils/hipify/hipify_python.py:944:4 Incompatible variable type [9]: clean_ctx is declared to have type `GeneratedFileCleaner` but is used as type `None`.

Submitting a PR

We use the following linters internally, so to save everyone's time, please make sure you run the following linters locally and fix errors related to the files you modified before submitting a PR:

black && usort format . && flake8

To install the linters, you can run the following command:

pip install flake8 usort black==21.4b2
arpancodes commented 2 years ago

Created a PR to pytorch repo: https://github.com/pytorch/pytorch/pull/66164