2021-01-25 08:26:54 +00:00
|
|
|
{ lib
|
2019-05-24 10:25:10 +01:00
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
, redis
|
|
|
|
, pytest
|
|
|
|
, process-tests
|
|
|
|
, pkgs
|
|
|
|
, withDjango ? false, django_redis
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "python-redis-lock";
|
2020-11-29 14:04:40 +00:00
|
|
|
version = "3.7.0";
|
2019-05-24 10:25:10 +01:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2020-11-29 14:04:40 +00:00
|
|
|
sha256 = "4265a476e39d476a8acf5c2766485c44c75f3a1bd6cf73bb195f3079153b8374";
|
2019-05-24 10:25:10 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
checkInputs = [ pytest process-tests pkgs.redis ];
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
pytest tests/
|
|
|
|
'';
|
|
|
|
|
|
|
|
propagatedBuildInputs = [ redis ]
|
2021-01-24 00:29:22 +00:00
|
|
|
++ lib.optional withDjango django_redis;
|
2019-05-24 10:25:10 +01:00
|
|
|
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2019-05-24 10:25:10 +01:00
|
|
|
homepage = "https://github.com/ionelmc/python-redis-lock";
|
|
|
|
license = licenses.bsd2;
|
|
|
|
description = "Lock context manager implemented via redis SETNX/BLPOP";
|
|
|
|
maintainers = with maintainers; [ vanschelven ];
|
|
|
|
};
|
|
|
|
}
|