gnu: python-pysam: Run tests before installation.

* gnu/packages/bioinformatics.scm (python-pysam)[arguments]: Adjust check
phase to be run before installation.
This commit is contained in:
Ricardo Wurmus 2017-03-22 12:18:59 +01:00
parent 9488776a18
commit 611154efc8
No known key found for this signature in database
GPG Key ID: 197A5888235FACAC
1 changed files with 15 additions and 13 deletions

View File

@ -1430,7 +1430,11 @@ multiple sequence alignments.")
'(delete-file-recursively "htslib")))) '(delete-file-recursively "htslib"))))
(build-system python-build-system) (build-system python-build-system)
(arguments (arguments
`(#:phases `(#:modules ((ice-9 ftw)
(srfi srfi-26)
(guix build python-build-system)
(guix build utils))
#:phases
(modify-phases %standard-phases (modify-phases %standard-phases
(add-before 'build 'set-flags (add-before 'build 'set-flags
(lambda* (#:key inputs #:allow-other-keys) (lambda* (#:key inputs #:allow-other-keys)
@ -1442,23 +1446,21 @@ multiple sequence alignments.")
(setenv "LDFLAGS" "-lncurses") (setenv "LDFLAGS" "-lncurses")
(setenv "CFLAGS" "-D_CURSES_LIB=1") (setenv "CFLAGS" "-D_CURSES_LIB=1")
#t)) #t))
(delete 'check) (replace 'check
(add-after 'install 'check
(lambda* (#:key inputs outputs #:allow-other-keys) (lambda* (#:key inputs outputs #:allow-other-keys)
;; Add first subdirectory of "build" directory to PYTHONPATH.
(setenv "PYTHONPATH" (setenv "PYTHONPATH"
(string-append (string-append
(getenv "PYTHONPATH") (getenv "PYTHONPATH")
":" (assoc-ref outputs "out") ":" (getcwd) "/build/"
"/lib/python" (car (scandir "build"
(string-take (string-take-right (compose not (cut string-prefix? "." <>))))))
(assoc-ref inputs "python") 5) 3)
"/site-packages"))
;; Step out of source dir so python does not import from CWD. ;; Step out of source dir so python does not import from CWD.
(chdir "tests") (with-directory-excursion "tests"
(setenv "HOME" "/tmp") (setenv "HOME" "/tmp")
(and (zero? (system* "make" "-C" "pysam_data")) (and (zero? (system* "make" "-C" "pysam_data"))
(zero? (system* "make" "-C" "cbcf_data")) (zero? (system* "make" "-C" "cbcf_data"))
(zero? (system* "nosetests" "-v")))))))) (zero? (system* "nosetests" "-v")))))))))
(propagated-inputs (propagated-inputs
`(("htslib" ,htslib))) ; Included from installed header files. `(("htslib" ,htslib))) ; Included from installed header files.
(inputs (inputs