1{ lib, stdenv, fetchPypi, buildPythonPackage, fetchFromGitHub, simplejson, redis, setproctitle, nose, pkgs }:
2
3let
4
5 # the requirements of `pyres` support Redis 3.x (due to a missing upper-bound),
6 # but it doesn't support Redis 3.x.
7 redis' = redis.overridePythonAttrs (old: rec {
8 pname = "redis";
9 version = "2.10.6";
10 src = fetchPypi {
11 inherit pname version;
12 sha256 = "03vcgklykny0g0wpvqmy8p6azi2s078317wgb2xjv5m2rs9sjb52";
13 };
14 });
15
16in
17
18buildPythonPackage rec {
19 pname = "pyres";
20 version = "1.5";
21
22 # ps is used in Worker.worker_pids method
23 propagatedBuildInputs = [ simplejson setproctitle redis' pkgs.ps ];
24 checkInputs = [ nose pkgs.redis ];
25
26 # PyPI tarball doesn't contain tests so let's use GitHub
27 src = fetchFromGitHub {
28 owner = "binarydud";
29 repo = pname;
30 rev = version;
31 sha256 = "1rkpv7gbjxl9h9g7kncmsrgmi77l7pgfq8d7dbnsr3ia2jmjqb8y";
32 };
33
34 # started redis-server makes this hang on darwin
35 doCheck = !stdenv.isDarwin;
36
37 checkPhase = ''
38 redis-server &
39 nosetests . --exclude test_worker_pids
40 '';
41
42 meta = with lib; {
43 description = "Python resque clone";
44 homepage = "https://github.com/binarydud/pyres";
45 license = licenses.mit;
46 maintainers = with maintainers; [ jluttine ];
47 };
48}