From 290f41b97d50f9751dc90c8efb1493d0e31792e2 Mon Sep 17 00:00:00 2001 From: "Joseph T. Lyons" Date: Fri, 29 Mar 2024 14:01:27 -0400 Subject: [PATCH] Tweak top-ranking issues --- script/update_top_ranking_issues/main.py | 30 ++++++++++++------- .../requirements.txt | 1 + 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/script/update_top_ranking_issues/main.py b/script/update_top_ranking_issues/main.py index 6d0f8a93e0..6cbfd9a5d0 100644 --- a/script/update_top_ranking_issues/main.py +++ b/script/update_top_ranking_issues/main.py @@ -20,17 +20,23 @@ CORE_LABELS: set[str] = set( "design", "documentation", "enhancement", - "linux", "panic / crash", - "windows" ] ) # A set of labels for adding in labels that we want present in the final # report, but that we don't want being defined as a core label, since issues # with without core labels are flagged as errors. -ADDITIONAL_LABELS: set[str] = set(["ai", "vim"]) +ADDITIONAL_LABELS: set[str] = set( + [ + "ai", + "linux", + "vim", + "windows", + ] +) IGNORED_LABELS: set[str] = set( [ + "ignore top-ranking issues", "meta", ] ) @@ -59,7 +65,9 @@ def main( if query_day_interval: tz = timezone("america/new_york") - current_time = datetime.now(tz).replace(hour=0, minute=0, second=0, microsecond=0) + current_time = datetime.now(tz).replace( + hour=0, minute=0, second=0, microsecond=0 + ) start_date = current_time - timedelta(days=query_day_interval) # GitHub Workflow will pass in the token as an environment variable, @@ -114,12 +122,12 @@ def get_issue_maps( label_to_issues ) - error_message_to_erroneous_issues: defaultdict[ - str, list[Issue] - ] = get_error_message_to_erroneous_issues(github, repository) - error_message_to_erroneous_issue_data: dict[ - str, list[IssueData] - ] = get_error_message_to_erroneous_issue_data(error_message_to_erroneous_issues) + error_message_to_erroneous_issues: defaultdict[str, list[Issue]] = ( + get_error_message_to_erroneous_issues(github, repository) + ) + error_message_to_erroneous_issue_data: dict[str, list[IssueData]] = ( + get_error_message_to_erroneous_issue_data(error_message_to_erroneous_issues) + ) # Create a new dictionary with labels ordered by the summation the of likes on the associated issues labels = list(label_to_issue_data.keys()) @@ -168,7 +176,7 @@ def get_label_to_issues( def get_label_to_issue_data( - label_to_issues: defaultdict[str, list[Issue]] + label_to_issues: defaultdict[str, list[Issue]], ) -> dict[str, list[IssueData]]: label_to_issue_data: dict[str, list[IssueData]] = {} diff --git a/script/update_top_ranking_issues/requirements.txt b/script/update_top_ranking_issues/requirements.txt index 191e292be1..bebb219801 100644 --- a/script/update_top_ranking_issues/requirements.txt +++ b/script/update_top_ranking_issues/requirements.txt @@ -1,5 +1,6 @@ mypy==1.6.0 PyGithub==1.55 pytz==2022.1 +ruff==0.3.4 typer==0.9.0 types-pytz==2023.3.1.1