summary refs log tree commit diff
path: root/gnu
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2021-04-13 08:35:46 +0200
committerRicardo Wurmus <rekado@elephly.net>2021-04-13 13:41:17 +0200
commitf4af353cb2d3d98fe2c581fa95815b0c4e4a9cbc (patch)
tree3a6de6b185eea92a84806b0fb0cedd479b443fc3 /gnu
parent74d2d7a322ecf0013005491a77d91ebb21d11767 (diff)
downloadguix-f4af353cb2d3d98fe2c581fa95815b0c4e4a9cbc.tar.gz
gnu: python-nbconvert: Update to 6.0.7.
* gnu/packages/python-xyz.scm (python-nbconvert): Update to 6.0.7.
[arguments]: Remove configure flags, enable tests, override check phase.
[propagated-inputs]: Add python-defusedxml, python-nbclient,
python-pandocfilters, python-jupyterlab-pygments, and python-testpath.
[properties]: Add python2-variant.
(python2-nbconvert): Override version, source, arguments, and
propagated-inputs.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/python-xyz.scm78
1 files changed, 64 insertions, 14 deletions
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 67b2172e91..b8344dc695 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -151,6 +151,7 @@
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages image)
   #:use-module (gnu packages imagemagick)
+  #:use-module (gnu packages jupyter)
   #:use-module (gnu packages kerberos)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages libffi)
@@ -10362,36 +10363,57 @@ time.")
 (define-public python-nbconvert
   (package
     (name "python-nbconvert")
-    (version "5.0.0b1")
+    (version "6.0.7")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "nbconvert" version))
        (sha256
         (base32
-         "0brclbb18l4nmd5qy3dl9wn05rjdh1fz4rmzdlfqacj12rcdvdgp"))))
+         "00lhqaxn481qvk2w5568asqlsnvrw2fm61p1vssx3m7vdnl17g6b"))))
     (build-system python-build-system)
     (arguments
-     `(;; The "bdist_egg" target is disabled by default, causing the installation
-       ;; to fail.
-       #:configure-flags (list "bdist_egg")
-       ;; FIXME: 5 failures, 40 errors.
-       #:tests? #f))
-       ;; #:phases
-       ;; (modify-phases %standard-phases
-       ;;   (replace 'check
-       ;;     (lambda _
-       ;;       (zero? (system* "py.test" "-v")))))
+     `(#:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda* (#:key tests? inputs outputs #:allow-other-keys)
+             (when tests?
+               (add-installed-pythonpath inputs outputs)
+
+               ;; This seems to require Chromium.
+               (delete-file "nbconvert/exporters/tests/test_webpdf.py")
+
+               ;; This depends on the python3 kernel, which is provided by a
+               ;; package that depends on nbconvert.
+               (delete-file "nbconvert/preprocessors/tests/test_execute.py")
+
+               ;; Most of these tests fail because nbconvert fails to execute
+               ;; itself.
+               (delete-file "nbconvert/tests/test_nbconvertapp.py")
+
+               ;; One test here fails with an unclear error.  It looks like
+               ;; "%%pylabprint" is supposed to be expanded to some other
+               ;; code, but isn't.
+               (delete-file "nbconvert/filters/tests/test_strings.py")
+               
+               ;; Some tests need HOME
+               (setenv "HOME" "/tmp")
+               (invoke "pytest")))))))
     (native-inputs
      `(("python-pytest" ,python-pytest)))
     (propagated-inputs
      `(("python-bleach" ,python-bleach)
+       ("python-defusedxml" ,python-defusedxml)
        ("python-entrypoints" ,python-entrypoints)
        ("python-jinja2" ,python-jinja2)
        ("python-jupyter-core" ,python-jupyter-core)
        ("python-mistune" ,python-mistune)
+       ("python-nbclient" ,python-nbclient)
        ("python-nbformat" ,python-nbformat)
+       ("python-pandocfilters" ,python-pandocfilters)
        ("python-pygments" ,python-pygments)
+       ("python-jupyterlab-pygments" ,python-jupyterlab-pygments)
+       ("python-testpath" ,python-testpath)
        ("python-traitlets" ,python-traitlets)))
     (home-page "https://jupyter.org")
     (synopsis "Converting Jupyter Notebooks")
@@ -10408,10 +10430,38 @@ convert an @code{.ipynb} notebook file into various static formats including:
 @item ReStructured Text (rst)
 @item executable script
 @end enumerate\n")
-    (license license:bsd-3)))
+    (license license:bsd-3)
+    (properties `((python2-variant . ,(delay python2-nbconvert))))))
 
 (define-public python2-nbconvert
-  (package-with-python2 python-nbconvert))
+  (let ((parent
+         (package-with-python2
+          (strip-python2-variant python-nbconvert))))
+    (package
+      (inherit parent)
+      (version "5.0.0b1")
+      (source
+       (origin
+         (method url-fetch)
+         (uri (pypi-uri "nbconvert" version))
+         (sha256
+          (base32
+           "0brclbb18l4nmd5qy3dl9wn05rjdh1fz4rmzdlfqacj12rcdvdgp"))))
+      (arguments
+       `(;; The "bdist_egg" target is disabled by default, causing the installation
+         ;; to fail.
+         #:configure-flags (list "bdist_egg")
+         ;; FIXME: 5 failures, 40 errors.
+         #:tests? #f))
+      (propagated-inputs
+       `(("python-bleach" ,python-bleach)
+         ("python-entrypoints" ,python-entrypoints)
+         ("python-jinja2" ,python-jinja2)
+         ("python-jupyter-core" ,python-jupyter-core)
+         ("python-mistune" ,python-mistune)
+         ("python-nbformat" ,python-nbformat)
+         ("python-pygments" ,python-pygments)
+         ("python-traitlets" ,python-traitlets))))))
 
 (define-public python-notebook
   (package