gnu: python-nbconvert: Simplify build phase.
* gnu/packages/python-xyz.scm (python-nbconvert)[arguments]: Simplify build phase "fix-paths-and-tests" by using WHICH; remove final boolean and reindent.master
parent
82c5d929b9
commit
6cd9cb0e13
|
@ -10832,18 +10832,14 @@ time.")
|
|||
`(#:phases
|
||||
(modify-phases %standard-phases
|
||||
(add-after 'unpack 'fix-paths-and-tests
|
||||
(lambda* (#:key inputs outputs #:allow-other-keys)
|
||||
(let* ((pandoc (string-append (assoc-ref inputs "pandoc") "/bin/pandoc"))
|
||||
(texlive-root (string-append (assoc-ref inputs "texlive")))
|
||||
(xelatex (string-append texlive-root "/bin/xelatex"))
|
||||
(bibtex (string-append texlive-root "/bin/bibtex")))
|
||||
(lambda _
|
||||
;; Use pandoc binary from input.
|
||||
(substitute* "nbconvert/utils/pandoc.py"
|
||||
(("'pandoc'") (string-append "'" pandoc "'")))
|
||||
(("'pandoc'") (string-append "'" (which "pandoc") "'")))
|
||||
;; Same for LaTeX.
|
||||
(substitute* "nbconvert/exporters/pdf.py"
|
||||
(("\"xelatex\"") (string-append "\"" xelatex "\""))
|
||||
(("\"bibtex\"") (string-append "\"" bibtex "\"")))
|
||||
(("\"xelatex\"") (string-append "\"" (which "xelatex") "\""))
|
||||
(("\"bibtex\"") (string-append "\"" (which "bibtex") "\"")))
|
||||
;; Make sure tests are not skipped.
|
||||
(substitute* (find-files "." "test_.+\\.py$")
|
||||
(("@onlyif_cmds_exist\\(('(pandoc|xelatex)'(, )?)+\\)") ""))
|
||||
|
@ -10853,13 +10849,12 @@ time.")
|
|||
(("(.+)(def test_pandoc_available)" all indent def)
|
||||
(string-append indent "@pytest.mark.skip('disabled by guix')\n"
|
||||
indent def)))
|
||||
; Not installing pyppeteer, delete test.
|
||||
;; Not installing pyppeteer, delete test.
|
||||
(delete-file "nbconvert/exporters/tests/test_webpdf.py")
|
||||
(substitute* "nbconvert/tests/test_nbconvertapp.py"
|
||||
(("(.+)(def test_webpdf_with_chromium)" all indent def)
|
||||
(string-append indent "@pytest.mark.skip('disabled by guix')\n"
|
||||
indent def)))
|
||||
#t)))
|
||||
indent def)))))
|
||||
(replace 'check
|
||||
(lambda* (#:key tests? inputs outputs #:allow-other-keys)
|
||||
(when tests?
|
||||
|
|
Reference in New Issue