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