about summary refs log tree commit diff
path: root/pkgs/development/python-modules/debts/default.nix
blob: 36e51d2b4477bbab2685178517a5e98f185049e3 (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
{
  lib,
  python,
  buildPythonPackage,
  fetchFromGitLab,
  isPy27,
  jinja2,
  pytest,
}:

buildPythonPackage rec {
  pname = "debts";
  version = "0.5";
  format = "setuptools";

  # pypi does not ship tests
  src = fetchFromGitLab {
    domain = "framagit.org";
    owner = "almet";
    repo = "debts";
    rev = "d887bd8b340172d1c9bbcca6426529b8d1c2a241"; # no tags
    sha256 = "1d66nka81mv9c07mki78lp5hdajqv4cq6aq2k7bh3mhkc5hwnwlg";
  };

  disabled = isPy27;

  propagatedBuildInputs = [ jinja2 ];

  nativeCheckInputs = [ pytest ];

  # for some reason tests only work if the module is properly installed
  checkPhase = ''
    rm -r debts
    export PYTHONPATH=$out/${python.sitePackages}:$PYTHONPATH
    py.test tests
  '';

  meta = with lib; {
    inherit (src.meta) homepage;
    description = "Simple library and cli-tool to help you solve some debts settlement scenarios";
    mainProgram = "debts";
    license = licenses.beerware;
    maintainers = [ maintainers.symphorien ];
  };
}