unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: 66525@debbugs.gnu.org
Cc: "Ludovic Courtès" <ludo@gnu.org>,
	"Lars-Dominik Braun" <lars@6xq.net>,
	"Marius Bakke" <marius@gnu.org>,
	"Munyoki Kilyungi" <me@bonfacemunyoki.com>,
	jgart <jgart@dismail.de>
Subject: [bug#66525] [PATCH 4/7] gnu: python-dbusmock: Rewrite phases as a gexp.
Date: Fri, 13 Oct 2023 17:47:47 +0200	[thread overview]
Message-ID: <0ee0f58bdbe25eeed5bcf4ce52c56e6d6b180bb9.1697211312.git.ludo@gnu.org> (raw)
In-Reply-To: <cover.1697211312.git.ludo@gnu.org>

* gnu/packages/python-xyz.scm (python-dbusmock)[arguments]: Use gexps.
---
 gnu/packages/python-xyz.scm | 62 +++++++++++++++++++------------------
 1 file changed, 32 insertions(+), 30 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index e871951def..d6747a55c0 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -27156,37 +27156,39 @@ (define-public python-dbusmock
          "1nwl0gzzds2g1w1gfxfzlgrkb5hr1rrdyn619ml25c6b1rjyfk3g"))))
     (build-system python-build-system)
     (arguments
-     `(#:modules ((guix build python-build-system)
-                  (guix build utils)
-                  (ice-9 match))
+     (list #:modules `((guix build python-build-system)
+                       (guix build utils)
+                       (ice-9 match))
 
-       #:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'patch-paths
-           (lambda* (#:key inputs #:allow-other-keys)
-             (substitute* "tests/test_code.py"
-               (("/bin/bash") (which "bash")))
-             (substitute* "dbusmock/testcase.py"
-               (("'dbus-daemon'")
-                (string-append "'" (assoc-ref inputs "dbus")
-                               "/bin/dbus-daemon'")))))
-         (replace 'check
-           (lambda* (#:key tests? #:allow-other-keys)
-             (when tests?
-               (match (primitive-fork)
-                 (0                     ;child process
-                  (execlp "pytest" "pytest" "-vv"))
-                 (pytest-pid
-                  (let loop ()
-                    ;; Reap child processes; otherwise, python-dbusmock would
-                    ;; waste time polling for the dbus processes it spawns to
-                    ;; be reaped, in vain.
-                    (match (waitpid WAIT_ANY)
-                      ((pid . status)
-                       (if (= pid pytest-pid)
-                           (unless (zero? status)
-                             (error "`pytest' exited with status" status))
-                           (loop)))))))))))))
+           #:phases
+           #~(modify-phases %standard-phases
+               (add-after 'unpack 'patch-paths
+                 (lambda* (#:key inputs #:allow-other-keys)
+                   (substitute* "tests/test_code.py"
+                     (("/bin/bash")
+                      (which "bash")))
+                   (substitute* "dbusmock/testcase.py"
+                     (("'dbus-daemon'")
+                      (string-append "'" (assoc-ref inputs "dbus")
+                                     "/bin/dbus-daemon'")))))
+               (replace 'check
+                 (lambda* (#:key tests? #:allow-other-keys)
+                   (when tests?
+                     (match (primitive-fork)
+                       (0 ;child process
+                        (execlp "pytest" "pytest" "-vv"))
+                       (pytest-pid
+                        (let loop ()
+                          ;; Reap child processes; otherwise, python-dbusmock
+                          ;; would waste time polling for the dbus processes
+                          ;; it spawns to be reaped, in vain.
+                          (match (waitpid WAIT_ANY)
+                            ((pid . status)
+                             (if (= pid pytest-pid)
+                                 (unless (zero? status)
+                                   (error "`pytest' exited with status"
+                                          status))
+                                 (loop)))))))))))))
     (native-inputs
      (list dbus python-pytest which))
     (inputs
-- 
2.41.0





  parent reply	other threads:[~2023-10-13 15:49 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-13 15:45 [bug#66525] [PATCH 0/7] Remove dependency of polkit, python-dbusmock, etc. on (guix build syscalls) Ludovic Courtès
2023-10-13 15:47 ` [bug#66525] [PATCH 1/7] gnu: mutter: Remove dependency " Ludovic Courtès
2023-10-13 16:49   ` Liliana Marie Prikler
2023-10-14 12:53     ` Maxim Cournoyer
2023-10-14 17:48       ` Ludovic Courtès
2023-10-13 17:05   ` Bruno Victal
2023-10-14 17:48     ` Ludovic Courtès
2023-10-14 12:52   ` Maxim Cournoyer
2023-10-14 17:50     ` Ludovic Courtès
2023-10-15 19:54       ` Maxim Cournoyer
2023-10-16 15:16         ` Ludovic Courtès
2023-10-16 16:19           ` Maxim Cournoyer
2023-10-22 13:43             ` [bug#66525] [PATCH v2 00/10] Remove dependency of polkit, python-dbusmock, etc. " Ludovic Courtès
2023-10-22 13:43               ` [bug#66525] [PATCH v2 01/10] gnu: mutter: Remove dependency " Ludovic Courtès
2023-10-22 13:43               ` [bug#66525] [PATCH v2 02/10] gnu: python-ipykernel: " Ludovic Courtès
2023-10-22 13:43               ` [bug#66525] [PATCH v2 03/10] gnu: python-dbusmock: " Ludovic Courtès
2023-10-22 13:43               ` [bug#66525] [PATCH v2 04/10] gnu: python-dbusmock: Rewrite phases as a gexp Ludovic Courtès
2023-10-22 13:43               ` [bug#66525] [PATCH v2 05/10] gnu: python-dbusmock: Use ‘search-input-file’ Ludovic Courtès
2023-10-22 13:43               ` [bug#66525] [PATCH v2 06/10] gnu: polkit: Remove dependency on (guix build syscalls) Ludovic Courtès
2023-10-22 13:43               ` [bug#66525] [PATCH v2 07/10] gnu: public-inbox: " Ludovic Courtès
2023-10-22 13:43               ` [bug#66525] [PATCH v2 08/10] build-system/ant: " Ludovic Courtès
2023-10-22 13:43               ` [bug#66525] [PATCH v2 09/10] build-system/android-ndk: " Ludovic Courtès
2023-10-22 13:43               ` [bug#66525] [PATCH v2 10/10] build-system/dub: " Ludovic Courtès
2023-10-23  1:54               ` [bug#66525] [PATCH v2 00/10] Remove dependency of polkit, python-dbusmock, etc. " Maxim Cournoyer
2023-10-23 10:09                 ` Ludovic Courtès
2023-10-23 15:12                   ` Maxim Cournoyer
2023-10-13 15:47 ` [bug#66525] [PATCH 2/7] gnu: python-ipykernel: Remove dependency " Ludovic Courtès
2023-10-13 15:47 ` [bug#66525] [PATCH 3/7] gnu: python-dbusmock: " Ludovic Courtès
2023-10-13 15:47 ` Ludovic Courtès [this message]
2023-10-13 15:47 ` [bug#66525] [PATCH 5/7] gnu: python-dbusmock: Use ‘search-input-file’ Ludovic Courtès
2023-10-13 15:47 ` [bug#66525] [PATCH 6/7] gnu: polkit: Remove dependency on (guix build syscalls) Ludovic Courtès
2023-10-13 15:47 ` [bug#66525] [PATCH 7/7] gnu: public-inbox: " Ludovic Courtès
2023-10-14 12:56 ` [bug#66525] [PATCH 0/7] Remove dependency of polkit, python-dbusmock, etc. " Maxim Cournoyer
2023-10-17  8:56 ` Efraim Flashner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0ee0f58bdbe25eeed5bcf4ce52c56e6d6b180bb9.1697211312.git.ludo@gnu.org \
    --to=ludo@gnu.org \
    --cc=66525@debbugs.gnu.org \
    --cc=jgart@dismail.de \
    --cc=lars@6xq.net \
    --cc=marius@gnu.org \
    --cc=me@bonfacemunyoki.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).