about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/rabbitpy/default.nix
blob: 7406faca6014c8b3602002863e28ca51f830c07a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
{ stdenv
, buildPythonPackage
, fetchFromGitHub
, mock
, nose
, pamqp
}:

buildPythonPackage rec {
  version = "1.0.0";
  pname = "rabbitpy";

  # No tests in the pypi tarball, so we directly fetch from git
  src = fetchFromGitHub {
    owner = "gmr";
    repo = pname;
    rev = version;
    sha256 = "0fd80zlr4p2sh77rxyyfi9l0h2zqi2csgadr0rhnpgpqsy10qck6";
  };

  propagatedBuildInputs = [ pamqp ];
  checkInputs = [ mock nose ];

  checkPhase = ''
    runHook preCheck
    rm tests/integration_tests.py # Impure tests requiring network
    nosetests tests
    runHook postCheck
  '';

  postPatch = ''
    # See: https://github.com/gmr/rabbitpy/issues/118
    substituteInPlace setup.py \
      --replace 'pamqp>=1.6.1,<2.0' 'pamqp'
  '';

  meta = with stdenv.lib; {
    description = "A pure python, thread-safe, minimalistic and pythonic RabbitMQ client library";
    homepage = https://pypi.python.org/pypi/rabbitpy;
    license = licenses.bsd3;
  };

}