2021-05-20 23:08:51 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
2022-05-18 14:49:53 +00:00
|
|
|
, fetchPypi
|
2022-12-17 10:02:37 +00:00
|
|
|
, fetchpatch
|
2022-05-18 14:49:53 +00:00
|
|
|
, 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-09-30 11:47:45 +00:00
|
|
|
version = "22.7.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
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
# https://github.com/crossbario/autobahn-python/pull/1604
|
|
|
|
url = "https://github.com/crossbario/autobahn-python/commit/ffe679fae4ebcdde964d4ee88cb82a9c65c40529.patch";
|
|
|
|
sha256 = "sha256-QNnQkxMZJsFbiYUp4Os+dWo7jdCa96+kyb/2HxSMU8k=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2022-09-30 11:47:45 +00:00
|
|
|
sha256 = "sha256-i0Yuouaq1rTcDtRfuAC2y/6wMl5/5pg5B/Ei8r5KH+k=";
|
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
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-05-20 23:08:51 +00:00
|
|
|
mock
|
|
|
|
pytest-asyncio
|
|
|
|
pytestCheckHook
|
2022-06-16 17:23:12 +00:00
|
|
|
] ++ 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
|
|
|
};
|
|
|
|
}
|