1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 callPackage,
6 fetchPypi,
7 hatchling,
8 pythonOlder,
9 appnope,
10 comm,
11 ipython,
12 jupyter-client,
13 jupyter-core,
14 matplotlib-inline,
15 nest-asyncio,
16 packaging,
17 psutil,
18 pyzmq,
19 tornado,
20 traitlets,
21
22 # Reverse dependency
23 sage,
24}:
25
26buildPythonPackage rec {
27 pname = "ipykernel";
28 version = "6.30.1";
29 pyproject = true;
30
31 disabled = pythonOlder "3.8";
32
33 src = fetchPypi {
34 inherit pname version;
35 hash = "sha256-arsnAWGJZALna5E5T83OXRvl1F9FZnHlCAVy+FBb45s=";
36 };
37
38 # debugpy is optional, see https://github.com/ipython/ipykernel/pull/767
39 pythonRemoveDeps = [ "debugpy" ];
40
41 nativeBuildInputs = [ hatchling ];
42
43 propagatedBuildInputs = [
44 comm
45 ipython
46 jupyter-client
47 jupyter-core
48 matplotlib-inline
49 nest-asyncio
50 packaging
51 psutil
52 pyzmq
53 tornado
54 traitlets
55 ]
56 ++ lib.optionals stdenv.hostPlatform.isDarwin [ appnope ];
57
58 # check in passthru.tests.pytest to escape infinite recursion with ipyparallel
59 doCheck = false;
60
61 passthru.tests = {
62 pytest = callPackage ./tests.nix { };
63 inherit sage;
64 };
65
66 meta = {
67 description = "IPython Kernel for Jupyter";
68 homepage = "https://ipython.org/";
69 changelog = "https://github.com/ipython/ipykernel/releases/tag/v${version}";
70 license = lib.licenses.bsd3;
71 teams = [ lib.teams.jupyter ];
72 };
73}