ansible-later: 2.0.22 -> 2.0.23
[NixPkgs.git] / pkgs / development / python-modules / autobahn / default.nix
bloba6e6de7227446ea2a6505e9522aeb9cd4120974f
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:
49 buildPythonPackage rec {
50   pname = "autobahn";
51   version = "22.7.1";
52   format = "setuptools";
54   disabled = pythonOlder "3.7";
56   src = fetchPypi {
57     inherit pname version;
58     sha256 = "sha256-i0Yuouaq1rTcDtRfuAC2y/6wMl5/5pg5B/Ei8r5KH+k=";
59   };
61   postPatch = ''
62     substituteInPlace setup.py \
63       --replace "pytest>=2.8.6,<3.3.0" "pytest"
64   '';
66   propagatedBuildInputs = [
67     cryptography
68     hyperlink
69     pynacl
70     txaio
71   ];
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;
83   preCheck = ''
84     # Run asyncio tests (requires twisted)
85     export USE_ASYNCIO=1
86   '';
88   pytestFlagsArray = [
89     "--pyargs autobahn"
90   ];
92   pythonImportsCheck = [
93     "autobahn"
94   ];
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   };
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   };