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

38 lines
1.1 KiB
Nix
Raw Normal View History

{ stdenv, buildPythonPackage, fetchPypi, iana-etc, libredirect
, case, pytest, boto3, moto, kombu, billiard, pytz, anyjson, amqp, eventlet
2018-03-28 11:55:39 -07:00
}:
buildPythonPackage rec {
2018-01-09 02:34:35 -08:00
pname = "celery";
2019-03-03 15:20:00 -08:00
version = "4.3.0";
2018-01-09 02:34:35 -08:00
src = fetchPypi {
inherit pname version;
2019-03-03 15:20:00 -08:00
sha256 = "4c4532aa683f170f40bd76f928b70bc06ff171a959e06e71bf35f2f9d6031ef9";
2018-01-09 02:34:35 -08:00
};
2019-03-03 15:20:00 -08:00
postPatch = ''
substituteInPlace requirements/test.txt \
2019-05-12 11:31:45 -07:00
--replace "moto==1.3.7" moto \
2019-03-03 15:20:00 -08:00
--replace "pytest>=4.3.1,<4.4.0" pytest
'';
2018-01-09 02:34:35 -08:00
# make /etc/protocols accessible to fix socket.getprotobyname('tcp') in sandbox
2018-03-28 11:55:39 -07:00
preCheck = stdenv.lib.optionalString stdenv.isLinux ''
2018-01-09 02:34:35 -08:00
export NIX_REDIRECTS=/etc/protocols=${iana-etc}/etc/protocols \
LD_PRELOAD=${libredirect}/lib/libredirect.so
'';
2018-03-28 11:55:39 -07:00
postCheck = stdenv.lib.optionalString stdenv.isLinux ''
2018-01-09 02:34:35 -08:00
unset NIX_REDIRECTS LD_PRELOAD
'';
checkInputs = [ case pytest boto3 moto ];
2018-01-09 02:34:35 -08:00
propagatedBuildInputs = [ kombu billiard pytz anyjson amqp eventlet ];
meta = with stdenv.lib; {
homepage = https://github.com/celery/celery/;
description = "Distributed task queue";
license = licenses.bsd3;
};
}