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
|
2023-02-02 18:25:31 +00:00
|
|
|
, eventlet
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchPypi
|
2023-02-02 18:25:31 +00:00
|
|
|
, gevent
|
2020-04-24 23:36:52 +00:00
|
|
|
, pkgs
|
2023-02-02 18:25:31 +00:00
|
|
|
, process-tests
|
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
|
|
|
, redis
|
|
|
|
, withDjango ? false
|
|
|
|
, django-redis
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "python-redis-lock";
|
2023-01-20 10:41:00 +00:00
|
|
|
version = "4.0.0";
|
2023-02-02 18:25:31 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2023-02-02 18:25:31 +00:00
|
|
|
hash = "sha256-Sr0Lz0kTasrWZye/VIbdJJQHjKVeSe+mk/eUB3MZCRo=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
redis
|
2023-03-15 16:39:30 +00:00
|
|
|
] ++ lib.optionals withDjango [
|
2023-02-02 18:25:31 +00:00
|
|
|
django-redis
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
|
|
|
eventlet
|
|
|
|
gevent
|
2021-05-20 23:08:51 +00:00
|
|
|
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
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"redis_lock"
|
|
|
|
];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2023-02-02 18:25:31 +00:00
|
|
|
changelog = "https://github.com/ionelmc/python-redis-lock/blob/v${version}/CHANGELOG.rst";
|
|
|
|
description = "Lock context manager implemented via redis SETNX/BLPOP";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/ionelmc/python-redis-lock";
|
|
|
|
license = licenses.bsd2;
|
|
|
|
maintainers = with maintainers; [ vanschelven ];
|
|
|
|
};
|
|
|
|
}
|