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

44 lines
957 B
Nix
Raw Normal View History

{ stdenv
, buildPythonPackage
2019-03-04 22:07:44 +00:00
, fetchFromGitHub
, mock
, nose
, pamqp
}:
buildPythonPackage rec {
version = "2.0.1";
pname = "rabbitpy";
2019-03-04 22:07:44 +00:00
# No tests in the pypi tarball, so we directly fetch from git
src = fetchFromGitHub {
owner = "gmr";
repo = pname;
2019-03-17 21:46:39 +00:00
rev = version;
sha256 = "0m5z3i3d5adrz1wh6y35xjlls3cq6p4y9p1mzghw3k7hdvg26cck";
};
propagatedBuildInputs = [ pamqp ];
2019-03-04 22:07:44 +00:00
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>=2,<3' 'pamqp'
2019-03-04 22:07:44 +00:00
'';
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;
};
}