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.8.1"; 10 11 src = fetchurl { 12 url = "mirror://pypi/a/${pname}/${name}.tar.gz"; 13 sha256 = "72b1b1e30bd41d52e7454ef6fe78fe80ebf2341a747616e2cd854a76203a0ec4"; 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}