Closed rmlarose closed 3 years ago
Agreed to add type check @ mitiq meeting.
Mitiq meeting notes: The scope here would be adding the CI check and then squashing any resulting issues one master.
So there are 466 errors to fix on master, this is gonna take a while...
Just clarifying that a solution to this issue for UnitaryHACK may build upon #556 by @crazy4pi314.
Hi @crazy4pi314 @rmlarose @nathanshammah, I would like to work on this issue. Just for clarification, following the checklist in PR #556 should be enough or do I have to work on anything specific? Thanks!
That checklist for generic PRs. (Note you'll see a slightly different one if you open a new PR.) The steps to fix this issue are:
make check-types
and fix all mypy errors.Okay, and does all the code need to be annotated? I went through the discussion in the PR there it was being discussed on ignoring type checking on test files (hence no annotation required for the test files).
Okay, and does all the code need to be annotated? I went through the discussion in the PR there it was being discussed on ignoring type checking on test files (hence no annotation required for the test files).
@crazy4pi314 @rmlarose @nathanshammah
I think it all should be annotated, but I am not sure what the rest of the team thinks. Also gonna ping @andreamari
No need to annotate tests.
I also think that excluding tests is fine. In this case, it may be necessary to find some trick for telling mypy
to exclude tests unless this is automatic.
Okay, thanks for clearing the doubts.
I have updated some files with type annotations and updated the CI for type checking the non-test files. Should I create a PR or PR them all together after updating the rest of the files?
Thanks @TripleR47! It's fine to do separate PRs as you describe (would be good if you're running mypy on the files you added annotations for).
Yes, I'm running the mypy on the annotated files. And will it be okay if I push the future changes in the same PR? Thanks!
Hey @rmlarose, I created a PR, but it failed the validate and the unit test. I went through the error messages and the source code. But the source code looks fine. Any suggestions on how to work on it? Thanks!
Yep! I think just adding mypy to dev_requirements.txt will solve all (most) of the failures. make check-types
failed because mypy wasn't installed, and some tests failed I think because of type checking also.
Okay, updating the dev_requirements.txt file.
We had a PR (#326) to add mypy to CI, but while this PR fixed mypy errors it never actually added a job to CI. Do we want to add this?