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.4.0";
32 format = "pyproject";
33 disabled = pythonOlder "3.8";
34
35 src = fetchPypi {
36 inherit pname version;
37 sha256 = "f2db3a10254241d9b447232cec8b424847f338d9d36f9a577a6192c332a46abd";
38 };
39
40 patches = [
41 (fetchpatch {
42 # The original URL might not be very stable, so let's prefer a copy.
43 urls = [
44 "https://raw.githubusercontent.com/bmwiedemann/openSUSE/9b35e4405a44aa737dda623a7dabe5384172744c/packages/p/python-ipython/ipython-pr13714-xxlimited.patch"
45 "https://github.com/ipython/ipython/pull/13714.diff"
46 ];
47 sha256 = "XPOcBo3p8mzMnP0iydns9hX8qCQXTmRgRD0TM+FESCI=";
48 })
49 ];
50
51 nativeBuildInputs = [
52 setuptools
53 ];
54
55 propagatedBuildInputs = [
56 backcall
57 decorator
58 jedi
59 matplotlib-inline
60 pexpect
61 pickleshare
62 prompt-toolkit
63 pygments
64 stack-data
65 traitlets
66 ] ++ lib.optionals stdenv.isDarwin [
67 appnope
68 ];
69
70 pythonImportsCheck = [
71 "IPython"
72 ];
73
74 preCheck = ''
75 export HOME=$TMPDIR
76
77 # doctests try to fetch an image from the internet
78 substituteInPlace pytest.ini \
79 --replace "--ipdoctest-modules" "--ipdoctest-modules --ignore=IPython/core/display.py"
80 '';
81
82 checkInputs = [
83 pytestCheckHook
84 testpath
85 ];
86
87 disabledTests = [
88 # UnboundLocalError: local variable 'child' referenced before assignment
89 "test_system_interrupt"
90 ] ++ lib.optionals (stdenv.isDarwin) [
91 # FileNotFoundError: [Errno 2] No such file or directory: 'pbpaste'
92 "test_clipboard_get"
93 ];
94
95 meta = with lib; {
96 description = "IPython: Productive Interactive Computing";
97 homepage = "https://ipython.org/";
98 changelog = "https://github.com/ipython/ipython/blob/${version}/docs/source/whatsnew/version${lib.versions.major version}.rst";
99 license = licenses.bsd3;
100 maintainers = with maintainers; [ bjornfor fridh ];
101 };
102}