2019-05-24 09:25:10 +00:00
|
|
|
{ stdenv
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
, redis
|
|
|
|
, pytest
|
|
|
|
, process-tests
|
|
|
|
, pkgs
|
|
|
|
, withDjango ? false, django_redis
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "python-redis-lock";
|
2020-08-16 17:31:13 +00:00
|
|
|
version = "3.6.0";
|
2019-05-24 09:25:10 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2020-08-16 17:31:13 +00:00
|
|
|
sha256 = "6c79b87f2fefcf47bbcebea56056d324e9d7971c9b98123b79590e08cbb0a8f7";
|
2019-05-24 09:25:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
checkInputs = [ pytest process-tests pkgs.redis ];
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
pytest tests/
|
|
|
|
'';
|
|
|
|
|
|
|
|
propagatedBuildInputs = [ redis ]
|
|
|
|
++ stdenv.lib.optional withDjango django_redis;
|
|
|
|
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
homepage = "https://github.com/ionelmc/python-redis-lock";
|
|
|
|
license = licenses.bsd2;
|
|
|
|
description = "Lock context manager implemented via redis SETNX/BLPOP";
|
|
|
|
maintainers = with maintainers; [ vanschelven ];
|
|
|
|
};
|
|
|
|
}
|