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