2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
2021-06-28 23:13:55 +00:00
|
|
|
, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
, redis
|
2021-05-20 23:08:51 +00:00
|
|
|
, pytestCheckHook
|
2020-04-24 23:36:52 +00:00
|
|
|
, process-tests
|
|
|
|
, pkgs
|
2021-12-06 16:07:01 +00:00
|
|
|
, withDjango ? false, django-redis
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "python-redis-lock";
|
2020-12-07 07:45:13 +00:00
|
|
|
version = "3.7.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2020-12-07 07:45:13 +00:00
|
|
|
sha256 = "4265a476e39d476a8acf5c2766485c44c75f3a1bd6cf73bb195f3079153b8374";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
redis
|
2021-12-06 16:07:01 +00:00
|
|
|
] ++ lib.optional withDjango django-redis;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
checkInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
process-tests
|
|
|
|
pkgs.redis
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
disabledTests = [
|
|
|
|
# https://github.com/ionelmc/python-redis-lock/issues/86
|
|
|
|
"test_no_overlap2"
|
2021-06-28 23:13:55 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
# fail on Darwin because it defaults to multiprocessing `spawn`
|
|
|
|
"test_reset_signalizes"
|
|
|
|
"test_reset_all_signalizes"
|
2021-05-20 23:08:51 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00: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 ];
|
|
|
|
};
|
|
|
|
}
|