about summary refs log tree commit diff
path: root/pkgs/tools/system/honcho/default.nix
blob: fcdcc23961b5e6e149793e16a707bbedde8b8d7b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
{ stdenv, fetchFromGitHub, pythonPackages }:

let
  inherit (pythonPackages) python;
  pname = "honcho";

in

pythonPackages.buildPythonApplication rec {
  name = "${pname}-${version}";
  version = "1.0.1";
  namePrefix = "";

  src = fetchFromGitHub {
    owner = "nickstenning";
    repo = "honcho";
    rev = "v${version}";
    sha256 = "11bd87474qpif20xdcn0ra1idj5k16ka51i658wfpxwc6nzsn92b";
  };

  checkInputs = with pythonPackages; [ jinja2 pytest mock coverage ];

  buildPhase = ''
    ${python.interpreter} setup.py build
  '';

  installPhase = ''
    mkdir -p "$out/${python.sitePackages}"

    export PYTHONPATH="$out/${python.sitePackages}:$PYTHONPATH"

    ${python.interpreter} setup.py install \
      --install-lib=$out/${python.sitePackages} \
      --prefix="$out"
  '';

  checkPhase = ''
    runHook preCheck
    PATH=$out/bin:$PATH coverage run -m pytest
    runHook postCheck
  '';

  meta = with stdenv.lib; {
    description = "A Python clone of Foreman, a tool for managing Procfile-based applications";
    license = licenses.mit;
    homepage = https://github.com/nickstenning/honcho;
    maintainers = with maintainers; [ benley ];
    platforms = platforms.unix;
  };
}