1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # build-system
7 hatchling,
8
9 # dependencies
10 aiosqlite,
11 anyio,
12 y-py,
13
14 # testing
15 pytest-asyncio,
16 pytestCheckHook,
17 uvicorn,
18 websockets,
19}:
20
21buildPythonPackage rec {
22 pname = "ypy-websocket";
23 version = "0.12.4";
24 pyproject = true;
25
26 src = fetchFromGitHub {
27 owner = "y-crdt";
28 repo = "ypy-websocket";
29 tag = "v${version}";
30 hash = "sha256-48x+MUhev9dErC003XOP3oGKd5uOghlBFgcR8Nm/0xs=";
31 };
32
33 build-system = [ hatchling ];
34
35 pythonRelaxDeps = [ "aiofiles" ];
36
37 dependencies = [
38 aiosqlite
39 anyio
40 y-py
41 ];
42
43 pythonImportsCheck = [ "ypy_websocket" ];
44
45 __darwinAllowLocalNetworking = true;
46
47 nativeCheckInputs = [
48 pytest-asyncio
49 pytestCheckHook
50 uvicorn
51 websockets
52 ];
53
54 disabledTestPaths = [
55 # requires installing yjs Node.js module
56 "tests/test_ypy_yjs.py"
57 # Depends on no longer maintained ypy
58 "tests/test_asgi.py"
59 ];
60
61 meta = {
62 changelog = "https://github.com/y-crdt/ypy-websocket/blob/${src.rev}/CHANGELOG.md";
63 description = "WebSocket Connector for Ypy";
64 homepage = "https://github.com/y-crdt/ypy-websocket";
65 license = lib.licenses.mit;
66 maintainers = with lib.maintainers; [ dotlambda ];
67 };
68}