Hi,

This hopefully should be a pretty straightforward patch, but I just wanted to check that I was doing the correct thing this first time. Seems to make the code much cleaner.

Does it make sense to go through all the python packages and convert them all to the python2-variant style? As I understand the idea is to do this one package per commit, which means traversing python dependency graph? Is anyone on this?

Thanks,
ben
>From 86d94c052a0ff755e28fbd970b71f87dbba022af Mon Sep 17 00:00:00 2001
From: Ben Woodcroft <donttrust...@gmail.com>
Date: Sat, 16 Apr 2016 23:10:26 +1000
Subject: [PATCH] gnu: python-ipython: Use 'python2-variant'.

* gnu/packages/python.scm (python-ipython)[properties]: New field.
(python2-ipython): Use 'strip-python2-variant'.
---
 gnu/packages/python.scm | 28 ++++++++++------------------
 1 file changed, 10 insertions(+), 18 deletions(-)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 4238965..e6fa127 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -12,7 +12,7 @@
 ;;; Copyright © 2015 Eric Dvorsak <e...@dvorsak.fr>
 ;;; Copyright © 2015, 2016 David Thompson <da...@gnu.org>
 ;;; Copyright © 2015, 2016 Leo Famulari <l...@famulari.name>
-;;; Copyright © 2015 Ben Woodcroft <donttrust...@gmail.com>
+;;; Copyright © 2015, 2016 Ben Woodcroft <donttrust...@gmail.com>
 ;;; Copyright © 2015, 2016 Erik Edrosa <erik.edr...@gmail.com>
 ;;; Copyright © 2015, 2016 Efraim Flashner <efr...@flashner.co.il>
 ;;; Copyright © 2015 Kyle Meyer <k...@kyleam.com>
@@ -4357,29 +4357,21 @@ without using the configuration machinery.")
 Powerful interactive shells, a browser-based notebook, support for interactive
 data visualization, embeddable interpreters and tools for parallel
 computing.")
-    (license bsd-3)))
+    (license bsd-3)
+    (properties `((python2-variant . ,(delay python2-ipython))))))
 
 (define-public python2-ipython
-  (let ((ipython (package-with-python2 python-ipython)))
+  (let ((parent (package-with-python2
+                 (strip-python2-variant python-ipython))))
     (package
-      (inherit ipython)
+      (inherit parent)
       ;; FIXME: some tests are failing
-      (arguments
-       `(#:tests? #f ,@(package-arguments ipython)))
-      ;; Make sure we use custom python2-NAME packages.
       ;; FIXME: add pyreadline once available.
-      (propagated-inputs
-       `(("python2-terminado" ,python2-terminado)
-         ,@(alist-delete "python-terminado"
-                         (package-propagated-inputs ipython))))
+      (arguments
+       `(#:tests? #f ,@(package-arguments parent)))
       (inputs
-       `(("python2-jsonschema" ,python2-jsonschema)
-         ("python2-mock" ,python2-mock)
-         ("python2-matplotlib" ,python2-matplotlib)
-         ("python2-numpy" ,python2-numpy)
-         ("python2-requests" ,python2-requests)
-         ,@(fold alist-delete (package-inputs ipython)
-                 '("python-jsonschema" "python-matplotlib" "python-numpy" "python-requests")))))))
+       `(("python2-mock" ,python2-mock)
+         ,@(package-inputs parent))))))
 
 (define-public python-isodate
   (package
-- 
2.6.3

Reply via email to