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