From 6fa27ee0f44d786132cfba4705ffdf8432512184 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Tue, 18 Mar 2025 15:52:33 +0100 Subject: [PATCH] gnu: python-pysam: Update to 0.23.0. * gnu/packages/bioinformatics.scm (python-pysam): Update to 0.23.0. [arguments]: Use #:test-flags instead of custom 'check phase; add 'pre-check phase. Change-Id: I92c715d5dfd5cbdbcf6dd61fc5e472f6c6ca977d --- gnu/packages/bioinformatics.scm | 51 ++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 23 deletions(-) diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm index 489c3b70986113ad04eac97e9f7142be631eba66..bcdee9c8a24fc080b5f2509d8e55b1d709237081 100644 --- a/gnu/packages/bioinformatics.scm +++ b/gnu/packages/bioinformatics.scm @@ -5473,7 +5473,7 @@ subgroups.") (define-public python-pysam (package (name "python-pysam") - (version "0.20.0") + (version "0.23.0") (source (origin (method git-fetch) ;; Test data is missing on PyPi. @@ -5483,34 +5483,39 @@ subgroups.") (file-name (git-file-name name version)) (sha256 (base32 - "1dq6jwwm98lm30ijdgqc5xz5ppda4nj999y6qs78mhw8x0kij8gg")) + "0hk0ks6kqsm8252d0v1lw2d22x1awmxcr165nnhyacwbqh246skl")) (modules '((guix build utils))) (snippet '(begin ;; FIXME: Unbundle samtools and bcftools. (delete-file-recursively "htslib"))))) (build-system pyproject-build-system) (arguments - `(#:phases - (modify-phases %standard-phases - (add-before 'build 'set-flags - (lambda* (#:key inputs #:allow-other-keys) - (setenv "HTSLIB_MODE" "external") - (setenv "HTSLIB_LIBRARY_DIR" - (string-append (assoc-ref inputs "htslib") "/lib")) - (setenv "HTSLIB_INCLUDE_DIR" - (string-append (assoc-ref inputs "htslib") "/include")) - (setenv "LDFLAGS" "-lncurses") - (setenv "CFLAGS" "-D_CURSES_LIB=1"))) - (replace 'check - (lambda* (#:key tests? #:allow-other-keys) - (when tests? - ;; Step out of source dir so python does not import from CWD. - (with-directory-excursion "tests" - (setenv "HOME" "/tmp") - (invoke "make" "-C" "pysam_data") - (invoke "make" "-C" "cbcf_data") - ;; The FileHTTP test requires network access. - (invoke "pytest" "-k" "not FileHTTP")))))))) + (list + #:test-flags + ;; This test requires network access. + '(list "-k" "not FileHTTP" "tests") + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'patch-build-system + (lambda _ + (substitute* "pyproject.toml" + ((":__legacy__") "")))) + (add-before 'build 'set-flags + (lambda* (#:key inputs #:allow-other-keys) + (setenv "HTSLIB_MODE" "external") + (setenv "HTSLIB_LIBRARY_DIR" + (string-append (assoc-ref inputs "htslib") "/lib")) + (setenv "HTSLIB_INCLUDE_DIR" + (string-append (assoc-ref inputs "htslib") "/include")) + (setenv "LDFLAGS" "-lncurses") + (setenv "CFLAGS" "-D_CURSES_LIB=1"))) + (add-before 'check 'pre-check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (with-directory-excursion "tests" + (setenv "HOME" "/tmp") + (invoke "make" "-C" "pysam_data") + (invoke "make" "-C" "cbcf_data")))))))) (propagated-inputs (list htslib)) ; Included from installed header files. (inputs