1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, gevent
5, nose
6, mock
7, twisted
8, tornado
9}:
10
11buildPythonPackage rec {
12 pname = "pika";
13 version = "1.2.0";
14
15 src = fetchFromGitHub {
16 owner = "pika";
17 repo = "pika";
18 rev = version;
19 sha256 = "sha256-Wog6Wxa8V/zv/bBrFOigZi6KE5qRf82bf1GK2XwvpDI=";
20 };
21
22 propagatedBuildInputs = [ gevent tornado twisted ];
23
24 checkInputs = [ nose mock ];
25
26 postPatch = ''
27 # don't stop at first test failure
28 # don't run acceptance tests because they access the network
29 # don't report test coverage
30 substituteInPlace setup.cfg \
31 --replace "stop = 1" "stop = 0" \
32 --replace "tests=tests/unit,tests/acceptance" "tests=tests/unit" \
33 --replace "with-coverage = 1" "with-coverage = 0"
34 '';
35
36 checkPhase = ''
37 runHook preCheck
38
39 PIKA_TEST_TLS=true nosetests
40
41 runHook postCheck
42 '';
43
44 meta = with lib; {
45 description = "Pure-Python implementation of the AMQP 0-9-1 protocol";
46 homepage = "https://pika.readthedocs.org";
47 license = licenses.bsd3;
48 };
49
50}