[PATCH 0/4] Minor tweaks of etc/teams.scm

  • Done
  • quality assurance status badge
Details
5 participants
  • Christopher Baines
  • Maxim Cournoyer
  • Mathieu Othacehe
  • (
  • zimoun
Owner
unassigned
Submitted by
zimoun
Severity
normal

Debbugs page

Z
Z
zimoun wrote on 20 Oct 2022 06:21
(address . guix-patches@gnu.org)(name . zimoun)(address . zimon.toutoune@gmail.com)
20221020132140.1546684-1-zimon.toutoune@gmail.com
Hi,

The first patch displays the regexp pattern and sort the files. Compare,

Toggle snippet (10 lines)
$ etc/teams.scm list-teams | recsel -n 21
id: java
name: Java and Maven team
description: The JDK and JRE, the Maven build system, Java packages, the ant-build-system, and the maven-build-system.
scope: #<regexp 7f61135ef3c0> #<regexp 7f61135ef380> "guix/build/ant-build-system.scm" "guix/build/java-utils.scm" "guix/build/maven-build-system.scm" #<regexp 7f61135ef340> "guix/build-system/ant.scm" "guix/build-system/maven.scm"
members:
+ Julien Lepiller <julien@lepiller.eu>
+ Björn Höfling <bjoern.hoefling@bjoernhoefling.de>

with

Toggle snippet (9 lines)
id: java
name: Java and Maven team
description: The JDK and JRE, the Maven build system, Java packages, the ant-build-system, and the maven-build-system.
scope: "^gnu/packages/java(-.+|)\\.scm$" "^gnu/packages/maven(-.+|)\\.scm$" "^guix/build/maven/" "guix/build-system/ant.scm" "guix/build-system/maven.scm" "guix/build/ant-build-system.scm" "guix/build/java-utils.scm" "guix/build/maven-build-system.scm"
members:
+ Julien Lepiller <julien@lepiller.eu>
+ Björn Höfling <bjoern.hoefling@bjoernhoefling.de>

Maybe I miss a point about regexp but I have not found a way to access the
pattern. Hence this new <regexp*> record.


The second patch sorts the members,

Toggle snippet (11 lines)
$ etc/teams.scm list-members mentors
( <paren@disroot.org>
Christopher Baines <mail@cbaines.net>
Ludovic Courtès <ludo@gnu.org>
Mathieu Othacehe <othacehe@gnu.org>
Ricardo Wurmus <rekado@elephly.net>
Simon Tournier <zimon.toutoune@gmail.com>
jgart <jgart@dismail.de>


The third patch sorts the teams,

Toggle snippet (26 lines)
$ etc/teams.scm list-teams | recsel -Cp id
id: core
id: emacs
id: embedded-bootstrap
id: games
id: go
id: haskell
id: home
id: installer
id: java
id: julia
id: kernel
id: lisp
id: mentors
id: mozilla
id: ocaml
id: python
id: r
id: racket
id: ruby
id: rust
id: science
id: translations


Note that show a team is not super handy,

Toggle snippet (34 lines)
$ etc/teams.scm list-teams | recsel -Cp id | grep -n id
1:id: core
2:id: emacs
3:id: embedded-bootstrap
4:id: games
5:id: go
6:id: haskell
7:id: home
8:id: installer
9:id: java
10:id: julia
11:id: kernel
12:id: lisp
13:id: mentors
14:id: mozilla
15:id: ocaml
16:id: python
17:id: r
18:id: racket
19:id: ruby
20:id: rust
21:id: science
22:id: translations

$ etc/teams.scm list-teams | recsel -n 7
id: installer
name: Installer script and system installer
description: <none>
scope: "^gnu/installer(\\.scm$|/)"
members:
+ Josselin Poiret <dev@jpoiret.xyz>
+ Mathieu Othacehe <othacehe@gnu.org>

Hence the last patch, (hum, I am not convinced :-))

Toggle snippet (35 lines)
$ etc/teams.scm list-teams | recsel -Cp id
id: (0) core
id: (1) emacs
id: (2) embedded-bootstrap
id: (3) games
id: (4) go
id: (5) haskell
id: (6) home
id: (7) installer
id: (8) java
id: (9) julia
id: (10) kernel
id: (11) lisp
id: (12) mentors
id: (13) mozilla
id: (14) ocaml
id: (15) python
id: (16) r
id: (17) racket
id: (18) ruby
id: (19) rust
id: (20) science
id: (21) translations

$ etc/teams.scm list-teams | recsel -n 15
id: (15) python
name: Python team
description: Python, Python packages, the "pypi" importer, and the python-build-system.
scope: "^gnu/packages/python(-.+|)\\.scm$" "gnu/packages/django.scm" "gnu/packages/jupyter.scm" "gnu/packages/sphinx.scm" "gnu/packages/tryton.scm" "guix/build-system/python.scm" "guix/build/python-build-system.scm" "guix/import/pypi.scm" "guix/scripts/import/pypi.scm" "tests/pypi.scm"
members:
+ Lars-Dominik Braun <lars@6xq.net>
+ jgart <jgart@dismail.de>


Cheers,
simon


zimoun (4):
etc: teams: Improve scope display.
etc: teams: List members sorted by name.
etc: teams: List teams sorted by id.
etc: teams: Display an id number.

etc/teams.scm.in | 83 ++++++++++++++++++++++++++++++++++--------------
1 file changed, 59 insertions(+), 24 deletions(-)


base-commit: 4716cea6256523a8ecf90a426d675bfb7620f3e4
--
2.36.0
Z
Z
zimoun wrote on 20 Oct 2022 06:28
[PATCH 3/4] etc: teams: List teams sorted by id.
(address . 58660@debbugs.gnu.org)(name . zimoun)(address . zimon.toutoune@gmail.com)
20221020132814.1549436-3-zimon.toutoune@gmail.com
* etc/teams.scm.in (list-teams): Sort teams by id.
---
etc/teams.scm.in | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)

Toggle diff (30 lines)
diff --git a/etc/teams.scm.in b/etc/teams.scm.in
index 8e18a5d206..3d4c7319c2 100644
--- a/etc/teams.scm.in
+++ b/etc/teams.scm.in
@@ -556,8 +556,8 @@ (define (list-teams)
"Print all teams, their scope and their members."
(define port* (current-output-port))
(define width* (%text-width))
- (hash-for-each
- (lambda (key team)
+ (for-each
+ (lambda (team)
(format port*
"\
id: ~a
@@ -584,7 +584,11 @@ (define width* (%text-width))
string<=?)))))
(list-members team port* "+ ")
(newline))
- %teams))
+ (sort
+ (hash-map->list (lambda (key value) value) %teams)
+ (lambda (team1 team2)
+ (string<? (symbol->string (team-id team1))
+ (symbol->string (team-id team2)))))))
(define (diff-revisions rev-start rev-end)
--
2.36.0
Z
Z
zimoun wrote on 20 Oct 2022 06:28
[PATCH 4/4] etc: teams: Display an id number.
(address . 58660@debbugs.gnu.org)(name . zimoun)(address . zimon.toutoune@gmail.com)
20221020132814.1549436-4-zimon.toutoune@gmail.com
* etc/teams.scm.in (list-teams): Add id number for easing 'recutils' use.
---
etc/teams.scm.in | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)

