diff options
author | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2022-01-18 10:02:11 -0500 |
---|---|---|
committer | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2022-01-18 10:10:27 -0500 |
commit | 719deaa8813e33261c3da6f407c5ef109e5f5e92 (patch) | |
tree | eb47630dffa1204ca2cdffaf22da5497948d04b7 /gnu | |
parent | 5ed33b0d05902de921e972d41168910107c93515 (diff) | |
download | guix-719deaa8813e33261c3da6f407c5ef109e5f5e92.tar.gz guix-719deaa8813e33261c3da6f407c5ef109e5f5e92.zip |
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).
Diffstat (limited to 'gnu')
-rw-r--r-- | gnu/packages/python-xyz.scm | 39 |
1 files 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 |