summary refs log tree commit diff
path: root/pkgs/shells/ipython
diff options
context:
space:
mode:
authorBjørn Forsman <bjorn.forsman@gmail.com>2013-03-27 13:35:39 +0100
committerBjørn Forsman <bjorn.forsman@gmail.com>2013-03-27 15:39:03 +0100
commit25c49767f33d63a018594c6e26536ad4805e08dc (patch)
tree91bae8df59d4016c81efae256ba8f7d10f2d52e7 /pkgs/shells/ipython
parent66969547a28202f3e5ddf48de41fa3b06dea7485 (diff)
downloadnixlib-25c49767f33d63a018594c6e26536ad4805e08dc.tar
nixlib-25c49767f33d63a018594c6e26536ad4805e08dc.tar.gz
nixlib-25c49767f33d63a018594c6e26536ad4805e08dc.tar.bz2
nixlib-25c49767f33d63a018594c6e26536ad4805e08dc.tar.lz
nixlib-25c49767f33d63a018594c6e26536ad4805e08dc.tar.xz
nixlib-25c49767f33d63a018594c6e26536ad4805e08dc.tar.zst
nixlib-25c49767f33d63a018594c6e26536ad4805e08dc.zip
ipython: modularize and enable more features
Add these new attributes (all default to true):

  notebookSupport
  qtconsoleSupport
  pylabSupport
  pylabQtSupport

This adds jinja2, matplotlib, pyqt4 and sip as new dependencies of
ipython.

This commit fixes "ipython --pylab" so that it no more errors out with
"ImportError: No module named matplotlib" (which was my initial goal).
Diffstat (limited to 'pkgs/shells/ipython')
-rw-r--r--pkgs/shells/ipython/default.nix33
1 files changed, 31 insertions, 2 deletions
diff --git a/pkgs/shells/ipython/default.nix b/pkgs/shells/ipython/default.nix
index 1b3177bd23ae..82ca13185b3c 100644
--- a/pkgs/shells/ipython/default.nix
+++ b/pkgs/shells/ipython/default.nix
@@ -1,4 +1,16 @@
-{ stdenv, fetchurl, buildPythonPackage, pythonPackages }:
+{ stdenv, fetchurl, buildPythonPackage, pythonPackages, pyqt4 ? null, sip ? null
+, notebookSupport ? true   # ipython notebook
+, qtconsoleSupport ? true  # ipython qtconsole
+, pylabSupport ? true      # ipython --pylab    (backend: agg - no gui, just file)
+, pylabQtSupport ? true    # ipython --pylab=qt (backend: Qt4Agg - plot to window)
+}:
+
+# ipython qtconsole works with both pyside and pyqt4. But ipython --pylab=qt
+# only works with pyqt4 (at least this is true for ipython 0.13.1). So just use
+# pyqt4 for both.
+
+assert qtconsoleSupport == true -> pyqt4 != null;
+assert pylabQtSupport == true -> pyqt4 != null && sip != null;
 
 buildPythonPackage rec {
   name = "ipython-0.13.1";
@@ -9,7 +21,24 @@ buildPythonPackage rec {
     sha256 = "1h7q2zlyfn7si2vf6gnq2d0krkm1f5jy5nbi105by7zxqjai1grv";
   };
 
-  propagatedBuildInputs = [ pythonPackages.readline pythonPackages.sqlite3 pythonPackages.tornado pythonPackages.pyzmq ];
+  propagatedBuildInputs = [
+    pythonPackages.readline
+    pythonPackages.sqlite3  # required for history support
+  ] ++ stdenv.lib.optionals notebookSupport [
+    pythonPackages.tornado
+    pythonPackages.pyzmq
+    pythonPackages.jinja2
+  ] ++ stdenv.lib.optionals qtconsoleSupport [
+    pythonPackages.pygments
+    pythonPackages.pyzmq
+    pyqt4
+  ] ++ stdenv.lib.optionals pylabSupport [
+    pythonPackages.matplotlib
+  ] ++ stdenv.lib.optionals pylabQtSupport [
+    pythonPackages.matplotlib
+    pyqt4
+    sip
+  ];
 
   doCheck = false;