Toggle diff (37 lines)
diff --git a/etc/teams.scm.in b/etc/teams.scm.in
index 3d4c7319c2..790eb17131 100644
--- a/etc/teams.scm.in
+++ b/etc/teams.scm.in
@@ -556,15 +556,16 @@ (define (list-teams)
"Print all teams, their scope and their members."
(define port* (current-output-port))
(define width* (%text-width))
- (for-each
- (lambda (team)
+ (fold
+ (lambda (team id-number)
(format port*
"\
-id: ~a
+id: (~d) ~a
name: ~a
description: ~a
~amembers:
"
+ id-number
(team-id team)
(team-name team)
(or (and=> (team-description team)
@@ -583,7 +584,9 @@ (define width* (%text-width))
scope)
string<=?)))))
(list-members team port* "+ ")
- (newline))
+ (newline)
+ (1+ id-number))
+ 0
(sort
(hash-map->list (lambda (key value) value) %teams)
(lambda (team1 team2)
--
2.36.0
Z
Z
zimoun wrote on 20 Oct 2022 06:28
[PATCH 2/4] etc: teams: List members sorted by name.
(address . 58660@debbugs.gnu.org)(name . zimoun)(address . zimon.toutoune@gmail.com)
20221020132814.1549436-2-zimon.toutoune@gmail.com
* etc/teams.scm.in (list-members): Sort by name.
---
etc/teams.scm.in | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

Toggle diff (17 lines)
diff --git a/etc/teams.scm.in b/etc/teams.scm.in
index 394e4d7d46..8e18a5d206 100644
--- a/etc/teams.scm.in
+++ b/etc/teams.scm.in
@@ -548,7 +548,9 @@ (define port* (or port (current-output-port)))
prefix
(person-name member)
(person-email member)))
- (team-members team)))
+ (sort
+ (team-members team)
+ (lambda (m1 m2) (string<? (person-name m1) (person-name m2))))))
(define (list-teams)
"Print all teams, their scope and their members."
--
2.36.0
Z
Z
zimoun wrote on 20 Oct 2022 06:28
[PATCH 1/4] etc: teams: Improve scope display.
(address . 58660@debbugs.gnu.org)(name . zimoun)(address . zimon.toutoune@gmail.com)
20221020132814.1549436-1-zimon.toutoune@gmail.com
* etc/teams.scm.in (<regexp*>): New record type.
(make-regexp*, regexp-exec*): New procedures.
(python, haskell, julia, java, emacs, rust, core, translations, installer,
home): Use it.
(find-team-by-scope): Use it.
(list-teams): Use it and sort scope files.
---
etc/teams.scm.in | 62 ++++++++++++++++++++++++++++++++++--------------
1 file changed, 44 insertions(+), 18 deletions(-)

Toggle diff (172 lines)
diff --git a/etc/teams.scm.in b/etc/teams.scm.in
index c27ea5271e..394e4d7d46 100644
--- a/etc/teams.scm.in
+++ b/etc/teams.scm.in
@@ -5,6 +5,7 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2022 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2022 Mathieu Othacehe <othacehe@gnu.org>
+;;; Copyright © 2022 Simon Tournier <zimon.toutoune@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -37,6 +38,25 @@
(guix ui)
(git))
+;;; Work around regexp implementation.
+;;; This record allows to track the regexp pattern and then display it.
+(define-record-type <regexp*>
+ (regexp* pat flag)
+ regexp*?
+ (pat regexp-pattern*)
+ (flag regexp-flag*))
+
+(define* (make-regexp* pat #:optional flag)
+ (regexp* pat flag))
+
+(define (regexp-exec* rx* str)
+ (let ((rx (make-regexp
+ (regexp-pattern* rx*)
+ (or (regexp-flag* rx*)
+ regexp/extended))))
+ (regexp-exec rx str)))
+
+
(define-record-type <team>
(make-team id name description members scope)
team?
@@ -97,7 +117,7 @@ (define-team python
(list "gnu/packages/django.scm"
"gnu/packages/jupyter.scm"
;; Match haskell.scm and haskell-*.scm.
- (make-regexp "^gnu/packages/python(-.+|)\\.scm$")
+ (make-regexp* "^gnu/packages/python(-.+|)\\.scm$")
"gnu/packages/sphinx.scm"
"gnu/packages/tryton.scm"
"guix/build/python-build-system.scm"
@@ -115,7 +135,7 @@ (define-team haskell
#:scope
(list "gnu/packages/dhall.scm"
;; Match haskell.scm and haskell-*.scm.
- (make-regexp "^gnu/packages/haskell(-.+|)\\.scm$")
+ (make-regexp* "^gnu/packages/haskell(-.+|)\\.scm$")
"gnu/packages/purescript.scm"
"guix/build/haskell-build-system.scm"
"guix/build-system/haskell.scm"
@@ -143,7 +163,7 @@ (define-team julia
#:name "Julia team"
#:description
"The Julia language, Julia packages, and the julia-build-system."
- #:scope (list (make-regexp "^gnu/packages/julia(-.+|)\\.scm$")
+ #:scope (list (make-regexp* "^gnu/packages/julia(-.+|)\\.scm$")
"guix/build/julia-build-system.scm"
"guix/build-system/julia.scm")))
@@ -172,14 +192,14 @@ (define-team java
and the maven-build-system."
#:scope
(list ;; Match java.scm and java-*.scm.
- (make-regexp "^gnu/packages/java(-.+|)\\.scm$")
+ (make-regexp* "^gnu/packages/java(-.+|)\\.scm$")
;; Match maven.scm and maven-*.scm
- (make-regexp "^gnu/packages/maven(-.+|)\\.scm$")
+ (make-regexp* "^gnu/packages/maven(-.+|)\\.scm$")
"guix/build/ant-build-system.scm"
"guix/build/java-utils.scm"
"guix/build/maven-build-system.scm"
;; The maven directory
- (make-regexp "^guix/build/maven/")
+ (make-regexp* "^guix/build/maven/")
"guix/build-system/ant.scm"
"guix/build-system/maven.scm")))
@@ -192,7 +212,7 @@ (define-team emacs
#:name "Emacs team"
#:description "The extensible, customizable text editor and its
ecosystem."
- #:scope (list (make-regexp "^gnu/packages/emacs(-.+|)\\.scm$")
+ #:scope (list (make-regexp* "^gnu/packages/emacs(-.+|)\\.scm$")
"guix/build/emacs-build-system.scm"
"guix/build/emacs-utils.scm"
"guix/build-system/emacs.scm"
@@ -206,7 +226,7 @@ (define-team lisp
#:description
"Common Lisp and similar languages, Common Lisp packages and the
asdf-build-system."
- #:scope (list (make-regexp "^gnu/packages/lisp(-.+|)\\.scm$")
+ #:scope (list (make-regexp* "^gnu/packages/lisp(-.+|)\\.scm$")
"guix/build/asdf-build-system.scm"
"guix/build/lisp-utils.scm"
"guix/build-system/asdf.scm")))
@@ -238,7 +258,7 @@ (define-team embedded-bootstrap
(define-team rust
(team 'rust
#:name "Rust"
- #:scope (list (make-regexp "^gnu/packages/(crates|rust)(-.+|)\\.scm$")
+ #:scope (list (make-regexp* "^gnu/packages/(crates|rust)(-.+|)\\.scm$")
"guix/build/cargo-build-system.scm"
"guix/build/cargo-utils.scm"
"guix/build-system/cargo.scm"
@@ -336,9 +356,9 @@ (define-team core
"guix/upstream.scm"
"guix/utils.scm"
"guix/workers.scm"
- (make-regexp "^guix/platforms/")
- (make-regexp "^guix/scripts/")
- (make-regexp "^guix/store/"))))
+ (make-regexp* "^guix/platforms/")
+ (make-regexp* "^guix/scripts/")
+ (make-regexp* "^guix/store/"))))
(define-team games
(team 'games
@@ -355,17 +375,17 @@ (define-team translations
(team 'translations
#:name "Translations"
#:scope (list "etc/news.scm"
- (make-regexp "^po/"))))
+ (make-regexp* "^po/"))))
(define-team installer
(team 'installer
#:name "Installer script and system installer"
- #:scope (list (make-regexp "^gnu/installer(\\.scm$|/)"))))
+ #:scope (list (make-regexp* "^gnu/installer(\\.scm$|/)"))))
(define-team home
(team 'home
#:name "Team for \"Guix Home\""
- #:scope (list (make-regexp "^(gnu|guix/scripts)/home(\\.scm$|/)")
+ #:scope (list (make-regexp* "^(gnu|guix/scripts)/home(\\.scm$|/)")
"tests/guix-home.sh"
"tests/home-import.scm"
"tests/home-services.scm")))
@@ -501,8 +521,8 @@ (define (find-team-by-scope files)
(any (match-lambda
((? string? scope)
(string=? scope file))
- ((? regexp? scope)
- (regexp-exec scope file)))
+ ((? regexp*? scope)
+ (regexp-exec* scope file)))
(team-scope team)))
files)
(cons team acc)
@@ -553,7 +573,13 @@ (define width* (%text-width))
"<none>")
(match (team-scope team)
(() "")
- (scope (format #f "scope: ~{~s ~}~%" scope))))
+ (scope (format #f "scope: ~{~s ~}~%"
+ (sort
+ (map (match-lambda
+ ((? regexp*? rx*) (regexp-pattern* rx*))
+ ((? string? str) str))
+ scope)
+ string<=?)))))
(list-members team port* "+ ")
(newline))
%teams))
--
2.36.0
Z
Z
zimoun wrote on 4 Nov 2022 03:11
Re: bug#58660: [PATCH 0/4] Minor tweaks of etc/teams.scm
(address . 58660@debbugs.gnu.org)
86tu3f3u7y.fsf@gmail.com
Hi,

