1{ lib 2, buildPythonPackage 3, fetchFromGitHub 4 5# build 6, hatchling 7, pytest 8 9# runtime 10, jupyter-core 11 12# optionals 13, jupyter-client 14, ipykernel 15, jupyter-server 16, nbformat 17 18# tests 19, pytest-timeout 20, pytestCheckHook 21}: 22 23let self = buildPythonPackage rec { 24 pname = "pytest-jupyter"; 25 version = "0.7.0"; 26 format = "pyproject"; 27 28 src = fetchFromGitHub { 29 owner = "jupyter-server"; 30 repo = "pytest-jupyter"; 31 rev = "refs/tags/v${version}"; 32 hash = "sha256-ZocpIBHnXTvQdjWU8yVhGK49I+FFct+teDhghiMnvW0="; 33 }; 34 35 nativeBuildInputs = [ 36 hatchling 37 ]; 38 39 buildInputs = [ 40 pytest 41 ]; 42 43 propagatedBuildInputs = [ 44 jupyter-core 45 ]; 46 47 passthru.optional-dependencies = rec { 48 client = [ 49 jupyter-client 50 ipykernel 51 ]; 52 server = [ 53 jupyter-server 54 nbformat 55 ] ++ client; 56 }; 57 58 doCheck = false; # infinite recursion with jupyter-server 59 60 nativeCheckInputs = [ 61 pytest-timeout 62 pytestCheckHook 63 ] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies); 64 65 passthru.tests = { 66 check = self.overridePythonAttrs (_: { doCheck = false; }); 67 }; 68 69 meta = with lib; { 70 changelog = "https://github.com/jupyter-server/pytest-jupyter/releases/tag/v${version}"; 71 description = "pytest plugin for testing Jupyter core libraries and extensions"; 72 homepage = "https://github.com/jupyter-server/pytest-jupyter"; 73 license = licenses.bsd3; 74 maintainers = with maintainers; [ ]; 75 }; 76}; 77in self