diff mbox series

[bug#47907,PATCHES] Jupyter Notebook: Enable tests.

Message ID YH6jjE1PqhJGM6E3@noor.fritz.box
State Accepted
Headers show
Series [bug#47907,PATCHES] Jupyter Notebook: Enable tests. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue

Commit Message

Lars-Dominik Braun April 20, 2021, 9:49 a.m. UTC
Hi,

this patch series is mostly a QA patchset and enables tests on most of
Jupyter Notebook’s components. There are also two possibly controversial
changes:

- It moves the definition of JUPYTER_PATH to jupyter-core. I’d argue
  this is the more correct approach, because that package actually deals
  with this search path and installing any Jupyter package makes it work
  out of the box without installing the strange jupyter meta-package.
- It enables pandoc/LaTeX for nbconvert. The Notebook lists PDF output
  in its “Export as” menu and I feel both are useful, even though they
  increase the closure.

You can also pull the patchset here:
https://github.com/PromyLOPh/guix/tree/work-merge-jupyter

Cheers,
Lars

Lars-Dominik Braun (12):
  gnu: Move search path JUPYTER_PATH.
  gnu: python-jupyter-core: Enable tests.
  gnu: Add python-json-spec.
  gnu: Add python-fastjsonschema.
  gnu: python-nbformat: Enable tests.
  gnu: Add python-jupyter-client-bootstrap.
  gnu: Add python-ipykernel-bootstrap.
  gnu: python-jupyter-client: Enable tests.
  gnu: python-ipykernel: Add missing inputs.
  gnu: Add python-pytest-dependency.
  gnu: python-nbconvert: Enable more tests.
  gnu: python-notebook: Fix tests.

 gnu/packages/check.scm      |  23 +++
 gnu/packages/python-xyz.scm | 281 ++++++++++++++++++++++++++++++------
 2 files changed, 256 insertions(+), 48 deletions(-)

Comments

Lars-Dominik Braun April 26, 2021, 8:39 a.m. UTC | #1
Hi,

I merged them with minor modifications based on Ricardo’s suggestions as
2209e5c7531bfe5e81c86f0a581d16569ee9b719 and preceding.
diff mbox series

Patch

From 936b8ad14e8d1ef1b5939a42c5ed8f2b44abd1f1 Mon Sep 17 00:00:00 2001
From: Lars-Dominik Braun <lars@6xq.net>
Date: Tue, 20 Apr 2021 09:51:25 +0200
Subject: [PATCH 08/12] gnu: python-jupyter-client: Enable tests.

* gnu/packages/python-xyz.scm (python-jupyter-client) [arguments]:
Enable tests. Run pytest during 'check.
[native-inputs]: Add missing test inputs.
---
 gnu/packages/python-xyz.scm | 37 ++++++++++++++++++++++++-------------
 1 file changed, 24 insertions(+), 13 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 83d1b956ca..62c61e1c21 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -7437,19 +7437,23 @@  without using the configuration machinery.")
         (base32
          "10p7fcgvv9hvz9zical9wk68ks5ssak2ykbzx65wm1k1hk8a3g64"))))
     (build-system python-build-system)
-    ;; Tests fail because of missing native python kernel which I assume is
-    ;; provided by the ipython package, which we cannot use because it would
-    ;; cause a dependency cycle.
     (arguments
-     `(#:tests? #f
-       #:phases (modify-phases %standard-phases
-                  (add-after 'unpack 'set-tool-file-names
-                    (lambda* (#:key inputs #:allow-other-keys)
-                      (let ((iproute (assoc-ref inputs "iproute")))
-                        (substitute* "jupyter_client/localinterfaces.py"
-                          (("'ip'")
-                           (string-append "'" iproute "/sbin/ip'")))
-                        #t))))))
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'set-tool-file-names
+           (lambda* (#:key inputs #:allow-other-keys)
+             (let ((iproute (assoc-ref inputs "iproute")))
+               (substitute* "jupyter_client/localinterfaces.py"
+                 (("'ip'")
+                  (string-append "'" iproute "/sbin/ip'")))
+               #t)))
+         (replace 'check
+           (lambda* (#:key tests? #:allow-other-keys)
+             (if tests?
+               (begin
+                 ;; Some tests try to write to $HOME.
+                 (setenv "HOME" "/tmp")
+                 (invoke "pytest" "-vv"))))))))
     (inputs
      `(("iproute" ,iproute)))
     (propagated-inputs
@@ -7459,7 +7463,14 @@  without using the configuration machinery.")
        ("python-tornado" ,python-tornado-6)
        ("python-traitlets" ,python-traitlets)))
     (native-inputs
-     `(("python-pytest" ,python-pytest)))
+     `(("python-pytest" ,python-pytest)
+       ("python-pytest-asyncio" ,python-pytest-asyncio)
+       ("python-pytest-timeout" ,python-pytest-timeout)
+       ("python-async-generator" ,python-async-generator)
+       ("python-mock" ,python-mock)
+       ("python-msgpack" ,python-msgpack)
+       ("python-ipython" ,python-ipython)
+       ("python-ipykernel" ,python-ipykernel-bootstrap)))
     (home-page "https://jupyter.org/")
     (synopsis "Jupyter protocol implementation and client libraries")
     (description
-- 
2.26.3