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.15.1";
30 pyproject = true;
31
32 src = fetchFromGitHub {
33 owner = "jupyter-server";
34 repo = "pycrdt-websocket";
35 rev = "refs/tags/v${version}";
36 hash = "sha256-O0GRk81at8bgv+/4au8A55dZK2A28+ghy3sitAAZQBI=";
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 disabledTestPaths = [
64 # requires nodejs and installed js modules
65 "tests/test_pycrdt_yjs.py"
66 ];
67
68 __darwinAllowLocalNetworking = true;
69
70 meta = {
71 description = "WebSocket Connector for pycrdt";
72 homepage = "https://github.com/jupyter-server/pycrdt-websocket";
73 changelog = "https://github.com/jupyter-server/pycrdt-websocket/blob/${src.rev}/CHANGELOG.md";
74 license = lib.licenses.mit;
75 maintainers = lib.teams.jupyter.members;
76 };
77}