CC: core teams


Friendly ping about patch#58660 [1].



On Thu, 20 Oct 2022 at 15:21, zimoun <zimon.toutoune@gmail.com> wrote:


Compare old display with ugly regexp

Toggle quote (8 lines)
> id: java
> name: Java and Maven team
> description: The JDK and JRE, the Maven build system, Java packages, the ant-build-system, and the maven-build-system.
> scope: #<regexp 7f61135ef3c0> #<regexp 7f61135ef380> "guix/build/ant-build-system.scm" "guix/build/java-utils.scm" "guix/build/maven-build-system.scm" #<regexp 7f61135ef340> "guix/build-system/ant.scm" "guix/build-system/maven.scm"
> members:
> + Julien Lepiller <julien@lepiller.eu>
> + Björn Höfling <bjoern.hoefling@bjoernhoefling.de>

with the display by this patch:

Toggle quote (9 lines)
> id: java
> name: Java and Maven team
> description: The JDK and JRE, the Maven build system, Java packages, the ant-build-system, and the maven-build-system.
> scope: "^gnu/packages/java(-.+|)\\.scm$" "^gnu/packages/maven(-.+|)\\.scm$" "^guix/build/maven/" "guix/build-system/ant.scm" "guix/build-system/maven.scm" "guix/build/ant-build-system.scm" "guix/build/java-utils.scm" "guix/build/maven-build-system.scm"
> members:
> + Julien Lepiller <julien@lepiller.eu>
> + Björn Höfling <bjoern.hoefling@bjoernhoefling.de>


The second patch sorts the members,

Toggle quote (10 lines)
> $ etc/teams.scm list-members mentors
> ( <paren@disroot.org>
> Christopher Baines <mail@cbaines.net>
> Ludovic Courtès <ludo@gnu.org>
> Mathieu Othacehe <othacehe@gnu.org>
> Ricardo Wurmus <rekado@elephly.net>
> Simon Tournier <zimon.toutoune@gmail.com>
> jgart <jgart@dismail.de>


The third patch sorts the teams,

Toggle quote (26 lines)
> $ etc/teams.scm list-teams | recsel -Cp id
> id: core
> id: emacs
> id: embedded-bootstrap
> id: games
> id: go
> id: haskell
> id: home
> id: installer
> id: java
> id: julia
> id: kernel
> id: lisp
> id: mentors
> id: mozilla
> id: ocaml
> id: python
> id: r
> id: racket
> id: ruby
> id: rust
> id: science
> id: translations



Last, tangential change… :-)

Toggle quote (72 lines)
> Note that show a team is not super handy,
>
> $ etc/teams.scm list-teams | recsel -Cp id | grep -n id
> 1:id: core
> 2:id: emacs
> 3:id: embedded-bootstrap
> 4:id: games
> 5:id: go
> 6:id: haskell
> 7:id: home
> 8:id: installer
> 9:id: java
> 10:id: julia
> 11:id: kernel
> 12:id: lisp
> 13:id: mentors
> 14:id: mozilla
> 15:id: ocaml
> 16:id: python
> 17:id: r
> 18:id: racket
> 19:id: ruby
> 20:id: rust
> 21:id: science
> 22:id: translations
>
> $ etc/teams.scm list-teams | recsel -n 7
> id: installer
> name: Installer script and system installer
> description: <none>
> scope: "^gnu/installer(\\.scm$|/)"
> members:
> + Josselin Poiret <dev@jpoiret.xyz>
> + Mathieu Othacehe <othacehe@gnu.org>
>
>
> Hence the last patch, (hum, I am not convinced :-))
>
> $ etc/teams.scm list-teams | recsel -Cp id
> id: (0) core
> id: (1) emacs
> id: (2) embedded-bootstrap
> id: (3) games
> id: (4) go
> id: (5) haskell
> id: (6) home
> id: (7) installer
> id: (8) java
> id: (9) julia
> id: (10) kernel
> id: (11) lisp
> id: (12) mentors
> id: (13) mozilla
> id: (14) ocaml
> id: (15) python
> id: (16) r
> id: (17) racket
> id: (18) ruby
> id: (19) rust
> id: (20) science
> id: (21) translations
>
> $ etc/teams.scm list-teams | recsel -n 15
> id: (15) python
> name: Python team
> description: Python, Python packages, the "pypi" importer, and the python-build-system.
> scope: "^gnu/packages/python(-.+|)\\.scm$" "gnu/packages/django.scm" "gnu/packages/jupyter.scm" "gnu/packages/sphinx.scm" "gnu/packages/tryton.scm" "guix/build-system/python.scm" "guix/build/python-build-system.scm" "guix/import/pypi.scm" "guix/scripts/import/pypi.scm" "tests/pypi.scm"
> members:
> + Lars-Dominik Braun <lars@6xq.net>
> + jgart <jgart@dismail.de>


