1{ lib
2, stdenv
3, buildPythonPackage
4, fetchPypi
5, fetchpatch
6# Build dependencies
7, glibcLocales
8# Test dependencies
9, nose
10, pygments
11, testpath
12, isPy27
13, mock
14# Runtime dependencies
15, backports_shutil_get_terminal_size
16, decorator
17, pathlib2
18, pickleshare
19, requests
20, simplegeneric
21, traitlets
22, prompt-toolkit
23, pexpect
24, appnope
25}:
26
27buildPythonPackage rec {
28 pname = "ipython";
29 version = "5.8.0";
30
31 src = fetchPypi {
32 inherit pname version;
33 sha256 = "4bac649857611baaaf76bc82c173aa542f7486446c335fe1a6c05d0d491c8906";
34 };
35
36 prePatch = lib.optionalString stdenv.isDarwin ''
37 substituteInPlace setup.py --replace "'gnureadline'" " "
38 '';
39
40 patches = [
41 # Use the proper pygments lexer for python2 (https://github.com/ipython/ipython/pull/12095)
42 (fetchpatch {
43 name = "python2-lexer.patch";
44 url = "https://github.com/ipython/ipython/pull/12095/commits/8805293b5e4bce9150cc2ad9c5d6d984849ae447.patch";
45 sha256 = "16p4gl7a49v76w33j39ih7yspy6x2d14p9bh4wdpg9cafhw9nbc0";
46 })
47 ];
48
49 buildInputs = [ glibcLocales ];
50
51 checkInputs = [ nose pygments testpath ] ++ lib.optional isPy27 mock;
52
53 propagatedBuildInputs = [
54 backports_shutil_get_terminal_size decorator pickleshare prompt-toolkit
55 simplegeneric traitlets requests pathlib2 pexpect
56 ] ++ lib.optionals stdenv.isDarwin [ appnope ];
57
58 LC_ALL="en_US.UTF-8";
59
60 doCheck = false; # Circular dependency with ipykernel
61
62 checkPhase = ''
63 nosetests
64 '';
65
66 meta = {
67 description = "IPython: Productive Interactive Computing";
68 homepage = "http://ipython.org/";
69 license = lib.licenses.bsd3;
70 maintainers = with lib.maintainers; [ bjornfor orivej lnl7 ];
71 };
72}