Patchwork [3/3] gnu: python2-notebook: Fix build.

login
register
mail settings
Submitter Hartmut Goebel
Date Dec. 5, 2016, 12:21 p.m.
Message ID <1480940465-15430-3-git-send-email-h.goebel@crazy-compilers.com>
Download mbox | patch
Permalink /patch/18186/
State New
Headers show

Comments

Hartmut Goebel - Dec. 5, 2016, 12:21 p.m.
* gnu/packages/python.scm (python2-notebook)[properties]: Add
python2-variant.
(python2-notebook)[native-packages] add python2-mock. [arguments] Add
phase "disable-test-case" for disabling a failing test. immediately
---
 gnu/packages/python.scm | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)
Leo Famulari - Dec. 5, 2016, 9:44 p.m.
On Mon, Dec 05, 2016 at 01:21:05PM +0100, Hartmut Goebel wrote:
> * gnu/packages/python.scm (python2-notebook)[properties]: Add
> python2-variant.
> (python2-notebook)[native-packages] add python2-mock. [arguments] Add
> phase "disable-test-case" for disabling a failing test. immediately

s/ immediately//

>  (define-public python2-notebook
> -  (package-with-python2 python-notebook))
> +  (let ((base (package-with-python2
> +                (strip-python2-variant python-notebook))))
> +    (package (inherit base)
> +      (native-inputs
> +       `(("python2-mock" ,python2-mock)
> +         ,@(package-native-inputs base)))
> +      (arguments
> +       (substitute-keyword-arguments (package-arguments base)
> +         ((#:phases phases)
> +          `(modify-phases ,phases
> +             (add-before 'check 'disable-test-case
> +              ;; The test requires network access to localhost. Curiously it
> +              ;; files with Python 2 only. Simply make the test-case return

s/files/fails

Otherwise LGTM, thanks! I was just noticing this issue :)
Hartmut Goebel - Dec. 6, 2016, 10:31 a.m.
Am 05.12.2016 um 22:44 schrieb Leo Famulari:

> Otherwise LGTM, thanks! 

Push all three with you comments resolved. Thanks for reviewing.

> I was just noticing this issue :) 

:-)

Patch

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 66c297c..7556858 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -6864,10 +6864,28 @@  convert an @code{.ipynb} notebook file into various static formats including:
     (description
      "The Jupyter HTML notebook is a web-based notebook environment for
 interactive computing.")
+    (properties `((python2-variant . ,(delay python2-notebook))))
     (license license:bsd-3)))
 
 (define-public python2-notebook
-  (package-with-python2 python-notebook))
+  (let ((base (package-with-python2
+                (strip-python2-variant python-notebook))))
+    (package (inherit base)
+      (native-inputs
+       `(("python2-mock" ,python2-mock)
+         ,@(package-native-inputs base)))
+      (arguments
+       (substitute-keyword-arguments (package-arguments base)
+         ((#:phases phases)
+          `(modify-phases ,phases
+             (add-before 'check 'disable-test-case
+              ;; The test requires network access to localhost. Curiously it
+              ;; files with Python 2 only. Simply make the test-case return
+              ;; immediately.
+              (lambda _
+                (substitute*
+                    "notebook/services/nbconvert/tests/test_nbconvert_api.py"
+                  (("formats = self.nbconvert_api") "return #")))))))))))
 
 (define-public python-widgetsnbextension
   (package