1{ lib
2, buildPythonPackage
3, fetchPypi
4, attrs
5, argon2-cffi
6, base58
7, cbor2
8, cffi
9, click
10, cryptography
11, ecdsa
12, eth-abi
13, eth-account
14, flatbuffers
15, jinja2
16, hkdf
17, hyperlink
18, mnemonic
19, mock
20, msgpack
21, passlib
22, py-ecc
23, py-eth-sig-utils
24, py-multihash
25, py-ubjson
26, pynacl
27, pygobject3
28, pyopenssl
29, qrcode
30, pytest-asyncio
31, python-snappy
32, pytestCheckHook
33, pythonOlder
34 # , pytrie
35, rlp
36, service-identity
37, spake2
38, twisted
39, txaio
40, ujson
41 # , web3
42 # , wsaccel
43 # , xbr
44, yapf
45 # , zlmdb
46, zope_interface
47}@args:
48
49buildPythonPackage rec {
50 pname = "autobahn";
51 version = "22.7.1";
52 format = "setuptools";
53
54 disabled = pythonOlder "3.7";
55
56 src = fetchPypi {
57 inherit pname version;
58 sha256 = "sha256-i0Yuouaq1rTcDtRfuAC2y/6wMl5/5pg5B/Ei8r5KH+k=";
59 };
60
61 postPatch = ''
62 substituteInPlace setup.py \
63 --replace "pytest>=2.8.6,<3.3.0" "pytest"
64 '';
65
66 propagatedBuildInputs = [
67 cryptography
68 hyperlink
69 pynacl
70 txaio
71 ];
72
73 checkInputs = [
74 mock
75 pytest-asyncio
76 pytestCheckHook
77 # FIXME: remove the following dependencies when web3 gets added
78 eth-account
79 ] ++ passthru.optional-dependencies.scram
80 ++ passthru.optional-dependencies.serialization
81 ++ passthru.optional-dependencies.xbr;
82
83 preCheck = ''
84 # Run asyncio tests (requires twisted)
85 export USE_ASYNCIO=1
86 '';
87
88 pytestFlagsArray = [
89 "--pyargs autobahn"
90 ];
91
92 pythonImportsCheck = [
93 "autobahn"
94 ];
95
96 passthru.optional-dependencies = rec {
97 all = accelerate ++ compress ++ encryption ++ nvx ++ serialization ++ scram ++ twisted ++ ui ++ xbr;
98 accelerate = [ /* wsaccel */ ];
99 compress = [ python-snappy ];
100 encryption = [ pynacl pyopenssl qrcode /* pytrie */ service-identity ];
101 nvx = [ cffi ];
102 scram = [ argon2-cffi cffi passlib ];
103 serialization = [ cbor2 flatbuffers msgpack ujson py-ubjson ];
104 twisted = [ attrs args.twisted zope_interface ];
105 ui = [ pygobject3 ];
106 xbr = [ base58 cbor2 click ecdsa eth-abi jinja2 hkdf mnemonic py-ecc py-eth-sig-utils py-multihash rlp spake2 twisted /* web3 xbr */ yapf /* zlmdb */ ];
107 };
108
109 meta = with lib; {
110 description = "WebSocket and WAMP in Python for Twisted and asyncio";
111 homepage = "https://crossbar.io/autobahn";
112 license = licenses.mit;
113 maintainers = with maintainers; [ SuperSandro2000 ];
114 };
115}