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