GNU bug report logs - #74268
[PATCH 0/1] teams: Add packages stats script.

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: Sharlatan Hellseher <sharlatanus@HIDDEN>; Keywords: patch; dated Fri, 8 Nov 2024 21:32:02 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.

Message received at 74268 <at> debbugs.gnu.org:


Received: (at 74268) by debbugs.gnu.org; 10 Nov 2024 16:45:16 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Nov 10 11:45:15 2024
Received: from localhost ([127.0.0.1]:56405 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tAB3r-0002Gx-JE
	for submit <at> debbugs.gnu.org; Sun, 10 Nov 2024 11:45:15 -0500
Received: from mout-p-202.mailbox.org ([80.241.56.172]:51000)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <troy@HIDDEN>) id 1tAB3p-0002CL-8F
 for 74268 <at> debbugs.gnu.org; Sun, 10 Nov 2024 11:45:14 -0500
Received: from smtp202.mailbox.org (smtp202.mailbox.org [10.196.197.202])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
 (No client certificate requested)
 by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4Xmdnq1LzWz9srM;
 Sun, 10 Nov 2024 17:45:03 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=troyfigiel.com;
 s=MBO0001; t=1731257103;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 in-reply-to:in-reply-to:references:references;
 bh=d7wdyB4b6jxfNic0+Nf/23RkAf1AAUOF/3cRQm4xniY=;
 b=WCp/HCIq0fqG+V2AMwzwf6aQGSw8880Yg5Eb2dDqAWym6xSIvEToe+0lK9XrK7ikr9ADbC
 SFMoKm2cqAuDMJ+H2YPj6U2bIMCip17MhCYDDj2p+nherVWM2k9vnF0Mb0jC0EOiOKBnBj
 uyBuimq1tJdXZdVCFNwnZIL4qpQ3UttCqLG9ImRheoBGMoA4f7/6oNPYIVwqO5lrW5QeHu
 IEL2RUUA4Y6RzTj++ruF5KkYl+q4nTEd9MOh2BJiDM5rtbdgK5HD6d8o4ScJdr2uiCvpzm
 Bfw095vzKiJZI7fZKxezUjSbhfL3Z/2d1qIB6CUeuLGWhhQojbauJYvdl325Dg==
Message-ID: <6e0a2f0b064817a1882eb81a3d977c7f806f4cc6.camel@HIDDEN>
Subject: Re: [bug#74268] [PATCH 1/1] etc: Add teams-packages-stats script.
From: Troy Figiel <troy@HIDDEN>
To: Sharlatan Hellseher <sharlatanus@HIDDEN>
Date: Sun, 10 Nov 2024 17:44:39 +0100
In-Reply-To: <bdd10b14ee47680b9840ed75d0658c6978efe3b6.1731100267.git.sharlatanus@HIDDEN>
References: <cover.1731100267.git.sharlatanus@HIDDEN>
 <bdd10b14ee47680b9840ed75d0658c6978efe3b6.1731100267.git.sharlatanus@HIDDEN>
Content-Type: multipart/signed; micalg="pgp-sha512";
 protocol="application/pgp-signature"; boundary="=-/G/IF0qo03AKhoXbBMVD"
MIME-Version: 1.0
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 74268
Cc: 74268 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)


--=-/G/IF0qo03AKhoXbBMVD
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hi Oleg,

I do not have too much to add, but just wanted to mention this solves a
pain point I had a while back.  I thought it would be nice to have a
tool that in some sense does the opposite of `guix refresh -l' and
`guix refresh -T', showing me all packages with a given number of
dependencies.  When you are new to updating packages in Guix, it can be
quite difficult to find some simple candidates.

Two other points that come to mind regarding your script:
- jsonl output probably gives you more flexibility in the future.
- I could imagine you might want to filter for module paths.

As a sidenote, when I run your script, the final 0.0 is often
misaligned.  It seems to have extra spaces.

In any case, I think it is a nice tool to have.

Best wishes,

Troy

