mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2024-11-21 22:56:38 +01:00
Bump pre-commit
Hooks to Latest Versions (#4337)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Hinrich Mahler <22366557+Bibo-Joshi@users.noreply.github.com>
This commit is contained in:
parent
146ec54a00
commit
97226b1ae3
3 changed files with 8 additions and 10 deletions
|
@ -25,11 +25,11 @@ repos:
|
||||||
- --diff
|
- --diff
|
||||||
- --check
|
- --check
|
||||||
- repo: https://github.com/PyCQA/flake8
|
- repo: https://github.com/PyCQA/flake8
|
||||||
rev: 7.0.0
|
rev: 7.1.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: flake8
|
- id: flake8
|
||||||
- repo: https://github.com/PyCQA/pylint
|
- repo: https://github.com/PyCQA/pylint
|
||||||
rev: v3.1.0
|
rev: v3.2.4
|
||||||
hooks:
|
hooks:
|
||||||
- id: pylint
|
- id: pylint
|
||||||
files: ^(?!(tests|docs)).*\.py$
|
files: ^(?!(tests|docs)).*\.py$
|
||||||
|
@ -41,7 +41,7 @@ repos:
|
||||||
- aiolimiter~=1.1.0
|
- aiolimiter~=1.1.0
|
||||||
- . # this basically does `pip install -e .`
|
- . # this basically does `pip install -e .`
|
||||||
- repo: https://github.com/pre-commit/mirrors-mypy
|
- repo: https://github.com/pre-commit/mirrors-mypy
|
||||||
rev: v1.10.0
|
rev: v1.10.1
|
||||||
hooks:
|
hooks:
|
||||||
- id: mypy
|
- id: mypy
|
||||||
name: mypy-ptb
|
name: mypy-ptb
|
||||||
|
@ -68,7 +68,7 @@ repos:
|
||||||
- cachetools~=5.3.3
|
- cachetools~=5.3.3
|
||||||
- . # this basically does `pip install -e .`
|
- . # this basically does `pip install -e .`
|
||||||
- repo: https://github.com/asottile/pyupgrade
|
- repo: https://github.com/asottile/pyupgrade
|
||||||
rev: v3.15.2
|
rev: v3.16.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: pyupgrade
|
- id: pyupgrade
|
||||||
args:
|
args:
|
||||||
|
|
|
@ -322,9 +322,7 @@ class ApplicationBuilder(Generic[BT, CCT, UD, CD, BD, JQ]):
|
||||||
bot = self._updater.bot
|
bot = self._updater.bot
|
||||||
update_queue = self._updater.update_queue
|
update_queue = self._updater.update_queue
|
||||||
|
|
||||||
application: Application[
|
application: Application[BT, CCT, UD, CD, BD, JQ] = DefaultValue.get_value(
|
||||||
BT, CCT, UD, CD, BD, JQ
|
|
||||||
] = DefaultValue.get_value( # pylint: disable=not-callable
|
|
||||||
self._application_class
|
self._application_class
|
||||||
)(
|
)(
|
||||||
bot=bot,
|
bot=bot,
|
||||||
|
|
|
@ -30,6 +30,8 @@ except ImportError:
|
||||||
CACHE_TOOLS_AVAILABLE = False
|
CACHE_TOOLS_AVAILABLE = False
|
||||||
|
|
||||||
|
|
||||||
|
import contextlib
|
||||||
|
|
||||||
from telegram import CallbackQuery, InlineKeyboardButton, InlineKeyboardMarkup, Message, User
|
from telegram import CallbackQuery, InlineKeyboardButton, InlineKeyboardMarkup, Message, User
|
||||||
from telegram._utils.datetime import to_float_timestamp
|
from telegram._utils.datetime import to_float_timestamp
|
||||||
from telegram.error import TelegramError
|
from telegram.error import TelegramError
|
||||||
|
@ -425,10 +427,8 @@ class CallbackDataCache:
|
||||||
raise KeyError("CallbackQuery was not found in cache.") from exc
|
raise KeyError("CallbackQuery was not found in cache.") from exc
|
||||||
|
|
||||||
def __drop_keyboard(self, keyboard_uuid: str) -> None:
|
def __drop_keyboard(self, keyboard_uuid: str) -> None:
|
||||||
try:
|
with contextlib.suppress(KeyError):
|
||||||
self._keyboard_data.pop(keyboard_uuid)
|
self._keyboard_data.pop(keyboard_uuid)
|
||||||
except KeyError:
|
|
||||||
return
|
|
||||||
|
|
||||||
def clear_callback_data(self, time_cutoff: Optional[Union[float, datetime]] = None) -> None:
|
def clear_callback_data(self, time_cutoff: Optional[Union[float, datetime]] = None) -> None:
|
||||||
"""Clears the stored callback data.
|
"""Clears the stored callback data.
|
||||||
|
|
Loading…
Reference in a new issue