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