unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH 11/12] gnu: python-ipython: Update to 3.2.1.
@ 2015-07-24 14:19 Federico Beffa
  2015-07-25 15:28 ` Alex Kost
  0 siblings, 1 reply; 2+ messages in thread
From: Federico Beffa @ 2015-07-24 14:19 UTC (permalink / raw)
  To: Guix-devel

[-- Attachment #1: Type: text/plain, Size: 371 bytes --]

This now adds support for notebooks and client/server use cases. In
particular it allows use of inline figures as a workaround to the
broken matplotlib Agg3GTK backend (which I was not able to fix).

As a bonus I now reworked the test-suite and, for python 3, I managed
to make them all work, but 1. For python 2 there are more tests
failing which I could not fix.

Fede

[-- Attachment #2: 0011-gnu-python-ipython-Update-to-3.2.1.patch --]
[-- Type: text/x-diff, Size: 7773 bytes --]

From f333188276aca3d058fec048de2cd31cdf71f2bb Mon Sep 17 00:00:00 2001
From: Federico Beffa <beffa@fbengineering.ch>
Date: Thu, 23 Jul 2015 17:48:33 +0200
Subject: [PATCH 11/12] gnu: python-ipython: Update to 3.2.1.

* gnu/packages/python.scm (python-ipython, python2-ipython): Update to 3.2.1.
  Add optional dependencies required for notebooks.
  (python-ipython): Fix and enable tests (1 still failing).
---
 gnu/packages/python.scm | 117 +++++++++++++++++++++++++++++-------------------
 1 file changed, 72 insertions(+), 45 deletions(-)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 8ee7a82..15b9fa5 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -3337,22 +3337,30 @@ cluster without needing to write any wrapper code yourself.")
 (define-public python-ipython
   (package
     (name "python-ipython")
-    (version "2.3.1")
+    (version "3.2.1")
     (source
      (origin
       (method url-fetch)
       (uri (string-append "https://pypi.python.org/packages/source/i/"
                           "ipython/ipython-" version ".tar.gz"))
       (sha256
-       (base32 "1764gi5m3ff481rjk336cw6i2h4zlc0nxam9rc5m8m7yl9m4d61y"))))
+       (base32 "0xwin0sa9n0cabx4cq1ibf5ldsiw5dyimibla82kicz5gbpas4y9"))))
     (build-system python-build-system)
     (outputs '("out" "doc"))
-    ;; FIXME: add optional dependencies when available: pyzmq, tornado, ...
+    (propagated-inputs
+     `(("python-pyzmq" ,python-pyzmq)
+       ("python-terminado" ,python-terminado)))       
     (inputs
      `(("readline" ,readline)
+       ("which" ,which)
        ("python-matplotlib" ,python-matplotlib)
        ("python-numpy" ,python-numpy-bootstrap)
        ("python-numpydoc" ,python-numpydoc)
+       ("python-jinja2" ,python-jinja2)
+       ("python-mistune" ,python-mistune)
+       ("python-jsonschema" ,python-jsonschema)
+       ("python-pygments" ,python-pygments)
+       ("python-requests" ,python-requests) ;; for tests
        ("python-nose" ,python-nose)))
     (native-inputs
      `(("pkg-config" ,pkg-config)
@@ -3362,44 +3370,55 @@ cluster without needing to write any wrapper code yourself.")
        ("python-setuptools" ,python-setuptools)))
     (arguments
      `(#:phases
-       (alist-cons-after
-        'install 'install-doc
-        (lambda* (#:key inputs outputs #:allow-other-keys)
-          (let* ((data (string-append (assoc-ref outputs "doc") "/share"))
-                 (doc (string-append data "/doc/" ,name "-" ,version))
-                 (html (string-append doc "/html"))
-                 (man1 (string-append data "/man/man1"))
-                 (info (string-append data "/info"))
-                 (examples (string-append doc "/examples")))
-            (setenv "LANG" "en_US.UTF-8")
-            (with-directory-excursion "docs"
-              ;; FIXME: html and pdf fail to build without optional pyzmq
-              ;(system* "make" "html")
-              ;(system* "make" "pdf" "PAPER=a4")
-              (system* "make" "info"))
-            (copy-recursively "docs/man" man1)
-            (copy-recursively "examples" examples)
-            ;; (copy-recursively "docs/build/html" html)
-            ;; (copy-file "docs/build/latex/ipython.pdf"
-            ;;            (string-append doc "/ipython.pdf"))
-            (mkdir-p info)
-            (copy-file "docs/build/texinfo/ipython.info"
-                       (string-append info "/ipython.info"))
-            (copy-file "COPYING.rst" (string-append doc "/COPYING.rst"))))
-        ;; Tests can only be run after the library has been installed and not
-        ;; within the source directory.
-        (alist-cons-after
-         'install 'check
-         (lambda* (#:key outputs #:allow-other-keys)
-           ;; The test procedure appears to miss the fact that some optional
-           ;; dependencies are missing.
-           ;; (with-directory-excursion "/tmp"
-           ;;   (zero? (system* (string-append (assoc-ref outputs "out")
-           ;;                                  "/bin/iptest"))))
-           #t)
-         (alist-delete
-          'check
-          %standard-phases)))))
+       (modify-phases %standard-phases
+         (add-after
+          'install 'install-doc
+          (lambda* (#:key inputs outputs #:allow-other-keys)
+            (let* ((data (string-append (assoc-ref outputs "doc") "/share"))
+                   (doc (string-append data "/doc/" ,name "-" ,version))
+                   (html (string-append doc "/html"))
+                   (man1 (string-append data "/man/man1"))
+                   (info (string-append data "/info"))
+                   (examples (string-append doc "/examples")))
+              (setenv "LANG" "en_US.UTF-8")
+              (with-directory-excursion "docs"
+                ;; FIXME: html and pdf fail to build
+                ;; (system* "make" "html")
+                ;; (system* "make" "pdf" "PAPER=a4")
+                (system* "make" "info"))
+              (copy-recursively "docs/man" man1)
+              (copy-recursively "examples" examples)
+              ;; (copy-recursively "docs/build/html" html)
+              ;; (copy-file "docs/build/latex/ipython.pdf"
+              ;;            (string-append doc "/ipython.pdf"))
+              (mkdir-p info)
+              (copy-file "docs/build/texinfo/ipython.info"
+                         (string-append info "/ipython.info"))
+              (copy-file "COPYING.rst" (string-append doc "/COPYING.rst")))))
+         ;; Tests can only be run after the library has been installed and not
+         ;; within the source directory.
+         (delete 'check)
+         (add-after
+          'install 'check
+          (lambda* (#:key outputs tests? #:allow-other-keys)
+            (if tests?
+                (with-directory-excursion "/tmp"
+                  (setenv "HOME" "/tmp/") ;; required by a test
+                  (zero? (system* (string-append (assoc-ref outputs "out")
+                                                 "/bin/iptest"))))
+                #t)))
+         (add-before
+          'install 'fix-tests
+          (lambda* (#:key inputs #:allow-other-keys)
+            (substitute* "./IPython/utils/_process_posix.py"
+              (("/usr/bin/env', 'which") (which "which")))
+            (substitute* "./IPython/core/tests/test_inputtransformer.py"
+              (("#!/usr/bin/env python")
+               (string-append "#!" (which "python"))))
+            ;; Disable 1 failing test
+            (substitute* "./IPython/core/tests/test_magic.py"
+              (("def test_dirops\\(\\):" all)
+               (string-append "@dec.skipif(True)\n" all))))))))
     (home-page "http://ipython.org")
     (synopsis "IPython is a tool for interactive computing in Python")
     (description
@@ -3411,12 +3430,20 @@ computing.")
 
 (define-public python2-ipython
   (let ((ipython (package-with-python2 python-ipython)))
-    (package (inherit ipython)
+    (package
+      (inherit ipython)
+      ;; FIXME: some tests are failing
+      (arguments
+       `(#:tests? #f ,@(package-arguments ipython)))
       ;; Make sure we use custom python2-NAME packages.
+      ;; FIXME: add pyreadline once available.
       (inputs
-       `(("python2-matplotlib" ,python2-matplotlib)
-         ,@(alist-delete "python-matplotlib"
-                         (package-inputs ipython)))))))
+       `(("python2-mock" ,python2-mock)
+         ("python2-matplotlib" ,python2-matplotlib)
+         ("python2-terminado" ,python2-terminado)
+         ,@(alist-delete "python-terminado"
+                         (alist-delete "python-matplotlib"
+                                       (package-inputs ipython))))))))
 
 (define-public python-isodate
   (package
-- 
2.2.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 11/12] gnu: python-ipython: Update to 3.2.1.
  2015-07-24 14:19 [PATCH 11/12] gnu: python-ipython: Update to 3.2.1 Federico Beffa
@ 2015-07-25 15:28 ` Alex Kost
  0 siblings, 0 replies; 2+ messages in thread
From: Alex Kost @ 2015-07-25 15:28 UTC (permalink / raw)
  To: Federico Beffa; +Cc: Guix-devel

Federico Beffa (2015-07-24 17:19 +0300) wrote:

>  (define-public python-ipython
>    (package
>      (name "python-ipython")
> -    (version "2.3.1")
> +    (version "3.2.1")
>      (source
>       (origin
>        (method url-fetch)
>        (uri (string-append "https://pypi.python.org/packages/source/i/"
>                            "ipython/ipython-" version ".tar.gz"))
>        (sha256
> -       (base32 "1764gi5m3ff481rjk336cw6i2h4zlc0nxam9rc5m8m7yl9m4d61y"))))
> +       (base32 "0xwin0sa9n0cabx4cq1ibf5ldsiw5dyimibla82kicz5gbpas4y9"))))
>      (build-system python-build-system)
>      (outputs '("out" "doc"))
> -    ;; FIXME: add optional dependencies when available: pyzmq, tornado, ...
> +    (propagated-inputs
> +     `(("python-pyzmq" ,python-pyzmq)
> +       ("python-terminado" ,python-terminado)))       
spaces--------------------------------------------^^^^^^^

(Sorry, no real comments)

-- 
Alex

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-07-25 15:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-24 14:19 [PATCH 11/12] gnu: python-ipython: Update to 3.2.1 Federico Beffa
2015-07-25 15:28 ` Alex Kost

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).