1{ lib
2, buildPythonPackage
3, pythonOlder
4, fetchFromGitHub
5, hatchling
6, platformdirs
7, traitlets
8, pytestCheckHook
9}:
10
11buildPythonPackage rec {
12 pname = "jupyter-core";
13 version = "5.3.1";
14 disabled = pythonOlder "3.7";
15
16 format = "pyproject";
17
18 src = fetchFromGitHub {
19 owner = "jupyter";
20 repo = "jupyter_core";
21 rev = "refs/tags/v${version}";
22 hash = "sha256-kQ7oNEC5L19PTPaX6C2bP5FYuzlsFsS0TABsw6VvoL8=";
23 };
24
25 patches = [
26 ./tests_respect_pythonpath.patch
27 ];
28
29 nativeBuildInputs = [
30 hatchling
31 ];
32
33 propagatedBuildInputs = [
34 platformdirs
35 traitlets
36 ];
37
38 nativeCheckInputs = [
39 pytestCheckHook
40 ];
41
42 preCheck = ''
43 export HOME=$TMPDIR
44 '';
45
46 disabledTests = [
47 # creates a temporary script, which isn't aware of PYTHONPATH
48 "test_argv0"
49 ];
50
51 postCheck = ''
52 $out/bin/jupyter --help > /dev/null
53 '';
54
55 pythonImportsCheck = [ "jupyter_core" ];
56
57 meta = with lib; {
58 description = "Base package on which Jupyter projects rely";
59 homepage = "https://jupyter.org/";
60 license = licenses.bsd3;
61 maintainers = with maintainers; [ fridh ];
62 };
63}