1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # build-system
7 hatchling,
8
9 # dependencies
10 anyio,
11 pycrdt,
12 sqlite-anyio,
13
14 # optional-dependencies
15 channels,
16
17 # tests
18 httpx-ws,
19 hypercorn,
20 pytest-asyncio,
21 pytestCheckHook,
22 trio,
23 uvicorn,
24 websockets,
25}:
26
27buildPythonPackage rec {
28 pname = "pycrdt-websocket";
29 version = "0.16.0";
30 pyproject = true;
31
32 src = fetchFromGitHub {
33 owner = "jupyter-server";
34 repo = "pycrdt-websocket";
35 tag = version;
36 hash = "sha256-Qux8IxJR1nGbdpGz7RZBKJjYN0qfwfEpd2UDlduOna0=";
37 };
38
39 build-system = [ hatchling ];
40
41 dependencies = [
42 anyio
43 pycrdt
44 sqlite-anyio
45 ];
46
47 optional-dependencies = {
48 django = [ channels ];
49 };
50
51 pythonImportsCheck = [ "pycrdt_websocket" ];
52
53 nativeCheckInputs = [
54 httpx-ws
55 hypercorn
56 pytest-asyncio
57 pytestCheckHook
58 trio
59 uvicorn
60 websockets
61 ];
62
63 disabledTests = [
64 # Looking for a certfile
65 # FileNotFoundError: [Errno 2] No such file or directory
66 "test_asgi"
67 "test_yroom_restart"
68 ];
69
70 disabledTestPaths = [
71 # requires nodejs and installed js modules
72 "tests/test_pycrdt_yjs.py"
73 ];
74
75 __darwinAllowLocalNetworking = true;
76
77 meta = {
78 description = "WebSocket Connector for pycrdt";
79 homepage = "https://github.com/jupyter-server/pycrdt-websocket";
80 changelog = "https://github.com/jupyter-server/pycrdt-websocket/blob/${src.tag}/CHANGELOG.md";
81 license = lib.licenses.mit;
82 teams = [ lib.teams.jupyter ];
83 };
84}