--=-/G/IF0qo03AKhoXbBMVD
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----

iQJIBAABCgAyFiEE5HwNzSdo36E4/NzWxnyRgbOJP7AFAmcw4vcUHHRyb3lAdHJv
eWZpZ2llbC5jb20ACgkQxnyRgbOJP7Cy1A//aGZux8JJDFKo1h3DtFgbCpTac6TP
PwGKz0vl0TYWiEbDl92AOkq0RAJFgZE4IyUmBNwSfRaw2QrbwXpnhbQtElZ8bf6W
0dCoze3S3rd/LCL2tRr/3QIWV648GXXXugEwC+BGLe7H4gstnCMGtpkyc466AFpr
JwSRZSC4IOOvwaAtY62Z0JsrbCgEfKfbyFXEpnepCl8huk8LKz8OhnUtv5a5V7Ln
0+991YANuavgaBOBwTxzn3huPr24CeGI7959KsCpy4TkeKEvK9RtqYXEwGW3odXT
DwuGB4UN6qgpPSy3AxPC/BLpwE+mQJJHqLg1VkZOQEHwlzLlxG+Vm94f7I+UnPbR
lTQEoOy2ei+5opxCURS6VhZOl2F5tYngvvd6WCWXIvQ26AxXjrZwsB1lv7X9RVMV
R7oDp7htGUdUU5mMlFZ8kZTE3wX3s8h/iUyXU+BHi+K4TKVqbDDH1rtrS0EJPxoj
qqDcdsaBK9az9pBrQqclx2TZU/7QOmOsuRr9zqt1SqPfvUtBtkhPkJqSvBUQgTte
JrOr+PdWVv/FX2nOBRJY2UTc3M4aARLFWFbl/dxPOzr8TtTlxzKtPGN6E0n37XCY
ZLTnGIz5A6g2eUe8+5Gt9dvxGm18f2ia68gAZHlyng+1UXGiYlEoSav/2YSp2AlG
5mILycn/YNUOzoI=
=+44T
-----END PGP SIGNATURE-----

--=-/G/IF0qo03AKhoXbBMVD--




Information forwarded to guix-patches@HIDDEN:
bug#74268; Package guix-patches. Full text available.

Message received at 74268 <at> debbugs.gnu.org:


Received: (at 74268) by debbugs.gnu.org; 8 Nov 2024 21:34:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Nov 08 16:34:13 2024
Received: from localhost ([127.0.0.1]:52371 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1t9WcO-0003uU-Gk
	for submit <at> debbugs.gnu.org; Fri, 08 Nov 2024 16:34:13 -0500
Received: from mail-wm1-f53.google.com ([209.85.128.53]:44474)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <sharlatanus@HIDDEN>) id 1t9WcM-0003uG-GD
 for 74268 <at> debbugs.gnu.org; Fri, 08 Nov 2024 16:34:11 -0500
