pythonPackages.rabbitpy: Fix build

This commit is contained in:
Josef Kemetmüller 2019-03-04 23:07:44 +01:00 committed by worldofpeace
parent 1a2c78b420
commit 2016b37495

View File

@ -1,6 +1,6 @@
{ stdenv { stdenv
, buildPythonPackage , buildPythonPackage
, fetchPypi , fetchFromGitHub
, mock , mock
, nose , nose
, pamqp , pamqp
@ -10,13 +10,30 @@ buildPythonPackage rec {
version = "1.0.0"; version = "1.0.0";
pname = "rabbitpy"; pname = "rabbitpy";
src = fetchPypi { # No tests in the pypi tarball, so we directly fetch from git
inherit pname version; src = fetchFromGitHub {
sha256 = "54d33746d0c6a686417cd354346803945df0740b39fb92842d259387100db126"; owner = "gmr";
repo = pname;
rev = "${version}";
sha256 = "0fd80zlr4p2sh77rxyyfi9l0h2zqi2csgadr0rhnpgpqsy10qck6";
}; };
buildInputs = [ mock nose ];
propagatedBuildInputs = [ pamqp ]; propagatedBuildInputs = [ pamqp ];
doCheck = true;
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; { meta = with stdenv.lib; {
description = "A pure python, thread-safe, minimalistic and pythonic RabbitMQ client library"; description = "A pure python, thread-safe, minimalistic and pythonic RabbitMQ client library";