Well, if the patches make sense, then I could propose a manual update
(especially some words about recutils which is not common / mainstream.)


Cheers,
simon
(
Re: [bug#58660] [PATCH 1/4] etc: teams: Improve scope display.
CO4CTZTMR1V2.3TI0Z84P2Y05Q@guix-framework
Heya,

On Thu Oct 20, 2022 at 2:28 PM BST, zimoun wrote:
Toggle quote (16 lines)
> * etc/teams.scm.in (<regexp*>): New record type.
> (make-regexp*, regexp-exec*): New procedures.
> (python, haskell, julia, java, emacs, rust, core, translations, installer,
> home): Use it.
> (find-team-by-scope): Use it.
> (list-teams): Use it and sort scope files.

> @@ -553,7 +573,13 @@ (define width* (%text-width))
> + (scope (format #f "scope: ~{~s ~}~%"
> + (sort
> + (map (match-lambda
> + ((? regexp*? rx*) (regexp-pattern* rx*))
> + ((? string? str) str))
> + scope)
> + string<=?)))))

Would it not be better to, instead of displaying the actual regex
itself, display the files that match the regex, and separate the files
onto separate lines? Eg, rather than,

scope: "^gnu/packages/julia(-.+|).scm$" "guix/build/julia-build-system.scm" "guix/build-system/julia.scm"

we could display,

scope:
+ gnu/packages/julia.scm
+ gnu/packages/julia-jll.scm
+ gnu/packages/julia-xyz.scm
+ guix/build/julia-build-system.scm
+ guix/build-system/julia.scm

I find this to be much clearer.

