-
Notifications
You must be signed in to change notification settings - Fork 949
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 type hints #966
Comments
remove that issue from milestone 5.2.0. It is much longer than expected. Will do it again but using a top down approach by typing
Postone that issue for later, will work on it a background task. Any help is welcome 🙂 |
What about gradually typing this library? We can write |
I tried that in my previous attempt and it does not help. We access keys of z dict and the values may be an I will see may be i can simply add types to some user facing functions and leave the rest for later, that is an other option too 🤔 |
I found the bottleneck of this feature: the This brings circular dependency. In order to simply type the
From there we should be able to add some basic typing. Will plan this for release 6.0.0 |
How much progress has been made for this issue? Is it possible to see this progess at the current moment? |
Hi it's starting, I have a branch where I add commits for the 6.0.0 release. You can follow it here: https://github.com/burnash/gspread/commits/feature/release_6_0_0 |
I could try helping towards this. If there are any particular files you'd like me to type hint, I'll gladly give it a go. |
That would be helpful thanks, I am currently typing the file https://github.com/burnash/gspread/blob/feature/release_6_0_0/gspread/utils.py which is very heavy to do (on my spare time), but over half of it is done. you can try adding typing to https://github.com/burnash/gspread/blob/feature/release_6_0_0/gspread/auth.py , there aren't many functions but they rely on untyped libraries :-( or you can try: https://github.com/burnash/gspread/blob/feature/release_6_0_0/gspread/client.py which is heavier but we still need to do it. Let me know which one you do, I'll do the other one. then open your PR and target the branch https://github.com/burnash/gspread/blob/feature/release_6_0_0 I run mypy as follow Thank you for helping, looking forward to review your PR. |
I'll try client.py |
Any progress on this? |
Hi yes, you can follow the branch https://github.com/burnash/gspread/tree/feature/release_6_0_0 I push on it every changes that impacts the typing. i am still facing issues with refactoring for the new clients and HTTP clients in order to prevent cyclic imports. |
Basic typing progress for each file (basic == no use of
|
Went here to add types for this library and found that someone has finally done it. Thank you for your effort. Have you also tried using MonkeyType? |
Hi yes I'm working on it, on the branch You're welcome to participate, i tried to take it step by step. Above is a lost of what is left to do. Just let le know which one you wish to tackle. Interestingly the longest/hardest was the I have not tried this tool, but it will take a look |
Ok, I can try adding types for utils |
Great thank you 😃 open a PR when ready of if you're stuck we'll work from here. |
I'll take the |
Btw @butvinm please start your branch from |
@lavigne958 I made draft PR but need discuss some issues. |
I see, I'll have a look, it will take some time. |
#966 Add sketch typing for utils.py
Current status:
|
@lavigne958 will you add a type-checking command to the CI? |
Yes it's already the case ok branch release_6.0 I just updated the command to have better output. |
what does it check? For example, this commit passed the CI, but the functions in the commit do not have typing, so I would expect it to fail Line 737 in 30ccb5a
|
Currently I wish the branch There are 2 types of run in |
replaced by #1321 |
Add type hints to gspread.
Add mypy to check types in the CI.
This allows developer to get type hints from their editors when developing.
This allows users to get the type hints from their editors when using gspread and have a clear hint on the return value of each function, the type of each expected argument.
It should make the use of gspread much simpler and the development of gspread easier.
The text was updated successfully, but these errors were encountered: