1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 attrs,
6 argon2-cffi,
7 cbor2,
8 cffi,
9 cryptography,
10 flatbuffers,
11 hyperlink,
12 mock,
13 msgpack,
14 passlib,
15 py-ubjson,
16 pynacl,
17 pygobject3,
18 pyopenssl,
19 qrcode,
20 pytest-asyncio,
21 python-snappy,
22 pytestCheckHook,
23 pythonOlder,
24 service-identity,
25 setuptools,
26 twisted,
27 txaio,
28 ujson,
29 zope-interface,
30}@args:
31
32buildPythonPackage rec {
33 pname = "autobahn";
34 version = "24.4.2";
35 pyproject = true;
36
37 disabled = pythonOlder "3.9";
38
39 src = fetchFromGitHub {
40 owner = "crossbario";
41 repo = "autobahn-python";
42 rev = "refs/tags/v${version}";
43 hash = "sha256-aeTE4a37zr83KZ+v947XikzFrHAhkZ4mj4tXdkQnB84=";
44 };
45
46 build-system = [ setuptools ];
47
48 dependencies = [
49 cryptography
50 hyperlink
51 pynacl
52 txaio
53 ];
54
55 nativeCheckInputs =
56 [
57 mock
58 pytest-asyncio
59 pytestCheckHook
60 ]
61 ++ optional-dependencies.scram
62 ++ optional-dependencies.serialization;
63
64 preCheck = ''
65 # Run asyncio tests (requires twisted)
66 export USE_ASYNCIO=1
67 '';
68
69 pytestFlagsArray = [
70 "--ignore=./autobahn/twisted"
71 "./autobahn"
72 ];
73
74 pythonImportsCheck = [ "autobahn" ];
75
76 optional-dependencies = rec {
77 all = accelerate ++ compress ++ encryption ++ nvx ++ serialization ++ scram ++ twisted ++ ui;
78 accelerate = [
79 # wsaccel
80 ];
81 compress = [ python-snappy ];
82 encryption = [
83 pynacl
84 pyopenssl
85 qrcode # pytrie
86 service-identity
87 ];
88 nvx = [ cffi ];
89 scram = [
90 argon2-cffi
91 cffi
92 passlib
93 ];
94 serialization = [
95 cbor2
96 flatbuffers
97 msgpack
98 ujson
99 py-ubjson
100 ];
101 twisted = [
102 attrs
103 args.twisted
104 zope-interface
105 ];
106 ui = [ pygobject3 ];
107 };
108
109 meta = with lib; {
110 changelog = "https://github.com/crossbario/autobahn-python/blob/${src.rev}/docs/changelog.rst";
111 description = "WebSocket and WAMP in Python for Twisted and asyncio";
112 homepage = "https://crossbar.io/autobahn";
113 license = licenses.mit;
114 maintainers = [ ];
115 };
116}