-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Add Defaults.run_async support #2210
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 Defaults.run_async support #2210
Conversation
Signed-off-by: starry69 <starry369126@outlook.com>
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.
Thanks for the quick PR!
Besides some nitpicks that I left, please make sure that pre-commit & codecov are happy. please see the contribution guide on how to run pre-commit locally. tests/test_dispatcher.py
would be, where there new tests should go and you can take inspiration from the existing tests :)
we can ignore test_official
for now, as we didn't merge API 5.0 yet …
Signed-off-by: starry69 <starry369126@outlook.com>
Will look into pre-commit and tests for |
Signed-off-by: starry69 <starry369126@outlook.com>
@Bibo-Joshi is everything alright now? |
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.
thanks for the update. apart from pre-commit not being happy, the test doesn't really make sense to me :/
Signed-off-by: starry69 <starry369126@outlook.com>
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.
Please also add a test for the error handler similar to the othe new test. in pycharm you can easily run the tests with coverage, btw, so you can check for coverage before pushing.
and please run pre-commit
locally (see contribution guide) ;)
Signed-off-by: starry69 <starry369126@outlook.com>
Yeah sure, I'll add test for err handler aswell... And yeah i did run pre-commit locally but dunno why mypy is failing here, as it was passing in my local environment |
mypy isn't failing, black and flake8 are ;) |
Signed-off-by: starry69 <starry369126@outlook.com>
Signed-off-by: starry69 <starry369126@outlook.com>
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.
we're close :) left some nitpicks and also black still fails. you can run it manually with black .
before commiting, don't know why pre-commit doesn't fail for you …
Thanks for reviewing! I'll address suggested changes in evening.. |
Signed-off-by: starry69 <starry369126@outlook.com>
@Bibo-Joshi is everything alright now? |
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.
just one documentation nitpick left :) btw, github already notifies me on updates ;)
telegram/ext/defaults.py
Outdated
@@ -43,6 +43,8 @@ class Defaults: | |||
be ignored. Default: :obj:`True` in group chats and :obj:`False` in private chats. | |||
tzinfo (:obj:`tzinfo`): A timezone to be used for all date(time) objects appearing | |||
throughout PTB. | |||
run_async (:obj:`bool`): Optional. Default setting for the ``run_async`` parameter of | |||
handlers and error handlers registered through :meth:`Dispatcher.add_handler`. |
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.
please link both add_handler
and add_error_handler
at the right places ;)
Signed-off-by: starry69 <starry369126@outlook.com>
Thanks for your contribution and your patience :) |
Adds
run_async
support intelegram.ext.Defaults
as discussed in: #2208