nixpkgs/pkgs/development/python-modules/autobahn/default.nix

35 lines
1.1 KiB
Nix
Raw Normal View History

{ stdenv, buildPythonPackage, fetchPypi, isPy3k, isPy33,
unittest2, mock, pytest, trollius, asyncio,
pytest-asyncio, futures,
six, twisted, txaio, zope_interface
}:
buildPythonPackage rec {
pname = "autobahn";
2018-08-13 08:22:20 +01:00
version = "18.7.1";
src = fetchPypi {
inherit pname version;
2018-08-13 08:22:20 +01:00
sha256 = "163dd329c2a29f4ef82f7fe85a6f6e654a2aa6837bd83834cf537e4efa9204be";
};
# Upstream claim python2 support, but tests require pytest-asyncio which
# is pythn3 only. Therefore, tests are skipped for python2.
doCheck = isPy3k;
buildInputs = stdenv.lib.optionals isPy3k [ unittest2 mock pytest pytest-asyncio ];
propagatedBuildInputs = [ six twisted zope_interface txaio ] ++
(stdenv.lib.optional isPy33 asyncio) ++
(stdenv.lib.optionals (!isPy3k) [ trollius futures ]);
checkPhase = ''
2018-06-12 17:46:58 +01:00
USE_TWISTED=true py.test $out
'';
meta = with stdenv.lib; {
description = "WebSocket and WAMP in Python for Twisted and asyncio.";
homepage = "https://crossbar.io/autobahn";
license = licenses.mit;
maintainers = with maintainers; [ nand0p ];
platforms = platforms.all;
};
}