1{ lib
2, stdenv
3, buildPythonPackage
4, fetchPypi
5, fetchpatch
6, pythonOlder
7
8# Build dependencies
9, setuptools
10
11# Runtime dependencies
12, appnope
13, backcall
14, decorator
15, jedi
16, matplotlib-inline
17, pexpect
18, pickleshare
19, prompt-toolkit
20, pygments
21, stack-data
22, traitlets
23
24# Test dependencies
25, pytestCheckHook
26, testpath
27}:
28
29buildPythonPackage rec {
30 pname = "ipython";
31 version = "8.11.0";
32 format = "pyproject";
33 disabled = pythonOlder "3.8";
34
35 src = fetchPypi {
36 inherit pname version;
37 sha256 = "735cede4099dbc903ee540307b9171fbfef4aa75cfcacc5a273b2cda2f02be04";
38 };
39
40 nativeBuildInputs = [
41 setuptools
42 ];
43
44 propagatedBuildInputs = [
45 backcall
46 decorator
47 jedi
48 matplotlib-inline
49 pexpect
50 pickleshare
51 prompt-toolkit
52 pygments
53 stack-data
54 traitlets
55 ] ++ lib.optionals stdenv.isDarwin [
56 appnope
57 ];
58
59 pythonImportsCheck = [
60 "IPython"
61 ];
62
63 preCheck = ''
64 export HOME=$TMPDIR
65
66 # doctests try to fetch an image from the internet
67 substituteInPlace pytest.ini \
68 --replace "--ipdoctest-modules" "--ipdoctest-modules --ignore=IPython/core/display.py"
69 '';
70
71 nativeCheckInputs = [
72 pytestCheckHook
73 testpath
74 ];
75
76 disabledTests = [
77 # UnboundLocalError: local variable 'child' referenced before assignment
78 "test_system_interrupt"
79 ] ++ lib.optionals (stdenv.isDarwin) [
80 # FileNotFoundError: [Errno 2] No such file or directory: 'pbpaste'
81 "test_clipboard_get"
82 ];
83
84 meta = with lib; {
85 description = "IPython: Productive Interactive Computing";
86 homepage = "https://ipython.org/";
87 changelog = "https://github.com/ipython/ipython/blob/${version}/docs/source/whatsnew/version${lib.versions.major version}.rst";
88 license = licenses.bsd3;
89 maintainers = with maintainers; [ bjornfor fridh ];
90 };
91}