-- (
Z
Z
zimoun wrote on 5 Nov 2022 06:09
86fsexv97s.fsf@gmail.com
Hi,

On Sat, 05 Nov 2022 at 12:18, "\( via Guix-patches" via <guix-patches@gnu.org> wrote:

Toggle quote (4 lines)
> Would it not be better to, instead of displaying the actual regex
> itself, display the files that match the regex, and separate the files
> onto separate lines?

You are proposing 2 things…

Toggle quote (13 lines)
> Eg, rather than,
>
> scope: "^gnu/packages/julia(-.+|).scm$" "guix/build/julia-build-system.scm" "guix/build-system/julia.scm"
>
> we could display,
>
> scope:
> + gnu/packages/julia.scm
> + gnu/packages/julia-jll.scm
> + gnu/packages/julia-xyz.scm
> + guix/build/julia-build-system.scm
> + guix/build-system/julia.scm

…one, about expanded regexp.

It means walk the repository tree and it is currently not done – and it
is not a good direction, IMHO.

Well, we could maintain the plain list of files instead of these
regexps. I am not convinced it would be better.


…two, about item list instead of oneline list.

Some teams have a lot of files, see ’core’. And I do not have an
opinion about which kind of list is better for readability.


WDYT?

Cheers,
simon
(
CO4ECYNBPNLA.3118M5GDGEUG7@guix-framework
On Sat Nov 5, 2022 at 1:09 PM GMT, zimoun wrote:
Toggle quote (6 lines)
> It means walk the repository tree and it is currently not done – and it
> is not a good direction, IMHO.
>
> Well, we could maintain the plain list of files instead of these
> regexps. I am not convinced it would be better.

I guess it could make list-teams slower, but I don't think it'd matter
too much. It's an infrequently-used script, after all, and I think the
vast majority of machines would be able to run a ftw for each regex
fast enough.

Toggle quote (3 lines)
> Some teams have a lot of files, see ’core’. And I do not have an
> opinion about which kind of list is better for readability.

I find this quite hard to read:

scope: "guix/avahi.scm" "guix/base16.scm" "guix/base32.scm" "guix/base64.scm" "guix/bzr-download.scm" "guix/cache.scm" "guix/channels.scm" "guix/ci.scm" "guix/colors.scm" "guix/combinators.scm" "guix/config.scm" "guix/cpio.scm" "guix/cpu.scm" "guix/cve.scm" "guix/cvs-download.scm" "guix/deprecation.scm" "guix/derivations.scm" "guix/describe.scm" "guix/diagnostics.scm" "guix/discovery.scm" "guix/docker.scm" "guix/download.scm" "guix/elf.scm" "guix/ftp-client.scm" "guix/gexp.scm" "guix/git-authenticate.scm" "guix/git-download.scm" "guix/git.scm" "guix/glob.scm" "guix/gnu-maintenance.scm" "guix/gnupg.scm" "guix/grafts.scm" "guix/graph.scm" "guix/hash.scm" "guix/hg-download.scm" "guix/http-client.scm" "guix/i18n.scm" "guix/inferior.scm" "guix/ipfs.scm" "guix/least-authority.scm" "guix/licenses.scm" "guix/lint.scm" "guix/man-db.scm" "guix/memoization.scm" "guix/modules.scm" "guix/monad-repl.scm" "guix/monads.scm" "guix/narinfo.scm" "guix/nar.scm" "guix/openpgp.scm" "guix/packages.scm" "guix/pki.scm" "guix/platform.scm" "guix/profiles.scm" "guix/profiling.scm" "guix/progress.scm" "guix/quirks.scm" "guix/read-print.scm" "guix/records.scm" "guix/remote.scm" "guix/repl.scm" "guix/search-paths.scm" "guix/self.scm" "guix/serialization.scm" "guix/sets.scm" "guix/ssh.scm" "guix/status.scm" "guix/store.scm" "guix/substitutes.scm" "guix/svn-download.scm" "guix/swh.scm" "guix/tests.scm" "guix/transformations.scm" "guix/ui.scm" "guix/upstream.scm" "guix/utils.scm" "guix/workers.scm" #<regexp 7f5b707a3bc0> #<regexp 7f5b707a39c0> #<regexp 7f5b707a3980>

compared to this, even if it's a bit long:

scope:
+ guix/avahi.scm
+ guix/base16.scm
+ guix/base32.scm
+ guix/base64.scm
+ guix/bzr-download.scm
+ guix/cache.scm
+ guix/channels.scm
+ guix/ci.scm
+ guix/colors.scm
+ guix/combinators.scm
+ guix/config.scm
+ guix/cpio.scm
+ guix/cpu.scm
+ guix/cve.scm
+ guix/cvs-download.scm
+ guix/deprecation.scm
+ guix/derivations.scm
+ guix/describe.scm
+ guix/diagnostics.scm
+ guix/discovery.scm
+ guix/docker.scm
+ guix/download.scm
+ guix/elf.scm
+ guix/ftp-client.scm
+ guix/gexp.scm
+ guix/git-authenticate.scm
+ guix/git-download.scm
+ guix/git.scm
+ guix/glob.scm
+ guix/gnu-maintenance.scm
+ guix/gnupg.scm
+ guix/grafts.scm
+ guix/graph.scm
+ guix/hash.scm
+ guix/hg-download.scm
+ guix/http-client.scm
+ guix/i18n.scm
+ guix/inferior.scm
+ guix/ipfs.scm
+ guix/least-authority.scm
+ guix/licenses.scm
+ guix/lint.scm
+ guix/man-db.scm
+ guix/memoization.scm
+ guix/modules.scm
+ guix/monad-repl.scm
+ guix/monads.scm
+ guix/narinfo.scm
+ guix/nar.scm
+ guix/openpgp.scm
+ guix/packages.scm
+ guix/pki.scm
+ guix/platform.scm
+ guix/profiles.scm
+ guix/profiling.scm
+ guix/progress.scm
+ guix/quirks.scm
+ guix/read-print.scm
+ guix/records.scm
+ guix/remote.scm
+ guix/repl.scm
+ guix/search-paths.scm
+ guix/self.scm
+ guix/serialization.scm
+ guix/sets.scm
+ guix/ssh.scm
+ guix/status.scm
+ guix/store.scm
+ guix/substitutes.scm
+ guix/svn-download.scm
+ guix/swh.scm
+ guix/tests.scm
+ guix/transformations.scm
+ guix/ui.scm
+ guix/upstream.scm
+ guix/utils.scm
+ guix/workers.scm
+ (regex)
+ (regex)
+ (regex)

-- (
M
M
Mathieu Othacehe wrote on 9 Nov 2022 08:23
Re: bug#58660: [PATCH 0/4] Minor tweaks of etc/teams.scm
(name . zimoun)(address . zimon.toutoune@gmail.com)(address . 58660@debbugs.gnu.org)
87pmdwm6zy.fsf@gnu.org
Hello zimoun,

I applied patches two and three.

Regarding the first patch, I find the paren suggestions quite
nice. Showing the list of affected files can help to tweak the
corresponding regex . The list display of the scope also
appears more readable.

Toggle quote (6 lines)
> Hence the last patch, (hum, I am not convinced :-))
>
> $ etc/teams.scm list-teams | recsel -Cp id
> id: (0) core
> id: (1) emacs

Regarding the last patch, I'm also not really convinced that users will
understand that the id is meant as a shortcut for later recsel usage.

Let me know if you'd like to implement what's proposed by paren,
otherwise I think we can close that one :)

Thanks,

Mathieu
Z
Z
zimoun wrote on 17 Nov 2022 12:28
[PATCH v2 2/3] etc: teams: Sort and itemize 'scope' field.
(address . 58660@debbugs.gnu.org)
20221117202820.2054593-2-zimon.toutoune@gmail.com
* etc/teams.scm.in (list-teams): Sort and itemize the 'scope' field.
---
etc/teams.scm.in | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

Toggle diff (22 lines)
diff --git a/etc/teams.scm.in b/etc/teams.scm.in
index e4e0dc209d..3f90e0e6f2 100644
--- a/etc/teams.scm.in
+++ b/etc/teams.scm.in
@@ -562,7 +562,14 @@ (define width* (%text-width))
"<none>")
(match (team-scope team)
(() "")
- (scope (format #f "scope: ~{~s ~}~%" scope))))
+ (scope-files
+ (fold
+ (lambda (str fmt)
+ (string-append fmt str))
+ (format #f "scope:~%")
+ (sort
+ (map (lambda (scope) (format #f "+ ~a~%" scope)) scope-files)
+ string<=?)))))
(list-members team port* "+ ")
(newline))
(if team-names
--
2.38.1
Z
Z
zimoun wrote on 17 Nov 2022 12:28
[PATCH v2 3/3] etc: teams: Improve display of regular expression in 'scope' field.
(address . 58660@debbugs.gnu.org)
20221117202820.2054593-3-zimon.toutoune@gmail.com
* etc/teams.scm.in (<regexp*>): New record type.
(make-regexp*, regexp-exec*): New procedures.
(python, haskell, julia, java, emacs, rust, core, translations, installer,
home): Use it.
(find-team-by-scope): Use it.
(list-teams): Use it.
---
etc/teams.scm.in | 59 +++++++++++++++++++++++++++++++++---------------
1 file changed, 41 insertions(+), 18 deletions(-)

Toggle diff (162 lines)
diff --git a/etc/teams.scm.in b/etc/teams.scm.in
index 3f90e0e6f2..3bdf91597f 100644
--- a/etc/teams.scm.in
+++ b/etc/teams.scm.in
@@ -38,6 +38,25 @@
(guix ui)
(git))
+;;; Work around regexp implementation.
+;;; This record allows to track the regexp pattern and then display it.
+(define-record-type <regexp*>
+ (regexp* pat flag)
+ regexp*?
+ (pat regexp-pattern*)
+ (flag regexp-flag*))
+
+(define* (make-regexp* pat #:optional flag)
+ (regexp* pat flag))
+
+(define (regexp-exec* rx* str)
+ (let ((rx (make-regexp
+ (regexp-pattern* rx*)
+ (or (regexp-flag* rx*)
+ regexp/extended))))
+ (regexp-exec rx str)))
+
+
(define-record-type <team>
(make-team id name description members scope)
team?
@@ -98,7 +117,7 @@ (define-team python
(list "gnu/packages/django.scm"
"gnu/packages/jupyter.scm"
;; Match haskell.scm and haskell-*.scm.
- (make-regexp "^gnu/packages/python(-.+|)\\.scm$")
+ (make-regexp* "^gnu/packages/python(-.+|)\\.scm$")
"gnu/packages/sphinx.scm"
"gnu/packages/tryton.scm"
"guix/build/pyproject-build-system.scm"
@@ -118,7 +137,7 @@ (define-team haskell
#:scope
(list "gnu/packages/dhall.scm"
;; Match haskell.scm and haskell-*.scm.
- (make-regexp "^gnu/packages/haskell(-.+|)\\.scm$")
+ (make-regexp* "^gnu/packages/haskell(-.+|)\\.scm$")
"gnu/packages/purescript.scm"
"guix/build/haskell-build-system.scm"
"guix/build-system/haskell.scm"
@@ -146,7 +165,7 @@ (define-team julia
#:name "Julia team"
#:description
"The Julia language, Julia packages, and the julia-build-system."
- #:scope (list (make-regexp "^gnu/packages/julia(-.+|)\\.scm$")
+ #:scope (list (make-regexp* "^gnu/packages/julia(-.+|)\\.scm$")
"guix/build/julia-build-system.scm"
"guix/build-system/julia.scm")))
@@ -175,14 +194,14 @@ (define-team java
and the maven-build-system."
#:scope
(list ;; Match java.scm and java-*.scm.
- (make-regexp "^gnu/packages/java(-.+|)\\.scm$")
+ (make-regexp* "^gnu/packages/java(-.+|)\\.scm$")
;; Match maven.scm and maven-*.scm
- (make-regexp "^gnu/packages/maven(-.+|)\\.scm$")
+ (make-regexp* "^gnu/packages/maven(-.+|)\\.scm$")
"guix/build/ant-build-system.scm"
"guix/build/java-utils.scm"
"guix/build/maven-build-system.scm"
;; The maven directory
- (make-regexp "^guix/build/maven/")
+ (make-regexp* "^guix/build/maven/")
"guix/build-system/ant.scm"
"guix/build-system/maven.scm")))
@@ -195,7 +214,7 @@ (define-team emacs
#:name "Emacs team"
#:description "The extensible, customizable text editor and its
ecosystem."
- #:scope (list (make-regexp "^gnu/packages/emacs(-.+|)\\.scm$")
+ #:scope (list (make-regexp* "^gnu/packages/emacs(-.+|)\\.scm$")
"guix/build/emacs-build-system.scm"
"guix/build/emacs-utils.scm"
"guix/build-system/emacs.scm"
@@ -209,7 +228,7 @@ (define-team lisp
#:description
"Common Lisp and similar languages, Common Lisp packages and the
asdf-build-system."
- #:scope (list (make-regexp "^gnu/packages/lisp(-.+|)\\.scm$")
+ #:scope (list (make-regexp* "^gnu/packages/lisp(-.+|)\\.scm$")
"guix/build/asdf-build-system.scm"
"guix/build/lisp-utils.scm"
"guix/build-system/asdf.scm")))
@@ -241,7 +260,7 @@ (define-team embedded-bootstrap
(define-team rust
(team 'rust
#:name "Rust"
- #:scope (list (make-regexp "^gnu/packages/(crates|rust)(-.+|)\\.scm$")
+ #:scope (list (make-regexp* "^gnu/packages/(crates|rust)(-.+|)\\.scm$")
"guix/build/cargo-build-system.scm"
"guix/build/cargo-utils.scm"
"guix/build-system/cargo.scm"
@@ -339,9 +358,9 @@ (define-team core
"guix/upstream.scm"
"guix/utils.scm"
"guix/workers.scm"
- (make-regexp "^guix/platforms/")
- (make-regexp "^guix/scripts/")
- (make-regexp "^guix/store/"))))
+ (make-regexp* "^guix/platforms/")
+ (make-regexp* "^guix/scripts/")
+ (make-regexp* "^guix/store/"))))
(define-team games
(team 'games
@@ -358,17 +377,17 @@ (define-team translations
(team 'translations
#:name "Translations"
#:scope (list "etc/news.scm"
- (make-regexp "^po/"))))
+ (make-regexp* "^po/"))))
(define-team installer
(team 'installer
#:name "Installer script and system installer"
- #:scope (list (make-regexp "^gnu/installer(\\.scm$|/)"))))
+ #:scope (list (make-regexp* "^gnu/installer(\\.scm$|/)"))))
(define-team home
(team 'home
#:name "Team for \"Guix Home\""
- #:scope (list (make-regexp "^(gnu|guix/scripts)/home(\\.scm$|/)")
+ #:scope (list (make-regexp* "^(gnu|guix/scripts)/home(\\.scm$|/)")
"tests/guix-home.sh"
"tests/home-import.scm"
"tests/home-services.scm")))
@@ -508,8 +527,8 @@ (define (find-team-by-scope files)
(any (match-lambda
((? string? scope)
(string=? scope file))
- ((? regexp? scope)
- (regexp-exec scope file)))
+ ((? regexp*? scope)
+ (regexp-exec* scope file)))
(team-scope team)))
files)
(cons team acc)
@@ -568,7 +587,11 @@ (define width* (%text-width))
(string-append fmt str))
(format #f "scope:~%")
(sort
- (map (lambda (scope) (format #f "+ ~a~%" scope)) scope-files)
+ (map (compose (cut format #f "+ ~a~%" <>)
+ (match-lambda
+ ((? regexp*? rx*) (regexp-pattern* rx*))
+ ((? string? str) str)))
+ scope-files)
string<=?)))))
(list-members team port* "+ ")
(newline))
--
2.38.1
Z
Z
zimoun wrote on 17 Nov 2022 12:28
[PATCH v2 1/3] etc: teams: Add 'show' subcommand.
(address . 58660@debbugs.gnu.org)
20221117202820.2054593-1-zimon.toutoune@gmail.com
* etc/teams.scm.in: Add 'show' subcommand.
---
etc/teams.scm.in | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)

