From 3eaad37aa5bbc32c9c5d88b9a77d01a3086b3158 Mon Sep 17 00:00:00 2001 From: Nicolas Graves Date: Sun, 21 Dec 2025 20:27:37 +0100 Subject: [PATCH] gnu: gourmet: Switch to pyproject. * gnu/packages/nutrition.scm (gourmet): [build-system]: Switch to pyproject-build-system. [arguments]<#:modules>: Drop them. <#:test-flags>: Set them. <#:phases>: Drop 'check phase replacement. Rename phase 'prepare-x to 'configure-tests. [native-inputs]: Add python-setuptools. Change-Id: I466ddf84a8e92680f7957717f4e08cf4c4e02efa Signed-off-by: Sharlatan Hellseher --- gnu/packages/nutrition.scm | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/gnu/packages/nutrition.scm b/gnu/packages/nutrition.scm index 51d326a84880d77b4bc2bb70135610ba9e7d0b29..6a8894241f858a9fad51cb76b0454b761c517542 100644 --- a/gnu/packages/nutrition.scm +++ b/gnu/packages/nutrition.scm @@ -100,32 +100,20 @@ in the @url{https://schema.org/Recipe} format.") (base32 "08fbw6zp32ws6w9czwy2sqc9c9izlkglsskshj2114d0l79z4gj8")) (patches (search-patches "gourmet-sqlalchemy-compat.patch")))) - (build-system python-build-system) + (build-system pyproject-build-system) (arguments (list - #:modules `((guix build utils) - (guix build python-build-system) - (ice-9 ftw) - (srfi srfi-26)) + #:test-flags + ;; XXX: Some tests in deeper directories or otherwise discovered by + ;; Pytest are broken. + #~(list "--ignore-glob=gourmet/tests/**/*.py") #:phases #~(modify-phases %standard-phases - (add-before 'check 'prepare-x - ;; Both the tests and the sanity-check phase need an X server to - ;; succeed. + (add-before 'check 'configure-tests (lambda _ + (setenv "HOME" "/tmp") ;needed by tests (system "Xvfb &") (setenv "DISPLAY" ":0"))) - (replace 'check - (lambda* (#:key tests? #:allow-other-keys) - (when tests? - (setenv "HOME" "/tmp") ;needed by tests - (apply invoke "pytest" "-vv" - ;; XXX: This is needed because some tests in deeper - ;; directories or otherwise discovered by Pytest are - ;; broken. - (map (cut string-append "gourmet/tests/" <>) - (scandir "gourmet/tests" - (cut string-prefix? "test_" <>))))))) (add-after 'install 'install-dekstop-file-and-icons (lambda _ (define share (string-append #$output "/share")) @@ -137,6 +125,7 @@ in the @url{https://schema.org/Recipe} format.") (list python-dogtail python-pytest python-selenium + python-setuptools xorg-server-for-tests)) (inputs (list gtk+