Commit graph

42 commits

Author SHA1 Message Date
Bibo-Joshi
44e8292838
Drop python-telegram-bot-raw And Switch to pyproject.toml Based Packaging (#4288) 2024-06-15 10:29:19 +02:00
Bibo-Joshi
26f943771b
Apply pre-commit Checks More Widely (#4135) 2024-02-29 19:11:03 +01:00
Harshil
c23eb8ec08
Bump black and ruff (#4089)
Co-authored-by: Hinrich Mahler <22366557+Bibo-Joshi@users.noreply.github.com>
2024-02-05 19:24:00 +01:00
Harshil
6ae7add722
Migrate From setup.cfg to pyproject.toml Where Possible (#4088) 2024-02-05 17:28:47 +01:00
Harshil
2d63c57ed6
Bump ruff and Remove sort-all (#4075) 2024-01-24 20:53:36 +01:00
pre-commit-ci[bot]
f77f4b0cf7
pre-commit autoupdate (#3876)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Harshil <37377066+harshil21@users.noreply.github.com>
2023-09-09 23:12:30 +02:00
Bibo-Joshi
03f87750d4
Provide Versions of customwebhookbot.py with Different Frameworks (#3820) 2023-08-16 21:15:32 +02:00
MiguelX413
99fd4432db
Use Explicit Optionals (#3692)
Co-authored-by: Dmitry Kolomatskiy <58207913+lemontree210@users.noreply.github.com>
2023-05-18 07:57:59 +02:00
Harshil
963edbf191
Refactor and Overhaul the Test Suite (#3426) 2023-02-11 10:45:17 +01:00
Bibo-Joshi
b11a0c7778
Make TelegramObject Immutable (#3249) 2022-12-15 15:00:36 +01:00
pre-commit-ci[bot]
6e4a1f0a21
pre-commit autoupdate (#3409)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Bibo-Joshi <22366557+Bibo-Joshi@users.noreply.github.com>
2022-12-06 11:28:47 +01:00
Bibo-Joshi
5c3b06f015
Update Meta Config (#3365) 2022-11-15 17:47:24 +01:00
Bibo-Joshi
42276338b1
Add Arguments chat/user_id to CallbackContext And Example On Custom Webhook Setups (#3059)
Co-authored-by: Harshil <37377066+harshil21@users.noreply.github.com>
2022-06-03 16:55:36 +02:00
Harshil
335772568f Update and Expand Tests & pre-commit Settings and Improve Code Quality (#2925)
Co-authored-by: Hinrich Mahler <22366557+Bibo-Joshi@users.noreply.github.com>
2022-05-06 18:22:34 +02:00
Bibo-Joshi
42eaa67fd5 Switch to asyncio (#2731)
Co-authored-by: tsnoam <tsnoam@gmail.com>
Co-authored-by: Harshil <37377066+harshil21@users.noreply.github.com>
Co-authored-by: Poolitzer <25934244+Poolitzer@users.noreply.github.com>
2022-05-06 18:19:15 +02:00
Bibo-Joshi
55e8c38e50 Improve Code Quality (#2783) 2022-05-06 18:19:13 +02:00
Zisis Pavloudis
6f9e733f58 Introduce TelegramObject.set/get_bot (#2712) 2022-05-06 18:19:13 +02:00
Kenneth Cheo
5275c45199 Mark Internal Modules As Private (#2687)
Co-authored-by: Hinrich Mahler <22366557+Bibo-Joshi@users.noreply.github.com>
2022-05-06 18:19:12 +02:00
Poolitzer
babcc2a448 Add Custom pytest Marker to Ease Development (#2628)
Co-authored-by: Bibo-Joshi <22366557+Bibo-Joshi@users.noreply.github.com>
2022-05-06 18:19:09 +02:00
Bibo-Joshi
e4dc80f41d
API 5.4 (#2767)
Co-authored-by: poolitzer <25934244+Poolitzer@users.noreply.github.com>
2021-11-08 19:02:20 +01:00
Bibo-Joshi
ec3026673b
Fix Coverage Configuration (#2571)
* remove possibly malicious line from config

* exclude overload signatures from coverage
2021-06-25 09:02:46 +02:00
Bibo-Joshi
fce7cc903c
Add ContextTypes & BasePersistence.refresh_user/chat/bot_data (#2262) 2021-06-06 10:37:53 +02:00
Bibo-Joshi
3a9a0ab96d
Update pre-commit Settings (#2415)
Co-authored-by: Harshil <ilovebhagwan@gmail.com>
2021-03-13 16:21:03 +01:00
Bibo-Joshi
a34f0b9bee
Make cryptography Dependency Optional & Refactor Some Tests (#2386)
* Make cryptography optional

* Try fixing CI

* Try some more

* Update pytest, mypy & pyupgrade, refactor test_meta, hope that things start to work

* Fix filterwarnings

* Mama mia! Here we go again!

* Add stupid debug prints

* A new hope
2021-02-13 22:07:37 +01:00
Bibo-Joshi
25506f131d
python-telegram-bot-raw (#2324)
* POC

* Remove decorator dependency

* Rework setup.py & build, add separate readme

* Move utils -> ext.utils

* Move pytz dep to ext

* Try fixing timing stuff

* Add 'Typed' classifier

* Update README_RAW.rst

Co-authored-by: Harshil <37377066+harshil21@users.noreply.github.com>

* Some wording

* Deprecation warnings for moved tg.utils

* Tests for Promise

* Test time-helpers without pytz

* Try fixing time-helper tests

* Merge master

Co-authored-by: Harshil <37377066+harshil21@users.noreply.github.com>
2021-01-30 14:15:39 +01:00
Bibo-Joshi
92b9370c23
Improve Code Quality (#2131)
* Make pre-commit more strict

* Get pylint to read setup.cfg

* Make pylint & mypy happy aka ignore all the things

* use LogRecord.getMessage() in tests

* Make noam happy

* Update both pylint & mypy while we're at it

* Bring reqs-dev and makefile up to speed

* try making pre-commit happy

* fix jobqueue tests on the fly
2020-10-31 16:33:34 +01:00
Michael K
88440079e3
Update Wheel Settings (#2142)
Wheels are only universal if they support both Python 2 and 3.
2020-10-15 21:50:25 +02:00
Bibo-Joshi
264b2c9c72
Switch Code Formatting to Black (#2122)
* Swtich code formatting to Black

* Update docs

* Fix tests

* TRy fixing pre-commit
2020-10-09 17:22:07 +02:00
Hinrich Mahler
5fd7606084 Type Hinting (#1920) 2020-10-07 20:30:41 +02:00
Poolitzer
e54e9f2347 moving flake config to one file (#1546) 2019-10-14 11:10:51 +03:00
Jasmin Bom
cf95027308 Revert "Revert "Context based callbacks (#1100)""
This reverts commit f8a17cd
2018-09-21 08:57:01 +02:00
Jasmin Bom
937be3d2e8 Use a dual license file until we can add two files. 2018-08-29 15:49:52 +02:00
Jasmin Bom
aa3ebb1180 Add LICENSE.lesser as wheel license
Really we need both the LICENSE and LICENSE.lesser, but we can't until wheel releases a build with 59976ab294 merged.
2018-08-29 15:39:44 +02:00
Jacob Bom
f8a17cddcb Revert "Context based callbacks (#1100)"
This reverts commit 247577b2e2.
2018-05-31 14:22:57 +02:00
Jacob Bom
247577b2e2
Context based callbacks (#1100)
See https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition-guide-to-Version-11.0 under Context based callbacks and Filters in handlers for a good guide on the changes in this commit.

* Change handlers so context is supported

* Attempt to make parameter "guessing" work on py < 3.5

* Document use_context in all handlers

* Add Context to docs

* Minor fixes to context handling

* Add tests for context stuff

* Allow the signature check to work on py<3.5 with methods

* Fix order of operations

* Address most issues raised in CR

* Make CommandHandler no longer support filter lists

* Fix indent

(pycharm can be an arse sometimes)

* Improve readability in conversationhandler

* Make context have Match instead of groups & groupdict

* Remove filter list support from messagehandler too

* Small fix to StringCommandHandler

* More small fixes to handlers

* Amend CHANGES

* Fix tests and fix bugs raised by tests

* Don't allow users to ignore errors without messing with the warning filters themselves

* Ignore our own deprecation warnings when testing

* Skipping deprecationwarning test on py2

* Forgot some changes

* Handler: Improved documentation and text of deprecation warnings

* HandlerContext: Keep only dispatcher and use properties; improved doc

* Complete fixing the documentation.

 - Fixes per Eldinnie's comments.
 - Fixes per warnings when running sphinx.

* Some small doc fixes (interlinks and optionals)

* Change add_error_handler to use HandlerContext too

* More context based changes

Context Based Handlers -> Context Based Callbacks

No longer use_context args on every single Handler

Instead set dispatcher/updater .use_context=True to use

Works with
- Handler callbacks
- Error handler callbacks
- Job callbacks

Change examples to context based callbacks so new users are not confused

Rename and move the context object from Handlers.HandlerContext to CallbackContext, since it doesn't only apply to handlers anymore.

Fix tests by adding a new fixture `cpd` which is a dispatcher with use_context=True

* Forgot about conversationhandler

* Forgot jobqueue

* Add tests for callbackcontext & for context based callback job

* Fix as per review :)
2018-05-21 15:00:47 +02:00
Jacob Bom
8cda3f7a71 Turn on branch coverage (#790)
* Run pre commit hook tests on all platforms TEMPORARILY

* Use os.system instead of subprocess.call

* Turn on branch coverage

* Let's try this then

* More testing!

* Update test_meta.py
2017-09-01 08:44:45 +02:00
Jacob Bom
5d7c6ad541 Switch to pytest + required fixes to code (#788)
Required fixes:
 - CallbackQuery is now comparable.
 - Message.effective_attachment, Message.photo,
   Message.new_chat_members, Message.new_chat_photo &
   Game.text_entitties semantic fixes - when they are not defined,
   return an empty list.
 - Docstring fix to Update class.
2017-08-12 00:58:41 +03:00
leandrotoledo
c7db9a96cd Set split_before_logical_operator to True 2016-05-23 17:19:35 -03:00
Leandro Toledo
880746baed Column width to 90 #259 2016-05-14 21:52:35 -03:00
Rahiel Kasim
0612385233 set project max line length to 99 (flake8) 2016-04-28 15:03:43 +02:00
Leandro Toledo
109439022f Minor fixes and cfg for setuptools 2015-08-14 16:30:30 -03:00
Leandro Toledo
e67e5513bf Fix docs upload 2015-08-11 16:49:38 -03:00