2021-05-20 23:08:51 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
2022-05-18 14:49:53 +00:00
|
|
|
, fetchPypi
|
|
|
|
, attrs
|
|
|
|
, argon2-cffi
|
|
|
|
, base58
|
2021-05-20 23:08:51 +00:00
|
|
|
, cbor2
|
|
|
|
, cffi
|
2022-05-18 14:49:53 +00:00
|
|
|
, click
|
2021-05-20 23:08:51 +00:00
|
|
|
, cryptography
|
2022-05-18 14:49:53 +00:00
|
|
|
, ecdsa
|
2022-06-16 17:23:12 +00:00
|
|
|
, eth-abi
|
|
|
|
, eth-account
|
2021-05-20 23:08:51 +00:00
|
|
|
, flatbuffers
|
2022-05-18 14:49:53 +00:00
|
|
|
, jinja2
|
|
|
|
, hkdf
|
|
|
|
, hyperlink
|
|
|
|
, mnemonic
|
2021-05-20 23:08:51 +00:00
|
|
|
, mock
|
|
|
|
, msgpack
|
|
|
|
, passlib
|
2022-06-16 17:23:12 +00:00
|
|
|
, py-ecc
|
|
|
|
, py-eth-sig-utils
|
2022-05-18 14:49:53 +00:00
|
|
|
, py-multihash
|
|
|
|
, py-ubjson
|
2021-05-20 23:08:51 +00:00
|
|
|
, pynacl
|
2022-05-18 14:49:53 +00:00
|
|
|
, pygobject3
|
|
|
|
, pyopenssl
|
2022-06-16 17:23:12 +00:00
|
|
|
, qrcode
|
2021-05-20 23:08:51 +00:00
|
|
|
, pytest-asyncio
|
2022-05-18 14:49:53 +00:00
|
|
|
, python-snappy
|
2021-05-20 23:08:51 +00:00
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
2022-05-18 14:49:53 +00:00
|
|
|
# , pytrie
|
|
|
|
, rlp
|
|
|
|
, service-identity
|
|
|
|
, spake2
|
2021-05-20 23:08:51 +00:00
|
|
|
, twisted
|
|
|
|
, txaio
|
|
|
|
, ujson
|
2022-05-18 14:49:53 +00:00
|
|
|
# , web3
|
|
|
|
# , wsaccel
|
|
|
|
# , xbr
|
|
|
|
, yapf
|
|
|
|
# , zlmdb
|
2021-05-20 23:08:51 +00:00
|
|
|
, zope_interface
|
2022-05-18 14:49:53 +00:00
|
|
|
}@args:
|
2021-05-20 23:08:51 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "autobahn";
|
2022-06-16 17:23:12 +00:00
|
|
|
version = "22.5.1";
|
2021-12-06 16:07:01 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2022-06-16 17:23:12 +00:00
|
|
|
sha256 = "sha256-NKpVabC0QZ+MJ3eSxgDcJRjEkwkox04iee+LiNi4o+o=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace "pytest>=2.8.6,<3.3.0" "pytest"
|
|
|
|
'';
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
cryptography
|
2022-05-18 14:49:53 +00:00
|
|
|
hyperlink
|
2021-05-20 23:08:51 +00:00
|
|
|
pynacl
|
|
|
|
txaio
|
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
mock
|
|
|
|
pytest-asyncio
|
|
|
|
pytestCheckHook
|
2022-06-16 17:23:12 +00:00
|
|
|
# FIXME: remove the following dependencies when web3 gets added
|
|
|
|
eth-account
|
|
|
|
] ++ passthru.optional-dependencies.scram
|
|
|
|
++ passthru.optional-dependencies.serialization
|
|
|
|
++ passthru.optional-dependencies.xbr;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
preCheck = ''
|
|
|
|
# Run asyncio tests (requires twisted)
|
|
|
|
export USE_ASYNCIO=1
|
|
|
|
'';
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
pytestFlagsArray = [
|
|
|
|
"--pyargs autobahn"
|
|
|
|
];
|
2021-05-20 23:08:51 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"autobahn"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
passthru.optional-dependencies = rec {
|
2022-05-18 14:49:53 +00:00
|
|
|
all = accelerate ++ compress ++ encryption ++ nvx ++ serialization ++ scram ++ twisted ++ ui ++ xbr;
|
|
|
|
accelerate = [ /* wsaccel */ ];
|
|
|
|
compress = [ python-snappy ];
|
2022-06-16 17:23:12 +00:00
|
|
|
encryption = [ pynacl pyopenssl qrcode /* pytrie */ service-identity ];
|
2022-05-18 14:49:53 +00:00
|
|
|
nvx = [ cffi ];
|
|
|
|
scram = [ argon2-cffi cffi passlib ];
|
|
|
|
serialization = [ cbor2 flatbuffers msgpack ujson py-ubjson ];
|
|
|
|
twisted = [ attrs args.twisted zope_interface ];
|
|
|
|
ui = [ pygobject3 ];
|
2022-06-16 17:23:12 +00:00
|
|
|
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 */ ];
|
2022-05-18 14:49:53 +00:00
|
|
|
};
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
2021-05-20 23:08:51 +00:00
|
|
|
description = "WebSocket and WAMP in Python for Twisted and asyncio";
|
|
|
|
homepage = "https://crossbar.io/autobahn";
|
|
|
|
license = licenses.mit;
|
2022-05-18 14:49:53 +00:00
|
|
|
maintainers = with maintainers; [ SuperSandro2000 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|