diff --git a/.ci/generate_test_report_lib.py b/.ci/generate_test_report_lib.py index 5b16599cc743..ed86ab88e66d 100644 --- a/.ci/generate_test_report_lib.py +++ b/.ci/generate_test_report_lib.py @@ -3,7 +3,7 @@ # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception """Library to parse JUnit XML files and return a markdown report.""" -from typing import TypedDict, Optional +from typing import TypedDict import platform from junitparser import JUnitXml, Failure @@ -11,12 +11,10 @@ from junitparser import JUnitXml, Failure # This data structure should match the definition in llvm-zorg in # premerge/advisor/advisor_lib.py -# TODO(boomanaiden154): Drop the Optional here and switch to str | None when -# we require Python 3.10. class FailureExplanation(TypedDict): name: str explained: bool - reason: Optional[str] + reason: str | None SEE_BUILD_FILE_STR = "Download the build's log file to see the details." diff --git a/.ci/premerge_advisor_explain.py b/.ci/premerge_advisor_explain.py index 4a3900021ede..6046905284cc 100644 --- a/.ci/premerge_advisor_explain.py +++ b/.ci/premerge_advisor_explain.py @@ -8,10 +8,6 @@ import platform import sys import json -# TODO(boomanaiden154): Remove the optional call once we can require Python -# 3.10. -from typing import Optional - import requests import github import github.PullRequest @@ -24,7 +20,7 @@ PREMERGE_ADVISOR_URL = ( COMMENT_TAG = "" -def get_comment_id(platform: str, pr: github.PullRequest.PullRequest) -> Optional[int]: +def get_comment_id(platform: str, pr: github.PullRequest.PullRequest) -> int | None: platform_comment_tag = COMMENT_TAG.format(platform=platform) for comment in pr.as_issue().get_comments(): if platform_comment_tag in comment.body: