1{ stdenv
2, buildPythonPackage
3, fetchPypi
4, redis
5, pytest
6, process-tests
7, pkgs
8, withDjango ? false, django_redis
9}:
10
11buildPythonPackage rec {
12 pname = "python-redis-lock";
13 version = "3.6.0";
14
15 src = fetchPypi {
16 inherit pname version;
17 sha256 = "6c79b87f2fefcf47bbcebea56056d324e9d7971c9b98123b79590e08cbb0a8f7";
18 };
19
20 checkInputs = [ pytest process-tests pkgs.redis ];
21
22 checkPhase = ''
23 pytest tests/
24 '';
25
26 propagatedBuildInputs = [ redis ]
27 ++ stdenv.lib.optional withDjango django_redis;
28
29
30 meta = with stdenv.lib; {
31 homepage = "https://github.com/ionelmc/python-redis-lock";
32 license = licenses.bsd2;
33 description = "Lock context manager implemented via redis SETNX/BLPOP";
34 maintainers = with maintainers; [ vanschelven ];
35 };
36}