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