4a7f99d55d
Part of: https://github.com/NixOS/nixpkgs/issues/108938 meta = with stdenv.lib; is a widely used pattern. We want to slowly remove the `stdenv.lib` indirection and encourage people to use `lib` directly. Thus let’s start with the meta field. This used a rewriting script to mostly automatically replace all occurances of this pattern, and add the `lib` argument to the package header if it doesn’t exist yet. The script in its current form is available at https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
46 lines
1.2 KiB
Nix
46 lines
1.2 KiB
Nix
{ lib, stdenv, fetchPypi, buildPythonPackage, fetchFromGitHub, simplejson, redis, setproctitle, nose, pkgs }:
|
|
|
|
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
|
|
|
|
buildPythonPackage rec {
|
|
pname = "pyres";
|
|
version = "1.5";
|
|
|
|
# ps is used in Worker.worker_pids method
|
|
propagatedBuildInputs = [ simplejson setproctitle redis' pkgs.ps ];
|
|
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";
|
|
};
|
|
|
|
checkPhase = ''
|
|
redis-server &
|
|
nosetests . --exclude test_worker_pids
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "Python resque clone";
|
|
homepage = "https://github.com/binarydud/pyres";
|
|
license = licenses.mit;
|
|
maintainers = with maintainers; [ jluttine ];
|
|
};
|
|
}
|