Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
8c3d3e6
Update Bot API Version to 6.6
Bibo-Joshi Apr 21, 2023
20ca104
Add `BotName` class
Bibo-Joshi Apr 21, 2023
c8a7132
Add `{set, get}_my_name` Methods
Bibo-Joshi Apr 21, 2023
7129ba6
`ChatMemberUpdated.via_chat_folder_invite_link`
Bibo-Joshi Apr 21, 2023
489dfc9
Add `InlineQueryResultsButton`
Bibo-Joshi Apr 21, 2023
269e088
Update `Bot.answer_inline_query`
Bibo-Joshi Apr 21, 2023
3c974ba
Try fixing tests
Bibo-Joshi Apr 21, 2023
0c0bc83
add `web_app_name` to `WriteAccessAllowed`
lemontree210 Apr 21, 2023
9c9cdc0
Add & Integrate SwitchInlineQueryChosenChat
harshil21 Apr 21, 2023
a1d1369
Review: Correct docstring in IKB
harshil21 Apr 21, 2023
3484dcf
Correct again
harshil21 Apr 21, 2023
7e6818e
Update Docs
Bibo-Joshi Apr 22, 2023
bd73413
Update Docs
Bibo-Joshi Apr 22, 2023
b8ec32f
Feat: Support for custom emojis
Poolitzer Apr 22, 2023
1106fb3
Merge remote-tracking branch 'origin/api-6.7' into api-6.7
Poolitzer Apr 22, 2023
28127b0
Fix some tests properly and the name tests temporarily
Bibo-Joshi Apr 23, 2023
6d7ec48
Update `test_official`
Bibo-Joshi Apr 23, 2023
c3055c7
Update threshold for type completeness & make prints more verbose
Bibo-Joshi Apr 23, 2023
564c544
Temporarily remove unit tests
Bibo-Joshi Apr 23, 2023
5433627
Fix: Rename test
Poolitzer Apr 23, 2023
1504019
Fix: Improve docstring
Poolitzer Apr 23, 2023
dca7f94
Merge remote-tracking branch 'origin/api-6.7' into api-6.7
Poolitzer Apr 23, 2023
2135781
Increase coverage
Bibo-Joshi Apr 23, 2023
17379a8
Get type completeness up to speed
Bibo-Joshi Apr 23, 2023
7761cdf
Tweak summaries
Bibo-Joshi Apr 23, 2023
8b93d69
Review: Refine switch_inline_query tip
harshil21 Apr 24, 2023
cb038d9
Deprecate custom emoji replacement in MD v1
Bibo-Joshi Apr 24, 2023
352047d
Completely skip set_get_my_name test until it's mocked
Bibo-Joshi Apr 25, 2023
f21d8c9
Add a note on `set_my_name`
Bibo-Joshi Apr 26, 2023
cdadcb7
Mock the `set/get_my_name` test
Bibo-Joshi Apr 26, 2023
6bdc690
Merge branch 'api-6.7' into type-completeness
Bibo-Joshi Apr 26, 2023
b0585a3
Make tests run on api 6.7 branch
Bibo-Joshi Apr 26, 2023
ff72e3e
Review
Bibo-Joshi Apr 27, 2023
aa4c2be
Merge branch 'master' into api-6.7
Bibo-Joshi Apr 30, 2023
f78c737
Fix some typos
harshil21 May 5, 2023
9e85331
update warning test to use bot and extbot
May 6, 2023
9bfd5a1
`pre-commit` autoupdate (#3688)
pre-commit-ci[bot] May 6, 2023
9ea5a6f
Merge branch 'api-6.7' into type-completeness
Bibo-Joshi May 6, 2023
09cfb2e
Merge branch 'master' into type-completeness
Bibo-Joshi May 7, 2023
ae8a04e
Revert "Temporarily remove unit tests"
Bibo-Joshi May 7, 2023
540c9e5
Revert "Make tests run on api 6.7 branch"
Bibo-Joshi May 7, 2023
312db52
Merge branch 'master' into type-completeness
Bibo-Joshi May 7, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions .github/workflows/type_completeness.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,21 @@ jobs:
pr = float(
json.load(open("pr.json", "rb"))["typeCompleteness"]["completenessScore"]
)
base_text = f"After this PR, type completeness will be {round(pr, 3)}."
if pr < (base - 0.1):
text = f"This PR decreases type completeness by {round(base - pr, 3)}. ❌"
base_text = f"This PR changes type completeness from {round(base, 3)} to {round(pr, 3)}."
if pr < (base - 0.001):
text = f"{base_text} ❌"
set_summary(text)
print(Path("pr.readable").read_text(encoding="utf-8"))
error(f"{text}\n{base_text}")
error(text)
exit(1)
elif pr > (base + 0.1):
text = f"This PR increases type completeness by {round(pr - base, 3)}. ✨"
elif pr > (base + 0.001):
text = f"{base_text} ✨"
set_summary(text)
if pr < 1:
print(Path("pr.readable").read_text(encoding="utf-8"))
print(f"{text}\n{base_text}")
print(text)
else:
text = f"This PR does not change type completeness by more than 0.1. ✅"
text = f"{base_text} This is less than 0.1 percentage points. ✅"
set_summary(text)
print(Path("pr.readable").read_text(encoding="utf-8"))
print(f"{text}\n{base_text}")
print(text)
4 changes: 2 additions & 2 deletions telegram/_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ def __init__(
self._local_mode: bool = local_mode
self._bot_user: Optional[User] = None
self._private_key: Optional[bytes] = None
self._initialized = False
self._initialized: bool = False

self._request: Tuple[BaseRequest, BaseRequest] = (
HTTPXRequest() if get_updates_request is None else get_updates_request,
Expand Down Expand Up @@ -375,7 +375,7 @@ def __deepcopy__(self, memodict: Dict[int, object]) -> NoReturn:
# consider adding Paramspec from typing_extensions to properly fix this. Currently a workaround
def _log(func: Any): # type: ignore[no-untyped-def] # skipcq: PY-D0003
@functools.wraps(func)
async def decorator(self, *args, **kwargs): # type: ignore[no-untyped-def]
async def decorator(self: "Bot", *args: Any, **kwargs: Any) -> Any:
# pylint: disable=protected-access
self._LOGGER.debug("Entering: %s", func.__name__)
result = await func(self, *args, **kwargs) # skipcq: PYL-E1102
Expand Down
4 changes: 2 additions & 2 deletions telegram/_botdescription.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class BotDescription(TelegramObject):

def __init__(self, description: str, *, api_kwargs: JSONDict = None):
super().__init__(api_kwargs=api_kwargs)
self.description = description
self.description: str = description

self._id_attrs = (self.description,)

Expand All @@ -68,7 +68,7 @@ class BotShortDescription(TelegramObject):

def __init__(self, short_description: str, *, api_kwargs: JSONDict = None):
super().__init__(api_kwargs=api_kwargs)
self.short_description = short_description
self.short_description: str = short_description

self._id_attrs = (self.short_description,)

Expand Down
2 changes: 1 addition & 1 deletion telegram/_botname.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class BotName(TelegramObject):

def __init__(self, name: str, *, api_kwargs: JSONDict = None):
super().__init__(api_kwargs=api_kwargs)
self.name = name
self.name: str = name

self._id_attrs = (self.name,)

Expand Down
11 changes: 6 additions & 5 deletions telegram/_switchinlinequerychosenchat.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#
# You should have received a copy of the GNU Lesser Public License
"""This module contains a class that represents a Telegram SwitchInlineQueryChosenChat."""
from typing import Optional

from telegram._telegramobject import TelegramObject
from telegram._utils.types import JSONDict
Expand Down Expand Up @@ -82,11 +83,11 @@ def __init__(
):
super().__init__(api_kwargs=api_kwargs)
# Optional
self.query = query
self.allow_user_chats = allow_user_chats
self.allow_bot_chats = allow_bot_chats
self.allow_group_chats = allow_group_chats
self.allow_channel_chats = allow_channel_chats
self.query: Optional[str] = query
self.allow_user_chats: Optional[bool] = allow_user_chats
self.allow_bot_chats: Optional[bool] = allow_bot_chats
self.allow_group_chats: Optional[bool] = allow_group_chats
self.allow_channel_chats: Optional[bool] = allow_channel_chats

self._id_attrs = (
self.query,
Expand Down