1{ lib 2, stdenv 3, buildPythonPackage 4, fetchPypi 5, redis 6, pytestCheckHook 7, process-tests 8, pkgs 9, withDjango ? false, django-redis 10}: 11 12buildPythonPackage rec { 13 pname = "python-redis-lock"; 14 version = "3.7.0"; 15 16 src = fetchPypi { 17 inherit pname version; 18 sha256 = "4265a476e39d476a8acf5c2766485c44c75f3a1bd6cf73bb195f3079153b8374"; 19 }; 20 21 propagatedBuildInputs = [ 22 redis 23 ] ++ lib.optional withDjango django-redis; 24 25 checkInputs = [ 26 pytestCheckHook 27 process-tests 28 pkgs.redis 29 ]; 30 31 disabledTests = [ 32 # https://github.com/ionelmc/python-redis-lock/issues/86 33 "test_no_overlap2" 34 ] ++ lib.optionals stdenv.isDarwin [ 35 # fail on Darwin because it defaults to multiprocessing `spawn` 36 "test_reset_signalizes" 37 "test_reset_all_signalizes" 38 ]; 39 40 meta = with lib; { 41 homepage = "https://github.com/ionelmc/python-redis-lock"; 42 license = licenses.bsd2; 43 description = "Lock context manager implemented via redis SETNX/BLPOP"; 44 maintainers = with maintainers; [ vanschelven ]; 45 }; 46}