From 955ee9f987dbae09b1fa98527fa3b0b4f0f6fe83 Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Mon, 24 Feb 2025 15:22:53 +0000 Subject: [PATCH] Simplify plumbum usage in update_wiki --- wiki/update_wiki.py | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/wiki/update_wiki.py b/wiki/update_wiki.py index 62d80931..2a020a85 100755 --- a/wiki/update_wiki.py +++ b/wiki/update_wiki.py @@ -46,21 +46,16 @@ def calculate_monthly_stat( images = year_month_file.content.count("Build manifest") with plumbum.local.env(TZ="UTC"): - future = ( - git[ - "log", - "--oneline", - "--since", - f"{year_month_date}.midnight", - "--until", - f"{year_month_date + relativedelta.relativedelta(months=1)}.midnight", - "--first-parent", - ] - & plumbum.BG - ) - future.wait() - commits = len(future.stdout.splitlines()) - + git_log = git[ + "log", + "--oneline", + "--since", + f"{year_month_date}.midnight", + "--until", + f"{year_month_date + relativedelta.relativedelta(months=1)}.midnight", + "--first-parent", + ]() + commits = len(git_log.splitlines()) return Statistics(builds=builds, images=images, commits=commits)