Received: by mail-wm1-f53.google.com with SMTP id
 5b1f17b1804b1-4314fa33a35so21386265e9.1
 for <74268 <at> debbugs.gnu.org>; Fri, 08 Nov 2024 13:34:10 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1731101585; x=1731706385; darn=debbugs.gnu.org;
 h=content-transfer-encoding:mime-version:references:in-reply-to
 :message-id:date:subject:cc:to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=UmSCZzV1+O3cUp3OiEwHQX6TCgLSeNy4F6RDQLapFeI=;
 b=FaNW/KHfGy5ZrFdVCMnR8AEewpdDcLHlM8VGXFyMoQzwKFTgQ7mO/nFdiY8o7S9fO2
 oZZN6J5+ba4gcGFV6z/O55Bh9U8R5bO+UAQSbytoKh+VurgfxU2fJ8nrlxNpBVhfpwRC
 AcH9ePSkSKWCctdLwjuJ4QzH77367cu9TUSWkmVYBVRWIlFEgwL33COwa3obTXWzdFSj
 0MrjiKVtDEU9N91dRBP153N2NGCOsVLKbl0kNKdDt/fGXbvhyLWq94mJ3QkQZmin1NHd
 bzgvhLaoDa7MoGfTvNRMKznSiwESzxzmqY+WFRvU4pkmPJHzH8aaou5fn17WQKVizTiU
 QpHg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1731101585; x=1731706385;
 h=content-transfer-encoding:mime-version:references:in-reply-to
 :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=UmSCZzV1+O3cUp3OiEwHQX6TCgLSeNy4F6RDQLapFeI=;
 b=oljGdkYQHToyjGMEq7TXKBU16kVWWyLPbZ9fyZNfogG89TF4mFbijoQy7YTcj5yZrn
 4JeUEmmsbpRabb458N2rkyT8Cwx3PIQo8JRwwnG47miUpULOjSJxXMcX2D2qwlKZrFjz
 hfLqCrLa6s4OczHSwuNBv713l2EBfisz3YhqCgDhVzSYyU7O6bme9EgyTYmZZcGU8pev
 2+8MSxmwrxSQs0D5w69YiNZLG+/RNlX64mIWFGWEvLzHPo/iPS6wOpsaOdSFHRlu+2k1
 DvX07npkOhBHpxK0lMvKcfPWQ+7rD8S8w+vr3xLDoHQ7ULx+b6kxVZhdgr8JQ/n44pBM
 974g==
X-Gm-Message-State: AOJu0Yyo/+/bQXSPyZ0Wf9+Wh8cN2pHOTIhK4IMEeZ2Xqrm7KXPtYDpr
 dgalDj70Hf9Vbu4QGEaMAqyhgDscuTtW5FeLZ7h8LtB5mV6RWJl44J6CAO7l
X-Google-Smtp-Source: AGHT+IE1PPbT8Hb7u/U3bT96i+lDovIJL2YsFiNJQzNuoF5WXKUyCGht7NJswL5kTWYv65semmjg+Q==
X-Received: by 2002:a05:600c:3b1f:b0:42c:b80e:5e50 with SMTP id
 5b1f17b1804b1-432b7490d35mr40058475e9.0.1731101584375; 
 Fri, 08 Nov 2024 13:33:04 -0800 (PST)
Received: from guxtil.incerto.xyz
 (cpc100684-bagu15-2-0-cust967.1-3.cable.virginm.net. [86.8.111.200])
 by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-432aa73a2d8sm115911135e9.41.2024.11.08.13.33.03
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 08 Nov 2024 13:33:03 -0800 (PST)
From: Sharlatan Hellseher <sharlatanus@HIDDEN>
To: 74268 <at> debbugs.gnu.org
Subject: [PATCH 1/1] etc: Add teams-packages-stats script.
Date: Fri,  8 Nov 2024 21:32:59 +0000
Message-ID: <bdd10b14ee47680b9840ed75d0658c6978efe3b6.1731100267.git.sharlatanus@HIDDEN>
X-Mailer: git-send-email 2.46.0
In-Reply-To: <cover.1731100267.git.sharlatanus@HIDDEN>
References: <cover.1731100267.git.sharlatanus@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 74268
Cc: Sharlatan Hellseher <sharlatanus@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

This is a proposal of the helper script which aims to asist in decision
making during cascade packages refresh task in the team scope.

* etc/teams-packages-stats.scm: New file.

Change-Id: I4af5ce1c3cbebed1793628229b29acba1f737c9d
---
 etc/teams-packages-stats.scm | 218 +++++++++++++++++++++++++++++++++++
 1 file changed, 218 insertions(+)
 create mode 100755 etc/teams-packages-stats.scm

