1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # build-system
7 hatchling,
8
9 # dependencies
10 jupyter-collaboration-ui,
11 jupyter-docprovider,
12 jupyter-server-ydoc,
13 jupyterlab,
14
15 # tests
16 dirty-equals,
17 httpx-ws,
18 pytest-jupyter,
19 pytest-timeout,
20 pytestCheckHook,
21 writableTmpDirAsHomeHook,
22}:
23
24buildPythonPackage rec {
25 pname = "jupyter-collaboration";
26 version = "4.1.0";
27 pyproject = true;
28
29 src = fetchFromGitHub {
30 owner = "jupyterlab";
31 repo = "jupyter-collaboration";
32 tag = "v${version}";
33 hash = "sha256-PnfUWtOXdXYG5qfzAW5kATSQr2sWKDBNiINA8/G4ZX4=";
34 };
35
36 sourceRoot = "${src.name}/projects/jupyter-collaboration";
37
38 build-system = [ hatchling ];
39
40 dependencies = [
41 jupyter-collaboration-ui
42 jupyter-docprovider
43 jupyter-server-ydoc
44 jupyterlab
45 ];
46
47 pythonImportsCheck = [ "jupyter_collaboration" ];
48
49 nativeCheckInputs = [
50 dirty-equals
51 httpx-ws
52 pytest-jupyter
53 pytest-timeout
54 pytestCheckHook
55 writableTmpDirAsHomeHook
56 ];
57
58 pytestFlags = [
59 # pytest.PytestCacheWarning: could not create cache path /build/source/.pytest_cache/v/cache/nodeids: [Errno 13] Permission denied: '/build/source/pytest-cache-files-plraagdr'
60 "-pno:cacheprovider"
61 ];
62
63 preCheck = ''
64 appendToVar enabledTestPaths "$src/tests"
65 '';
66
67 __darwinAllowLocalNetworking = true;
68
69 meta = {
70 description = "JupyterLab Extension enabling Real-Time Collaboration";
71 homepage = "https://github.com/jupyterlab/jupyter_collaboration";
72 changelog = "https://github.com/jupyterlab/jupyter_collaboration/blob/${src.tag}/CHANGELOG.md";
73 license = lib.licenses.bsd3;
74 teams = [ lib.teams.jupyter ];
75 };
76}