Make telegram available without telegram.ext#2324
Conversation
|
@Bibo-Joshi Looks good in general. :-) I thought that it would be better if python-telegram-bot would add python-telegram-bot-raw as a dependency (instead of vendoring the same files) but maybe your approach is simpler. |
|
@Bibo-Joshi Oh, and we'd need to update the wiki on how to release a new version. |
|
@Bibo-Joshi Following up on my first comment: |
|
@tsnoam Seems like I didn't test thoroughly enough earlier; |
|
@Bibo-Joshi Make sure to |
Tested and it seems like the union of the files, i.e. installing first ptb-raw and then ptb gives ptb and so does first installing ptb and then ptb-raw. |
|
@Bibo-Joshi And what happens if you just uninstall one of them afterwards? |
uninstalling only ptb-raw leaves |
|
Big warning should be fine in this situation imo |
Can we drop the |
you're absolutely right 👍 Already did that locally, just didn.t pubsh the changes yet :D |
|
Edit: Switching to Traceback (most recent call last):
File "foo.py", line 77, in <module>
main()
File "foo.py", line 66, in main
message = updater.bot.send_dice(1145108092, foo=123)
File "…\python-telegram-bot\telegram\bot.py", line 118, in decorator
result = func(*args, **kwargs)
TypeError: send_dice() got an unexpected keyword argument 'foo'However, as |
|
A first test-release can be viewed at https://test.pypi.org/project/python-telegram-bot-raw/ |
|
Oh and I extended the kwargs for |
|
All right, the latest commits remove the ptb-raw pytz dependency and move the implementation of out = bot.send_message(…)
if isinstance(out, Promise):
...
else:
...in the context of MessageQueue. I added a deprecation notice and we can remove the shortcuts in one of the next major releases. While typing I see that test fail timezone related, will have to have another look … |
Co-authored-by: Harshil <37377066+harshil21@users.noreply.github.com>
tsnoam
left a comment
There was a problem hiding this comment.
all in all looks good.
some minor comments, up to you how you want to handle them.
|
For some reason codecov results don't appear anymore, but on the codecov page it looks fine. |
# Conflicts: # telegram/bot.py # telegram/utils/promise.py # telegram/utils/webhookhandler.py
Introduces
setup-raw.pyandrequirements-raw.txtso that one can installtelegramwithouttelegram.ext.Please also see the comments below for more details on how things are done and why
python setup-raw.py bdist_wheelproduces a wheel that I can install. However, in the sdist.tar.gzbothsetup.pyandrequirements.txtare included and I can't getsetuptoolsto include them only forsetup.pyand the-rawversions only forsetup-raw.py. Ofc this leads topip install ptb-raw.tag.gzinstalling the usual ptb (just without theextdirectory) instead of pbt-raw … But IG even if we manage to include only the-rawfiles,pip install ptb-raw.tar.gzwill fail, b/c pip is looking for asetup.py…In any case, there some things to do
long_descriptionto be rendered at pypipytzfromreqs-rawtoreqs. In v13 pytz was introduced in connection with theJobQueue&Defaults.tzinfoandhelpers.to_float_timestampcurrently depends on it. In hindsight probably not a good idea …decorator(see below)pip install python-telegram-bot-raw)tg.utilsto a newtg.ext.utils. E.g.WebhookHandleruses tornado and that won't be installed in ptb-raw.setup*.pyby moving stuff to helper functions