guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: gnu: python-dbusmock: Update to 0.25.0 and reap t


From: guix-commits
Subject: branch master updated: gnu: python-dbusmock: Update to 0.25.0 and reap terminated processes.
Date: Tue, 18 Jan 2022 10:11:43 -0500

This is an automated email from the git hooks/post-receive script.

apteryx pushed a commit to branch master
in repository guix.

The following commit(s) were added to refs/heads/master by this push:
     new 719deaa881 gnu: python-dbusmock: Update to 0.25.0 and reap terminated 
processes.
719deaa881 is described below

commit 719deaa8813e33261c3da6f407c5ef109e5f5e92
Author: Maxim Cournoyer <maxim.cournoyer@gmail.com>
AuthorDate: Tue Jan 18 10:02:11 2022 -0500

    gnu: python-dbusmock: Update to 0.25.0 and reap terminated processes.
    
    It was reported by abrenon and zimoun in #guix that python-dbusmock would 
fail
    to build on their systems.
    
    * gnu/packages/python-xyz.scm (python-dbusmock)
    [imported-modules, modules]: New arguments.
    [native-inputs]: Use new style.
    [phases]{check}: Override phase to run it via a dumb init that can handle
    signals and reap dead processes correctly.  This prevents test suite 
failures
    in some cases (though it is still unknown why it was working on some systems
    and not on others before the change).
---
 gnu/packages/python-xyz.scm | 39 ++++++++++++++++++++++++++++++---------
 1 file changed, 30 insertions(+), 9 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index edb2937c5f..2c93c80138 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -52,7 +52,7 @@
 ;;; Copyright © 2018, 2019, 2020, 2021 Nicolas Goaziou <mail@nicolasgoaziou.fr>
 ;;; Copyright © 2018 Oleg Pykhalov <go.wigust@gmail.com>
 ;;; Copyright © 2018, 2019, 2021 Clément Lassieur <clement@lassieur.org>
-;;; Copyright © 2018, 2019, 2020, 2021 Maxim Cournoyer 
<maxim.cournoyer@gmail.com>
+;;; Copyright © 2018, 2019, 2020, 2021, 2022 Maxim Cournoyer 
<maxim.cournoyer@gmail.com>
 ;;; Copyright © 2018 Luther Thompson <lutheroto@gmail.com>
 ;;; Copyright © 2018 Vagrant Cascadian <vagrant@debian.org>
 ;;; Copyright © 2015, 2018 Pjotr Prins <pjotr.guix@thebird.nl>
@@ -24101,17 +24101,23 @@ for YAML and JSON.")
 (define-public python-dbusmock
   (package
     (name "python-dbusmock")
-    (version "0.24.1")
+    (version "0.25.0")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "python-dbusmock" version))
        (sha256
         (base32
-         "0kvjwn5sdp3rqcbclvxljkmk988l12dvppzfn3ldy3jxbyyn1mjn"))))
+         "1nwl0gzzds2g1w1gfxfzlgrkb5hr1rrdyn619ml25c6b1rjyfk3g"))))
     (build-system python-build-system)
     (arguments
-     '(#:phases
+     `(#:imported-modules (,@%python-build-system-modules
+                           (guix build syscalls))
+       #:modules ((guix build python-build-system)
+                  (guix build syscalls)
+                  (guix build utils)
+                  (ice-9 match))
+       #:phases
        (modify-phases %standard-phases
          (add-after 'unpack 'patch-paths
            (lambda* (#:key inputs #:allow-other-keys)
@@ -24120,11 +24126,26 @@ for YAML and JSON.")
              (substitute* "dbusmock/testcase.py"
                (("'dbus-daemon'")
                 (string-append "'" (assoc-ref inputs "dbus")
-                               "/bin/dbus-daemon'"))))))))
-    (native-inputs
-     (list ;; For tests.
-           dbus ; for dbus-daemon
-           python-nose which))
+                               "/bin/dbus-daemon'")))))
+         (replace 'check
+           (lambda* (#:key tests? #:allow-other-keys)
+             (when tests?
+               (match (primitive-fork)
+                 (0                     ;child process
+                  (set-child-subreaper!)
+                  ;; Use tini so that signals are properly handled and
+                  ;; doubly-forked processes get reaped; otherwise,
+                  ;; python-dbusmock would waste time polling for the dbus
+                  ;; processes it spawns to be reaped, in vain.
+                  (execlp "tini" "--" "pytest" "-vv"))
+                 (pid
+                  (match (waitpid pid)
+                    ((_ . status)
+                     (unless (zero? status)
+                       (error "`pytest' exited with status"
+                              status))))))))))))
+    (native-inputs
+     (list dbus python-pytest tini which))
     (inputs
      (list dbus))
     (propagated-inputs



reply via email to

[Prev in Thread] Current Thread [Next in Thread]