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