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