-
-
Notifications
You must be signed in to change notification settings - Fork 90
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
Add basic type hints #385
Add basic type hints #385
Conversation
So I gave some simple type hints a try. However I cannot active them in CI yet, since mypy will check the ,py files as well as the pyi ones. |
@webknjaz can you please have a look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR needs rebasing and I've also added a few notes on things that need to be fixed. Could you look into it?
Codecov Report
@@ Coverage Diff @@
## master #385 +/- ##
==========================================
- Coverage 80.50% 79.43% -1.08%
==========================================
Files 28 28
Lines 4390 4390
==========================================
- Hits 3534 3487 -47
- Misses 856 903 +47 |
So, running mypy will now fail:
Either we exclude the py files or we use stubtest to check them against the real files (https://stackoverflow.com/questions/51716200/how-do-you-check-if-a-typeshed-stub-pyi-file-matches-the-implementation) |
It's a side-effect of passing files as individual args to When this is ready and works well, you'll need to duplicate the mypy entry (the hook part inside the repo) and invoke it with Python 2 while the first one would be invoked with Python 3. P.S. You may keep |
done
Sorry, I don't get this point
I added what's possible but for some dependencies there are no types... |
@webknjaz okay, config is now ready. However, do you really want to check the .py files if there is no pyi file? |
I think so. It should ease the further mypy adoption, right?
You could try that. |
Re: |
@kasium thanks again for working on this! Also, I wanted to ask if you were planning to apply interactive rebase to your PR branch when you're done to clean it up a bit? If not, I'll likely do this myself before merging. Please tell me what your preference is. |
@webknjaz I'll take a look into the issue. If it's fineΒ΄, I'll leave the rebase up tp you (however, a squash also helps). |
Yes, it would be great to include that type of testing as well. I just want to be conscious about the PR size and the scope creep. It's probably easier to have a series of small PRs rather than a big one β it's easier to digest from the reviewer's perspective and easier to merge complete changes faster rather than having some finished parts of the change wait for one unfinished one. It'd also help for GHA to run automatically on your PRs (GitHub requires manual approval from me for the first-time contributor PRs but post-merge, the new PRs won't need that). |
@webknjaz I hope, I now solved the missing pieces. I guess it makes sense to have a general issue with some tasks
This all can be done in separate PRs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job! I'll merge this soon.
As for the tracking issue, that sounds reasonable, feel free to file it.
Looks like GHA has broken one of their images so I'll have to merge without green CI. |
β What kind of change does this PR introduce?
π What is the related issue number (starting with
#
)#384
β What is the current behavior? (You can also link to an open issue here)
#384
β What is the new behavior (if this is a feature change)?
no new behavior
π Other information:
π Checklist:
and description in grammatically correct, complete sentences
This change isβ