1{ stdenv, buildPythonPackage, fetchPypi, isPy3k, isPy33,
2 unittest2, mock, pytest, trollius, asyncio,
3 pytest-asyncio, futures, cffi,
4 six, twisted, txaio, zope_interface
5}:
6buildPythonPackage rec {
7 pname = "autobahn";
8 version = "18.8.1";
9
10 src = fetchPypi {
11 inherit pname version;
12 sha256 = "b69858e0be4bff8437b0bd82a0db1cbef7405e16bd9354ba587c043d6d5e1ad9";
13 };
14
15 # Upstream claim python2 support, but tests require pytest-asyncio which
16 # is pythn3 only. Therefore, tests are skipped for python2.
17 doCheck = isPy3k;
18 checkInputs = stdenv.lib.optionals isPy3k [ unittest2 mock pytest pytest-asyncio ];
19 propagatedBuildInputs = [ cffi six twisted zope_interface txaio ] ++
20 (stdenv.lib.optional isPy33 asyncio) ++
21 (stdenv.lib.optionals (!isPy3k) [ trollius futures ]);
22
23 checkPhase = ''
24 USE_TWISTED=true py.test $out
25 '';
26
27 meta = with stdenv.lib; {
28 description = "WebSocket and WAMP in Python for Twisted and asyncio.";
29 homepage = "https://crossbar.io/autobahn";
30 license = licenses.mit;
31 maintainers = with maintainers; [ nand0p ];
32 };
33}