pythonPackages.autobahn: use checkInputs

This commit is contained in:
Ben Wolsieffer 2018-08-31 13:11:24 -04:00
parent 820feccb18
commit 1c3f7302fa

View File

@ -1,7 +1,6 @@
{ stdenv, buildPythonPackage, fetchPypi, isPy3k, isPy33, { lib, buildPythonPackage, fetchPypi, isPy3k, isPy33,
unittest2, mock, pytest, trollius, asyncio, six, txaio, twisted, zope_interface, cffi, asyncio, trollius, futures,
pytest-asyncio, futures, cffi, mock, pytest
six, twisted, txaio, zope_interface
}: }:
buildPythonPackage rec { buildPythonPackage rec {
pname = "autobahn"; pname = "autobahn";
@ -12,21 +11,18 @@ buildPythonPackage rec {
sha256 = "b69858e0be4bff8437b0bd82a0db1cbef7405e16bd9354ba587c043d6d5e1ad9"; sha256 = "b69858e0be4bff8437b0bd82a0db1cbef7405e16bd9354ba587c043d6d5e1ad9";
}; };
# Upstream claim python2 support, but tests require pytest-asyncio which propagatedBuildInputs = [ six txaio twisted zope_interface cffi ] ++
# is pythn3 only. Therefore, tests are skipped for python2. (lib.optional isPy33 asyncio) ++
doCheck = isPy3k; (lib.optionals (!isPy3k) [ trollius futures ]);
checkInputs = stdenv.lib.optionals isPy3k [ unittest2 mock pytest pytest-asyncio ];
propagatedBuildInputs = [ cffi six twisted zope_interface txaio ] ++
(stdenv.lib.optional isPy33 asyncio) ++
(stdenv.lib.optionals (!isPy3k) [ trollius futures ]);
checkInputs = [ mock pytest ];
checkPhase = '' checkPhase = ''
runHook preCheck runHook preCheck
USE_TWISTED=true py.test $out USE_TWISTED=true py.test $out
runHook postCheck runHook postCheck
''; '';
meta = with stdenv.lib; { meta = with lib; {
description = "WebSocket and WAMP in Python for Twisted and asyncio."; description = "WebSocket and WAMP in Python for Twisted and asyncio.";
homepage = "https://crossbar.io/autobahn"; homepage = "https://crossbar.io/autobahn";
license = licenses.mit; license = licenses.mit;