1{ 2 lib, 3 buildPythonPackage, 4 fetchFromGitHub, 5 6 # build 7 hatchling, 8 9 # runtime 10 jsonschema, 11 packaging, 12 python-json-logger, 13 pyyaml, 14 referencing, 15 rfc3339-validator, 16 rfc3986-validator, 17 traitlets, 18 19 # optionals 20 click, 21 rich, 22 23 # tests 24 pytest-asyncio, 25 pytest-console-scripts, 26 pytestCheckHook, 27}: 28 29buildPythonPackage rec { 30 pname = "jupyter-events"; 31 version = "0.12.0"; 32 pyproject = true; 33 34 src = fetchFromGitHub { 35 owner = "jupyter"; 36 repo = "jupyter_events"; 37 tag = "v${version}"; 38 hash = "sha256-l/u0XRP6mjqXywVzRXTWSm4E5a6o2oCdOBGGzLb85Ek="; 39 }; 40 41 build-system = [ hatchling ]; 42 43 dependencies = [ 44 jsonschema 45 packaging 46 python-json-logger 47 pyyaml 48 referencing 49 rfc3339-validator 50 rfc3986-validator 51 traitlets 52 ] 53 ++ jsonschema.optional-dependencies.format-nongpl; 54 55 optional-dependencies = { 56 cli = [ 57 click 58 rich 59 ]; 60 }; 61 62 nativeCheckInputs = [ 63 pytest-asyncio 64 pytest-console-scripts 65 pytestCheckHook 66 ] 67 ++ lib.flatten (builtins.attrValues optional-dependencies); 68 69 preCheck = '' 70 export PATH="$out/bin:$PATH" 71 ''; 72 73 pythonImportsCheck = [ "jupyter_events" ]; 74 75 meta = { 76 changelog = "https://github.com/jupyter/jupyter_events/releases/tag/v${version}"; 77 description = "Configurable event system for Jupyter applications and extensions"; 78 mainProgram = "jupyter-events"; 79 homepage = "https://github.com/jupyter/jupyter_events"; 80 license = lib.licenses.bsd3; 81 teams = [ lib.teams.jupyter ]; 82 }; 83}