1{ stdenv
2, buildPythonPackage
3, fetchFromGitHub
4, mock
5, nose
6, pamqp
7}:
8
9buildPythonPackage rec {
10 version = "1.0.0";
11 pname = "rabbitpy";
12
13 # No tests in the pypi tarball, so we directly fetch from git
14 src = fetchFromGitHub {
15 owner = "gmr";
16 repo = pname;
17 rev = version;
18 sha256 = "0fd80zlr4p2sh77rxyyfi9l0h2zqi2csgadr0rhnpgpqsy10qck6";
19 };
20
21 propagatedBuildInputs = [ pamqp ];
22 checkInputs = [ mock nose ];
23
24 checkPhase = ''
25 runHook preCheck
26 rm tests/integration_tests.py # Impure tests requiring network
27 nosetests tests
28 runHook postCheck
29 '';
30
31 postPatch = ''
32 # See: https://github.com/gmr/rabbitpy/issues/118
33 substituteInPlace setup.py \
34 --replace 'pamqp>=1.6.1,<2.0' 'pamqp'
35 '';
36
37 meta = with stdenv.lib; {
38 description = "A pure python, thread-safe, minimalistic and pythonic RabbitMQ client library";
39 homepage = https://pypi.python.org/pypi/rabbitpy;
40 license = licenses.bsd3;
41 };
42
43}