From 57c2f6e01e1c128e04b9e78c2c5244115ae54ccd Mon Sep 17 00:00:00 2001 From: Bibo-Joshi <22366557+Bibo-Joshi@users.noreply.github.com> Date: Fri, 29 Dec 2023 22:48:45 +0100 Subject: [PATCH] Improve Type Completeness & Corresponding Workflow (#4035) --- .github/workflows/type_completeness.yml | 8 ++++++++ telegram/ext/_jobqueue.py | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/type_completeness.yml b/.github/workflows/type_completeness.yml index 7ab7f6dc8..effa1dff0 100644 --- a/.github/workflows/type_completeness.yml +++ b/.github/workflows/type_completeness.yml @@ -50,6 +50,14 @@ jobs: json.load(open("pr.json", "rb"))["typeCompleteness"]["completenessScore"] ) base_text = f"This PR changes type completeness from {round(base, 3)} to {round(pr, 3)}." + + if base == 0: + text = f"Something is broken in the workflow. Reported type completeness is 0. 💥" + set_summary(text) + print(Path("pr.readable").read_text(encoding="utf-8")) + error(text) + exit(1) + if pr < (base - 0.001): text = f"{base_text} ❌" set_summary(text) diff --git a/telegram/ext/_jobqueue.py b/telegram/ext/_jobqueue.py index 07bd678d3..14b3326fa 100644 --- a/telegram/ext/_jobqueue.py +++ b/telegram/ext/_jobqueue.py @@ -105,7 +105,7 @@ class JobQueue(Generic[CCT]): self._application: Optional[weakref.ReferenceType[Application]] = None self._executor = AsyncIOExecutor() - self.scheduler: AsyncIOScheduler = AsyncIOScheduler(**self.scheduler_configuration) + self.scheduler: "AsyncIOScheduler" = AsyncIOScheduler(**self.scheduler_configuration) def __repr__(self) -> str: """Give a string representation of the JobQueue in the form ``JobQueue[application=...]``.