Toggle diff (60 lines)
diff --git a/etc/teams.scm.in b/etc/teams.scm.in
index c458b14e3b..e4e0dc209d 100644
--- a/etc/teams.scm.in
+++ b/etc/teams.scm.in
@@ -5,6 +5,7 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2022 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2022 Mathieu Othacehe <othacehe@gnu.org>
+;;; Copyright © 2022 Simon Tournier <zimon.toutoune@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -538,7 +539,7 @@ (define port* (or port (current-output-port)))
(team-members team)
(lambda (m1 m2) (string<? (person-name m1) (person-name m2))))))
-(define (list-teams)
+(define* (list-teams #:optional team-names)
"Print all teams, their scope and their members."
(define port* (current-output-port))
(define width* (%text-width))
@@ -564,11 +565,13 @@ (define width* (%text-width))
(scope (format #f "scope: ~{~s ~}~%" scope))))
(list-members team port* "+ ")
(newline))
- (sort
- (hash-map->list (lambda (key value) value) %teams)
- (lambda (team1 team2)
- (string<? (symbol->string (team-id team1))
- (symbol->string (team-id team2)))))))
+ (if team-names
+ (map find-team team-names)
+ (sort
+ (hash-map->list (lambda (key value) value) %teams)
+ (lambda (team1 team2)
+ (string<? (symbol->string (team-id team1))
+ (symbol->string (team-id team2))))))))
(define (diff-revisions rev-start rev-end)
@@ -611,6 +614,8 @@ (define (main . args)
(lambda (team-name)
(list-members (find-team team-name)))
team-names))
+ (("show" . team-names)
+ (list-teams team-names))
(anything
(format (current-error-port)
"Usage: etc/teams.scm <command> [<args>]
@@ -619,6 +624,7 @@ (define (main . args)
cc <team-name> get git send-email flags for cc-ing <team-name>
cc-members <start> <end> cc teams related to files changed between revisions
list-teams list teams and their members
- list-members <team-name> list members belonging to <team-name>~%"))))
+ list-members <team-name> list members belonging to <team-name>
+ show <team-name> display <team-name> properties~%"))))
(apply main (cdr (command-line)))
--
2.38.1
Z
Z
zimoun wrote on 17 Nov 2022 12:27
Re: [bug#58660] [PATCH 0/4] Minor tweaks of etc/teams.scm
(name . Mathieu Othacehe)(address . othacehe@gnu.org)(address . 58660@debbugs.gnu.org)
87edu1xr6g.fsf@gmail.com
Hi,

Please see v2. Improving on the top (bb4d32b655) of already merged
patches. :-)

On Wed, 09 Nov 2022 at 17:23, Mathieu Othacehe <othacehe@gnu.org> wrote:

Toggle quote (3 lines)
> Regarding the last patch, I'm also not really convinced that users will
> understand that the id is meant as a shortcut for later recsel usage.

I have added another subcommand.


Toggle snippet (11 lines)
$ ./etc/teams.scm show python
id: python
name: Python team
description: Python, Python packages, the "pypi" importer, and the python-build-system.
scope: "gnu/packages/django.scm" "gnu/packages/jupyter.scm" #<regexp 7f0e8e231500> "gnu/packages/sphinx.scm" "gnu/packages/tryton.scm" "guix/build/pyproject-build-system.scm" "guix/build-system/pyproject.scm" "guix/build/python-build-system.scm" "guix/build-system/python.scm" "guix/import/pypi.scm" "guix/scripts/import/pypi.scm" "tests/pypi.scm"
members:
+ Lars-Dominik Braun <lars@6xq.net>
+ jgart <jgart@dismail.de>


Toggle quote (3 lines)
> Let me know if you'd like to implement what's proposed by paren,
> otherwise I think we can close that one :)

Well, I am not convinced by walking all the tree. Therefore, second
patch just itemize the current list.

Toggle snippet (21 lines)
id: python
name: Python team
description: Python, Python packages, the "pypi" importer, and the python-build-system.
scope:
+ #<regexp 7f6315fb3500>
+ gnu/packages/django.scm
+ gnu/packages/jupyter.scm
+ gnu/packages/sphinx.scm
+ gnu/packages/tryton.scm
+ guix/build-system/pyproject.scm
+ guix/build-system/python.scm
+ guix/build/pyproject-build-system.scm
+ guix/build/python-build-system.scm
+ guix/import/pypi.scm
+ guix/scripts/import/pypi.scm
+ tests/pypi.scm
members:
+ Lars-Dominik Braun <lars@6xq.net>
+ jgart <jgart@dismail.de>

And the last patch replaces the #<regexp...> by the string pattern.

Toggle snippet (21 lines)
id: python
name: Python team
description: Python, Python packages, the "pypi" importer, and the python-build-system.
scope:
+ ^gnu/packages/python(-.+|)\.scm$
+ gnu/packages/django.scm
+ gnu/packages/jupyter.scm
+ gnu/packages/sphinx.scm
+ gnu/packages/tryton.scm
+ guix/build-system/pyproject.scm
+ guix/build-system/python.scm
+ guix/build/pyproject-build-system.scm
+ guix/build/python-build-system.scm
+ guix/import/pypi.scm
+ guix/scripts/import/pypi.scm
+ tests/pypi.scm
members:
+ Lars-Dominik Braun <lars@6xq.net>
+ jgart <jgart@dismail.de>

Well, all are an improvement, I guess. Then, even if merged, we can
still improve and walk the tree. :-)


Cheers,
simon
M
M
Mathieu Othacehe wrote on 18 Nov 2022 09:23
Re: [PATCH v2 2/3] etc: teams: Sort and itemize 'scope' field.
(name . zimoun)(address . zimon.toutoune@gmail.com)(address . 58660@debbugs.gnu.org)
87fsegfa77.fsf@gnu.org
Hello,

Toggle quote (8 lines)
> + (scope-files
> + (fold
> + (lambda (str fmt)
> + (string-append fmt str))
> + (format #f "scope:~%")
> + (sort
> + (map (lambda (scope) (format #f "+ ~a~%" scope)) scope-files)

Why not:

(scope (format #f "scope:~%~{+ ~s ~}~%" scope))

Toggle quote (2 lines)
> + string<=?)))))

At that point, scope is not always a string:

Toggle snippet (4 lines)
ERROR: In procedure string<=?:
In procedure string<=: Wrong type argument in position 1 (expecting string): #<regexp 7fd842030980>

Thanks,

Mathieu
M
M
Mathieu Othacehe wrote on 18 Nov 2022 09:29
Re: [PATCH v2 1/3] etc: teams: Add 'show' subcommand.
(name . zimoun)(address . zimon.toutoune@gmail.com)(address . 58660@debbugs.gnu.org)
87bkp4f9wx.fsf@gnu.org
Hello,

Toggle quote (8 lines)
> "Print all teams, their scope and their members."
> (define port* (current-output-port))
> (define width* (%text-width))
> @@ -564,11 +565,13 @@ (define width* (%text-width))
> (scope (format #f "scope: ~{~s ~}~%" scope))))
> (list-members team port* "+ ")
> (newline))

This procedure is starting to get a little complex. We could put the
above is a sub-procedure called "print-team".

Toggle quote (6 lines)
> + (sort
> + (hash-map->list (lambda (key value) value) %teams)
> + (lambda (team1 team2)
> + (string<? (symbol->string (team-id team1))
> + (symbol->string (team-id team2))))))))

That could be in a variable called %sorted-teams.

Thanks,

Mathieu
M
M
Mathieu Othacehe wrote on 18 Nov 2022 09:31
Re: [bug#58660] [PATCH 0/4] Minor tweaks of etc/teams.scm
(name . zimoun)(address . zimon.toutoune@gmail.com)(address . 58660@debbugs.gnu.org)
877czsf9uo.fsf@gnu.org
Hey,

Thanks for the v2 :)

Toggle quote (4 lines)
> I have added another subcommand.
>
> $ ./etc/teams.scm show python

Nice.

Toggle quote (3 lines)
> Well, all are an improvement, I guess. Then, even if merged, we can
> still improve and walk the tree. :-)

Sure, seems like a good start indeed.

I made a few comments, could you please send a v3?

Thanks,

Mathieu
Z
Z
zimoun wrote on 21 Nov 2022 06:11
Re: [bug#58660] [PATCH v2 2/3] etc: teams: Sort and itemize 'scope' field.
(name . Mathieu Othacehe)(address . othacehe@gnu.org)(address . 58660@debbugs.gnu.org)
878rk4xuqy.fsf@gmail.com
Hi Mathieu,

On Fri, 18 Nov 2022 at 18:23, Mathieu Othacehe <othacehe@gnu.org> wrote:


Toggle quote (4 lines)
> Why not:
>
> (scope (format #f "scope:~%~{+ ~s ~}~%" scope))

Because this does not “itemize” correctly. For instance, it outputs:

Toggle snippet (10 lines)
id: python
name: Python team
description: Python, Python packages, the "pypi" importer, and the python-build-system.
scope:
+ "gnu/packages/django.scm" + "gnu/packages/jupyter.scm" + #<regexp 7f408800d500> + "gnu/packages/sphinx.scm" + "gnu/packages/tryton.scm" + "guix/build/pyproject-build-system.scm" + "guix/build-system/pyproject.scm" + "guix/build/python-build-system.scm" + "guix/build-system/python.scm" + "guix/import/pypi.scm" + "guix/scripts/import/pypi.scm" + "tests/pypi.scm"
members:
+ Lars-Dominik Braun <lars@6xq.net>
+ jgart <jgart@dismail.de>

When what we want is:

Toggle snippet (15 lines)
scope:
+ "gnu/packages/django.scm"
+ "gnu/packages/jupyter.scm"
+ #<regexp 7f408800d500>
+ "gnu/packages/sphinx.scm"
+ "gnu/packages/tryton.scm"
+ "guix/build/pyproject-build-system.scm"
+ "guix/build-system/pyproject.scm"
+ "guix/build/python-build-system.scm"
+ "guix/build-system/python.scm"
+ "guix/import/pypi.scm"
+ "guix/scripts/import/pypi.scm"
+ "tests/pypi.scm"

Well, the ’~%’ is included:

(scope (format #f "scope:~%~{+ ~s~% ~}~%" scope))))

then there is one extra:

Toggle snippet (23 lines)
id: python
name: Python team
description: Python, Python packages, the "pypi" importer, and the python-build-system.
scope:
+ "gnu/packages/django.scm"
+ "gnu/packages/jupyter.scm"
+ #<regexp 7f40de756500>
+ "gnu/packages/sphinx.scm"
+ "gnu/packages/tryton.scm"
+ "guix/build/pyproject-build-system.scm"
+ "guix/build-system/pyproject.scm"
+ "guix/build/python-build-system.scm"
+ "guix/build-system/python.scm"
+ "guix/import/pypi.scm"
+ "guix/scripts/import/pypi.scm"
+ "tests/pypi.scm"
members:
+ Lars-Dominik Braun <lars@6xq.net>
+ jgart <jgart@dismail.de>


Toggle quote (9 lines)
>> + string<=?)))))
>
> At that point, scope is not always a string:
>
> --8<---------------cut here---------------start------------->8---
> ERROR: In procedure string<=?:
> In procedure string<=: Wrong type argument in position 1 (expecting string): #<regexp 7fd842030980>
> --8<---------------cut here---------------end--------------->8---

Hum, I miss how you get that. This,

(map (lambda (scope) (format #f "+ ~a~%" scope)) scope-files)

transforms all as string. For instance, applying this patch on the top
of the introduction of “./etc/teams.scm show”, I get:

Toggle snippet (22 lines)
id: python
name: Python team
description: Python, Python packages, the "pypi" importer, and the python-build-system.
scope:
+ #<regexp 7fc05bdd6500>
+ gnu/packages/django.scm
+ gnu/packages/jupyter.scm
+ gnu/packages/sphinx.scm
+ gnu/packages/tryton.scm
+ guix/build-system/pyproject.scm
+ guix/build-system/python.scm
+ guix/build/pyproject-build-system.scm
+ guix/build/python-build-system.scm
+ guix/import/pypi.scm
+ guix/scripts/import/pypi.scm
+ tests/pypi.scm
members:
+ Lars-Dominik Braun <lars@6xq.net>
+ jgart <jgart@dismail.de>


Cheers,
simon
Z
Z
zimoun wrote on 21 Nov 2022 08:00
Re: [bug#58660] [PATCH v2 1/3] etc: teams: Add 'show' subcommand.
(name . Mathieu Othacehe)(address . othacehe@gnu.org)(address . 58660@debbugs.gnu.org)
87h6yswb4b.fsf@gmail.com
Hi Mathieu,

On Fri, 18 Nov 2022 at 18:29, Mathieu Othacehe <othacehe@gnu.org> wrote:

Toggle quote (3 lines)
> This procedure is starting to get a little complex. We could put the
> above is a sub-procedure called "print-team".

I will try to revamp for a v3.

Toggle quote (8 lines)
>> + (sort
>> + (hash-map->list (lambda (key value) value) %teams)
>> + (lambda (team1 team2)
>> + (string<? (symbol->string (team-id team1))
>> + (symbol->string (team-id team2))))))))
>
> That could be in a variable called %sorted-teams.

This had been introduced by 18fb7c0f3078216bf4fc865d86b3be76ddc68414.
Indeed, it could be extracted; part of the revamp.


Cheers,
simon
C
C
Christopher Baines wrote on 23 Nov 2022 01:15
tag 58660 moreinfo
(address . control@debbugs.gnu.org)
87ilj66ngj.fsf@cbaines.net
tags 58660 + moreinfo
quit
M
M
Maxim Cournoyer wrote on 29 Aug 2023 11:58
Re: bug#58660: [PATCH 0/4] Minor tweaks of etc/teams.scm
(name . zimoun)(address . zimon.toutoune@gmail.com)
874jkhbrr2.fsf_-_@gmail.com
Hi,

zimoun <zimon.toutoune@gmail.com> writes:

Toggle quote (65 lines)
> Hi Mathieu,
>
> On Fri, 18 Nov 2022 at 18:23, Mathieu Othacehe <othacehe@gnu.org> wrote:
>
>
>> Why not:
>>
>> (scope (format #f "scope:~%~{+ ~s ~}~%" scope))
>
> Because this does not “itemize” correctly. For instance, it outputs:
>
> id: python
> name: Python team
> description: Python, Python packages, the "pypi" importer, and the python-build-system.
> scope:
> + "gnu/packages/django.scm" + "gnu/packages/jupyter.scm" + #<regexp 7f408800d500> + "gnu/packages/sphinx.scm" + "gnu/packages/tryton.scm" + "guix/build/pyproject-build-system.scm" + "guix/build-system/pyproject.scm" + "guix/build/python-build-system.scm" + "guix/build-system/python.scm" + "guix/import/pypi.scm" + "guix/scripts/import/pypi.scm" + "tests/pypi.scm"
> members:
> + Lars-Dominik Braun <lars@6xq.net>
> + jgart <jgart@dismail.de>
>
>
> When what we want is:
>
> scope:
> + "gnu/packages/django.scm"
> + "gnu/packages/jupyter.scm"
> + #<regexp 7f408800d500>
> + "gnu/packages/sphinx.scm"
> + "gnu/packages/tryton.scm"
> + "guix/build/pyproject-build-system.scm"
> + "guix/build-system/pyproject.scm"
> + "guix/build/python-build-system.scm"
> + "guix/build-system/python.scm"
> + "guix/import/pypi.scm"
> + "guix/scripts/import/pypi.scm"
> + "tests/pypi.scm"
>
>
> Well, the ’~%’ is included:
>
> (scope (format #f "scope:~%~{+ ~s~% ~}~%" scope))))
>
> then there is one extra:
>
> id: python
> name: Python team
> description: Python, Python packages, the "pypi" importer, and the python-build-system.
> scope:
> + "gnu/packages/django.scm"
> + "gnu/packages/jupyter.scm"
> + #<regexp 7f40de756500>
> + "gnu/packages/sphinx.scm"
> + "gnu/packages/tryton.scm"
> + "guix/build/pyproject-build-system.scm"
> + "guix/build-system/pyproject.scm"
> + "guix/build/python-build-system.scm"
> + "guix/build-system/python.scm"
> + "guix/import/pypi.scm"
> + "guix/scripts/import/pypi.scm"
> + "tests/pypi.scm"
>
> members:
> + Lars-Dominik Braun <lars@6xq.net>
> + jgart <jgart@dismail.de>

That's fixable with the 'escape' escape, ~^:

Toggle snippet (3 lines)
(format #f "scope:~%~{+ ~a~^~%~}~%" scope)

I've reworked your v2, integrating the comments from Mathieu and
installed it as 4d7b25a0e2abd77625cdc888c60da8e6add02bbd.

Closing!

--
Thanks,
Maxim
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 58660@patchwise.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 58660
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch