[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
09/09: gnu: python-nbconvert: Simplify build phase.
From: |
guix-commits |
Subject: |
09/09: gnu: python-nbconvert: Simplify build phase. |
Date: |
Tue, 4 May 2021 09:17:51 -0400 (EDT) |
rekado pushed a commit to branch master
in repository guix.
commit 6cd9cb0e133c7f93c7d76e7a39e465d6e9a50b68
Author: Ricardo Wurmus <rekado@elephly.net>
AuthorDate: Tue May 4 15:14:41 2021 +0200
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.
---
gnu/packages/python-xyz.scm | 47 ++++++++++++++++++++-------------------------
1 file changed, 21 insertions(+), 26 deletions(-)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 1cdce86..b6fcbc8 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -10832,34 +10832,29 @@ 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")))
- ;; Use pandoc binary from input.
- (substitute* "nbconvert/utils/pandoc.py"
- (("'pandoc'") (string-append "'" pandoc "'")))
- ;; Same for LaTeX.
- (substitute* "nbconvert/exporters/pdf.py"
- (("\"xelatex\"") (string-append "\"" xelatex "\""))
- (("\"bibtex\"") (string-append "\"" bibtex "\"")))
- ;; Make sure tests are not skipped.
- (substitute* (find-files "." "test_.+\\.py$")
- (("@onlyif_cmds_exist\\(('(pandoc|xelatex)'(, )?)+\\)") ""))
- ;; Pandoc is never missing, disable test.
- (substitute* "nbconvert/utils/tests/test_pandoc.py"
- (("import os" all) (string-append all "\nimport pytest"))
- (("(.+)(def test_pandoc_available)" all indent def)
+ (lambda _
+ ;; Use pandoc binary from input.
+ (substitute* "nbconvert/utils/pandoc.py"
+ (("'pandoc'") (string-append "'" (which "pandoc") "'")))
+ ;; Same for LaTeX.
+ (substitute* "nbconvert/exporters/pdf.py"
+ (("\"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)'(, )?)+\\)") ""))
+ ;; Pandoc is never missing, disable test.
+ (substitute* "nbconvert/utils/tests/test_pandoc.py"
+ (("import os" all) (string-append all "\nimport pytest"))
+ (("(.+)(def test_pandoc_available)" all indent def)
(string-append indent "@pytest.mark.skip('disabled by guix')\n"
indent def)))
- ; 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)
+ ;; 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?
@@ -10869,7 +10864,7 @@ time.")
(unsetenv "JUPYTER_CONFIG_DIR")
;; Tests depend on templates installed to output.
(setenv "JUPYTER_PATH"
- (string-append
+ (string-append
(assoc-ref outputs "out")
"/share/jupyter:"
(getenv "JUPYTER_PATH")))
- branch master updated (7ca996c -> 6cd9cb0), guix-commits, 2021/05/04
- 01/09: gnu: Add texlive-titling., guix-commits, 2021/05/04
- 04/09: gnu: Add texlive-collectbox., guix-commits, 2021/05/04
- 03/09: gnu: Add texlive-storebox., guix-commits, 2021/05/04
- 02/09: gnu: Add texlive-ifoddpage., guix-commits, 2021/05/04
- 05/09: gnu: Add texlive-adjustbox., guix-commits, 2021/05/04
- 06/09: gnu: Add texlive-tcolorbox., guix-commits, 2021/05/04
- 07/09: gnu: Add texlive-eurosym., guix-commits, 2021/05/04
- 09/09: gnu: python-nbconvert: Simplify build phase.,
guix-commits <=
- 08/09: gnu: python-nbconvert: Use modular texlive packages., guix-commits, 2021/05/04