2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
buildPythonPackage,
|
|
|
|
eventlet,
|
|
|
|
fetchPypi,
|
|
|
|
gevent,
|
|
|
|
pkgs,
|
|
|
|
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
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
propagatedBuildInputs = [ redis ] ++ lib.optionals withDjango [ 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
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
disabledTests =
|
|
|
|
[
|
|
|
|
# https://github.com/ionelmc/python-redis-lock/issues/86
|
|
|
|
"test_no_overlap2"
|
|
|
|
]
|
|
|
|
++ lib.optionals stdenv.isDarwin [
|
|
|
|
# fail on Darwin because it defaults to multiprocessing `spawn`
|
|
|
|
"test_reset_signalizes"
|
|
|
|
"test_reset_all_signalizes"
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "redis_lock" ];
|
2023-02-02 18:25:31 +00:00
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|