-
-
Notifications
You must be signed in to change notification settings - Fork 145
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
Leverage type hints #21
Conversation
Codecov Report
@@ Coverage Diff @@
## main #21 +/- ##
==========================================
+ Coverage 69.27% 70.52% +1.25%
==========================================
Files 6 6
Lines 179 190 +11
==========================================
+ Hits 124 134 +10
- Misses 55 56 +1
Continue to review full report at Codecov.
|
Have a look at this comment on Reddit. The first point they make about the current classes inheritance might bite you. |
this idea by @pedrovhb is great. I think we should do that. this would fix this
the base client should accept both AsyncClient, as well as Client |
LGTM so far overall but there are still a lot of Mypy errors to fix!
Don't be afraid, one of the two PR is only working in Do you mind if I add commits to this branch to give a hand? |
That will be great! Please do so. |
Thanks for the commits. I was doing lot of things wrong, as I was driven by the urge to suppress mypy. I had a few unpushed commits, but I deleted them,as they were dangerous.(huge code repition) I have no idea how to fix, the remaining mypy errors. 😢 Its all up to you now.🙌 |
Yeah I can take over, no worries, thanks a lot for the work so far! |
How did mypy pass in CI ? Running mypy locally still gives two errors: ➜ mypy notion_client
notion_client/client.py:128: error: Argument 1 to "_check_response" of "BaseClient" has incompatible type "Union[Response, Coroutine[Any, Any, Response]]"; expected "Response"
notion_client/client.py:129: error: Incompatible return value type (got "Union[Response, Coroutine[Any, Any, Response]]", expected "Response")
Found 2 errors in 1 file (checked 6 source files) |
Yeah, I wondered that as well. Answer here. :) |
Let's go! 🎉 Thank you again for your very motivating efforts @aahnik. |
fixes #6
py.typed
file