diff --git a/etc/teams-packages-stats.scm b/etc/teams-packages-stats.scm
new file mode 100755
index 0000000000..a95d913a79
--- /dev/null
+++ b/etc/teams-packages-stats.scm
@@ -0,0 +1,218 @@
+#!/bin/sh
+# -*- mode: scheme; -*-
+# Extra care is taken here to ensure this script can run in most environments,
+# since it is invoked by 'git send-email'.
+pre_inst_env_maybe=
+command -v guix > /dev/null || pre_inst_env_maybe=./pre-inst-env
+exec $pre_inst_env_maybe guix repl -- "$0" "$@"
+!#
+
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2024 Sharlatan Hellseher <sharlatanus@HIDDEN>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+;;; This file returns a manifest containing origins of all the packages.  The
+;;; main purpose is to allow continuous integration services to keep upstream
+;;; source code around.  It can also be passed to 'guix weather -m'.
+
+;;; Commentary:
+
+;; This code defines helpers for cascade packages refresh withing team scopes.
+;; The output may be piped to CLI commands like awk, column to compile a
+;; dataframe (e.g. JSON).
+;;
+;;     ~$ column \
+;;          --json \
+;;          --table \
+;;          --separator=, \
+;;          --table-columns=module-file-name,build-system-name,package-name,\
+;;          package-guix-version,package-upstream-version,all-inputs-count,\
+;;          dependents-count,affect-ratio \
+;;          <output> \
+;;          > <output>.json
+;;
+;; TODO:
+;; - Implement manifests per team on some gradual criterias
+;; - Add more controls via command-line options
+;; - Improve the performance of dependents calculation, it takes about 30min
+;; to provide a list for packages with python/pyproject build system
+;; - Add save as JSON,CSV data formats for father analysis
+
+
+;;; Code:
+
+(use-modules (git)
+             (gnu packages)
+             (guix build-system)
+             (guix diagnostics)
+             (guix discovery)
+             (guix gnupg)
+             (guix graph)
+             (guix hash)
+             (guix monads)
+             (guix packages)
+             (guix profiles)
+             (guix scripts graph)
+             (guix scripts)
+             (guix store)
+             (guix ui)
+             (guix upstream)
+             (guix utils)
+             (ice-9 format)
+             (ice-9 match)
+             (ice-9 rdelim)
+             (ice-9 regex)
+             (srfi srfi-1)
+             (srfi srfi-26)
+             (srfi srfi-37)
+             (srfi srfi-71)
+             (srfi srfi-9))
+
+(define* (packages-by-team #:key (team "all"))
+  "Return the list of packages for the TEAM by certain criteria or fail over
+to all packages available."
+  (cond
+    ((string=? team "go")
+     (fold-packages
+      (lambda (package result)
+        (if (or (eq? (build-system-name (package-build-system package))
+                     (quote go))
+                ;; XXX: Add other checks such Go is in inputs*.
+                )
+            (cons package result) result)) (list)))
+    ((string=? team "python")
+     (fold-packages
+      (lambda (package result)
+        (if (or (eq? (build-system-name (package-build-system package))
+                     (quote pyproject))
+                (eq? (build-system-name (package-build-system package))
+                     (quote python)))
+            (cons package result) result)) (list)))
+    ((string=? team "ruby")
+     (fold-packages
+      (lambda (package result)
+        (if (or (eq? (build-system-name (package-build-system package))
+                     (quote ruby))
+                ;; XXX: Add other checkes such Ruby is in inputs*.
+                )
+            (cons package result) result)) (list)))
+    (else
+     (fold-packages
+      (lambda (package result)
+        (if (package-superseded package)
+            result
+            (cons package result)))
+      '()
+      #:select? (const #true)))))
+
+(define (dependents-count package)
+  "Return the count of requiring rebuild packages when PACKAGE is updated."
+  (with-error-handling ;; XXX: Taken from guix scripts refresh
+    (with-store store
+      (run-with-store store
+        (mlet %store-monad ((edges
+                             (node-back-edges %bag-node-type
+                                              (package-closure (packages-by-team)))))
+          (let* ((dependents
+                  (node-transitive-edges (list package) edges)))
+            (return (length dependents))))))))
+
+(define* (stats team
+                #:key (build-systems '())
+                (check-dependents? #false)
+                (check-deprecated? #false)
+                (check-upstream-version? #false)
+                (dependents-threshold-ratio 0.001)
+                (inputs-threshold 0))
+  "Return a detailed stats for the given TEAM packages which may help to make
+a decision during cascade updates.
+
+Parameters:
+- build-system :: The optional list of build system names to select.
+
+- check-dependents? :: Whether to query or not the dependents count, it might
+take time for a long list of provided packages.
+
+- check-deprecated? :: Whether to show or not the deprecated packages.
+
+- check-upstream-version? :: Check for the latest available version on
+upstream.
+
+- dependents-threshold-ratio :: Print out only packages which dependent count
+ration is bigger or equal given threshold. (dependents/all-packages * 100.0).
+
+- inputs-threshold :: The minimum number of inputs which package needs to
+have.
+
+Returns:
+- module-file-name
+- build-system-name
+- package-name
+- package-guix-version
+- package-upstream-version
+- all-inputs-count
+- dependents-count
+- affect-ratio"
+  (let ((team-packages (packages-by-team #:team team))
+        (all-packages-count (length (packages-by-team))))
+    (map (lambda (package)
+           (let ((all-inputs-count
+                  (+ (length (package-inputs package))
+                     (length (package-native-inputs package))
+                     (length (package-propagated-inputs package))))
+                 (module-path
+                  (false-if-exception
+                   (location-file (package-definition-location package))))
+                 (build-system-name
+                  (build-system-name (package-build-system package))))
+             (if (>= all-inputs-count inputs-threshold)
+                 (let* ((dependents
+                         (if check-dependents?
+                             (dependents-count package)
+                             "nil"))
+                        (affect-ratio
+                         (if check-dependents?
+                             (* (/ dependents all-packages-count) 100.0)
+                             "nil")))
+                   (format #true "~{~a,~}~8f~%"
+                           (list
+                            (if (string? module-path)
+                                module-path
+                                "deprecated-package")
+                            build-system-name
+                            (package-name package)
+                            (package-version package)
+                            (if check-upstream-version? "TBA" "nil")
+                            all-inputs-count
+                            dependents)
+                            affect-ratio)))))
+         team-packages)))
+
+(define (main . args)
+  (match args
+    (("stats" . team-name)
+     (apply (stats (car team-name) #:check-dependents? #true)))
+    (anything
+     (format (current-error-port)
+             "Usage: etc/teams-packages-stats.scm <command> [<args>]
+
+Commands:~
+  stats <team-name>
+    get a list of packages belonging to the given <team-name> with basic
+    affect ratio, which may help to plan cascade packages refresh task.%"))))
+
+(apply main (cdr (command-line)))
-- 
2.46.0





Information forwarded to guix-patches@HIDDEN:
bug#74268; Package guix-patches. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 8 Nov 2024 21:31:31 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Nov 08 16:31:31 2024
Received: from localhost ([127.0.0.1]:52360 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1t9WZm-0003pa-Pu
	for submit <at> debbugs.gnu.org; Fri, 08 Nov 2024 16:31:31 -0500
Received: from lists.gnu.org ([209.51.188.17]:45356)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <sharlatanus@HIDDEN>) id 1t9WZk-0003pR-I8
 for submit <at> debbugs.gnu.org; Fri, 08 Nov 2024 16:31:29 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <sharlatanus@HIDDEN>)
 id 1t9WZk-0001xS-2b
 for guix-patches@HIDDEN; Fri, 08 Nov 2024 16:31:28 -0500
Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <sharlatanus@HIDDEN>)
 id 1t9WZi-0008US-Cs
 for guix-patches@HIDDEN; Fri, 08 Nov 2024 16:31:27 -0500
Received: by mail-wm1-x32d.google.com with SMTP id
 5b1f17b1804b1-43152b79d25so21659925e9.1
 for <guix-patches@HIDDEN>; Fri, 08 Nov 2024 13:31:25 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1731101484; x=1731706284; darn=gnu.org;
 h=content-transfer-encoding:mime-version:message-id:date:subject:cc
 :to:from:from:to:cc:subject:date:message-id:reply-to;
 bh=XdZuw1r1v94DM9SHsl6sJItrDpDIVCimXjpvF6rw9As=;
 b=HWxYcfIBH7KDOpIfItjWt8W56jqG2A+pOap7wYx6XQ2Y6xw/CI/PMNbUUZsTagwYaC
 McGfSofRhUXhXxYzkWnzckWH0NjWTswMZf/IxYsZSnsuBnVBWSWsvagyJBnAyQHitUE8
 SlwWH9Mq8MVRzNalv4vXcfP79M9SzRwLiv0Cs0Rxz9ejVnAjCowJW5Tdx3aF58HAYow1
 jh6S5ef+nP/WW59PyJiFTqAFemS0uNK6bLnd4JkjuBKy0GV8vckfpZGcE3CwiaCBZj57
 MKKpNc/R6lSS8N4x3EZ9r8fBXeoDaROsRbMscaaLPs5WC6DDqvWKG8S+MVeDosWCDDTH
 Fi4A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1731101484; x=1731706284;
 h=content-transfer-encoding:mime-version:message-id:date:subject:cc
 :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=XdZuw1r1v94DM9SHsl6sJItrDpDIVCimXjpvF6rw9As=;
 b=TBuv/jQBM2aLw96xgBMgHZMUfHte6bE/tG/iH16sIWDb75U9mXMLXWxPelRmkDYgKt
 Y3GbLhElMWrh3ljvclNLBUyrajU7SP53J7RQ8h5It1+Rv/JQK9DX4aGe4LjCoilMqgT0
 CaEJWvmmYSUaHPng1SYLd8dHCUFHYuamLdtwUVgLCPBlPFWVRGfQcDWv9nnCmLvlhK+R
 V7u58t7i1JIEXWLdQv4Y0zDrOJb8byqw+Czz6RcsfyFtw0JZfIMZJxRpsvwyDovHX4xs
 nwZW948+8C19sFhBLX65wppskhOkWuXeD7+ru0Ena4UwyceOveHenb47Zbug5jJ3H8sT
 LFTQ==
X-Gm-Message-State: AOJu0Yy3J3wtMaSG1IjtztAplIekpQ7/x6/5j/u4rEd1hQWKbErEQhYL
 xdH615xiCla9XwA1LoPHO4JeXfGr/7w1JfuaHTkSKmVzCP8A1azt3anUUQ0y
X-Google-Smtp-Source: AGHT+IE1n2nvg9Kl+rQMRrzpRa8QL8ixxs3dKu80LpBDkOLZX6U9dGWRVAWCnwqmSLb288pjQbQGwA==
X-Received: by 2002:a05:600c:4f4e:b0:431:57d2:d7b4 with SMTP id
 5b1f17b1804b1-432b751726emr37887635e9.26.1731101483965; 
 Fri, 08 Nov 2024 13:31:23 -0800 (PST)
Received: from guxtil.incerto.xyz
 (cpc100684-bagu15-2-0-cust967.1-3.cable.virginm.net. [86.8.111.200])
 by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-432aa6c11f8sm117286535e9.25.2024.11.08.13.31.23
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 08 Nov 2024 13:31:23 -0800 (PST)
From: Sharlatan Hellseher <sharlatanus@HIDDEN>
To: guix-patches@HIDDEN
Subject: [PATCH 0/1] teams: Add packages stats script.
Date: Fri,  8 Nov 2024 21:31:20 +0000
Message-ID: <cover.1731100267.git.sharlatanus@HIDDEN>
X-Mailer: git-send-email 2.46.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Received-SPF: pass client-ip=2a00:1450:4864:20::32d;
 envelope-from=sharlatanus@HIDDEN; helo=mail-wm1-x32d.google.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
Cc: Sharlatan Hellseher <sharlatanus@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

Hi Guix!

During working on python-team branch I aimed to fix as much packages as
possible to prepare it for the upcoming merge to master.  I faced with a fact
that there is no (or maybe I do not know about) tooling providing some larger
scale stats for packages within team scope.

Just a simple reasoning: Which N packages may be updated without triggering
larger scale rebuilds?  Which packages need to be update on team branch? Which
affect ratio does this package has? Which type of package modification would
trigger the rebuild of dependent (it was suprise that order of inputs does
trigger...)?

So... 

> ./pre-inst-env etc/teams-package-stats.scm stats python

Will generate a list of all packages for python team (defined for now as any
package which build-system is pyton or pyproject).

- module-file-name
- build-system-name
- package-name
- package-guix-version
- package-upstream-version
- all-inputs-count
- dependents-count
- affect-ratio"

Command `column' may be used to produce JSON for the farther analysys and
preparation.

e.g. some packages which have 0 impact if they are refreshed:
--8<---------------cut here---------------start------------->8---
> column -s, -t 1731089576-python-team | sort -k8 -n  | head -n20
deprecated-package                   pyproject  python-language-server                    1.11.0              nil  23  0     0.0
deprecated-package                   python     beets-next                                1.6.0               nil  31  0     0.0
deprecated-package                   python     python-trytond-purchase                   6.2.3               nil  21  0     0.0
gnu/packages/android.scm             python     fdroidserver                              1.1.9               nil  21  0     0.0
gnu/packages/astronomy.scm           pyproject  ginga-qt5                                 5.1.0               nil  22  0     0.0
gnu/packages/astronomy.scm           pyproject  python-poliastro                          0.17.0              nil  20  0     0.0
gnu/packages/bioinformatics.scm      pyproject  fanc                                      0-1.354401e         nil  29  0     0.0
gnu/packages/bioinformatics.scm      pyproject  python-baltica                            1.1.2               nil  27  0     0.0
gnu/packages/bioinformatics.scm      pyproject  python-episcanpy                          0.4.0               nil  25  0     0.0
gnu/packages/bioinformatics.scm      pyproject  python-fanc                               0.9.25              nil  26  0     0.0
gnu/packages/bioinformatics.scm      pyproject  python-hicexplorer                        3.7.4               nil  27  0     0.0
gnu/packages/bioinformatics.scm      pyproject  python-liana-py                           1.1.0               nil  25  0     0.0
gnu/packages/bioinformatics.scm      pyproject  python-metacells                          0.9.4               nil  26  0     0.0
gnu/packages/bittorrent.scm          python     deluge                                    2.1.1               nil  21  0     0.0
gnu/packages/bootloaders.scm         pyproject  patman                                    2024.01             nil  20  0     0.0
gnu/packages/databases.scm           pyproject  datasette                                 1.0a7               nil  29  0     0.0
gnu/packages/databases.scm           python     python-pyarrow                            0.16.0              nil  28  0     0.0
gnu/packages/finance.scm             python     electron-cash                             4.4.1               nil  23  0     0.0
gnu/packages/genealogy.scm           python     gramps                                    5.1.4               nil  23  0     0.0
gnu/packages/gnome.scm               python     terminator                                2.1.4               nil  20  0     0.0
--8<---------------cut here---------------end--------------->8---

I'm not confident in my Guile Scheme ;-) any review points are welcome.

CC core team for wider spread within teams.

Sharlatan Hellseher (1):
  etc: Add teams-packages-stats script.

 etc/teams-packages-stats.scm | 218 +++++++++++++++++++++++++++++++++++
 1 file changed, 218 insertions(+)
 create mode 100755 etc/teams-packages-stats.scm


base-commit: 2a6d96425eea57dc6dd48a2bec16743046e32e06
-- 
2.46.0





Acknowledgement sent to Sharlatan Hellseher <sharlatanus@HIDDEN>:
New bug report received and forwarded. Copy sent to guix-patches@HIDDEN. Full text available.
Report forwarded to guix-patches@HIDDEN:
bug#74268; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sun, 12 Jan 2025 05:45:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.