2021-01-22 13:13:34 +00:00
|
|
|
{ lib, stdenv, fetchPypi, buildPythonPackage, fetchFromGitHub, simplejson, redis, setproctitle, nose, pkgs }:
|
2018-11-28 15:25:56 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
# the requirements of `pyres` support Redis 3.x (due to a missing upper-bound),
|
|
|
|
# but it doesn't support Redis 3.x.
|
|
|
|
redis' = redis.overridePythonAttrs (old: rec {
|
|
|
|
pname = "redis";
|
|
|
|
version = "2.10.6";
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
|
|
|
sha256 = "03vcgklykny0g0wpvqmy8p6azi2s078317wgb2xjv5m2rs9sjb52";
|
|
|
|
};
|
|
|
|
});
|
|
|
|
|
|
|
|
in
|
2018-10-27 13:17:30 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pyres";
|
|
|
|
version = "1.5";
|
|
|
|
|
|
|
|
# ps is used in Worker.worker_pids method
|
2018-11-28 15:25:56 +00:00
|
|
|
propagatedBuildInputs = [ simplejson setproctitle redis' pkgs.ps ];
|
2018-10-27 13:17:30 +00:00
|
|
|
checkInputs = [ nose pkgs.redis ];
|
|
|
|
|
|
|
|
# PyPI tarball doesn't contain tests so let's use GitHub
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "binarydud";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
|
|
|
sha256 = "1rkpv7gbjxl9h9g7kncmsrgmi77l7pgfq8d7dbnsr3ia2jmjqb8y";
|
|
|
|
};
|
|
|
|
|
2021-01-22 13:13:34 +00:00
|
|
|
# started redis-server makes this hang on darwin
|
|
|
|
doCheck = !stdenv.isDarwin;
|
|
|
|
|
2018-10-27 13:17:30 +00:00
|
|
|
checkPhase = ''
|
|
|
|
redis-server &
|
2019-03-02 13:50:16 +00:00
|
|
|
nosetests . --exclude test_worker_pids
|
2018-10-27 13:17:30 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2018-10-27 13:17:30 +00:00
|
|
|
description = "Python resque clone";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://github.com/binarydud/pyres";
|
2018-10-27 13:17:30 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ jluttine ];
|
|
|
|
};
|
|
|
|
}
|