about summary refs log tree commit diff
path: root/pkgs/development/python-modules/taskw/default.nix
blob: e04f9c0284b522d0e28aee7c6dc6e3f86b7519c2 (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
51
52
53
54
55
56
57
58
59
{
  lib,
  buildPythonPackage,
  fetchPypi,

  # build-system
  setuptools,

  # native dependencies
  pkgs,

  # dependencies
  kitchen,
  python-dateutil,
  pytz,

  # tests
  pytest7CheckHook,
}:

buildPythonPackage rec {
  pname = "taskw";
  version = "2.0.0";
  pyproject = true;

  src = fetchPypi {
    inherit pname version;
    hash = "sha256-EQm9+b3nqbMqUAejAsh4MD/2UYi2QiWsdKMomkxUi90=";
  };

  patches = [
    ./use-template-for-taskwarrior-install-path.patch
    # Remove when https://github.com/ralphbean/taskw/pull/151 is merged.
    ./support-relative-path-in-taskrc.patch
  ];
  postPatch = ''
    substituteInPlace taskw/warrior.py \
      --replace '@@taskwarrior@@' '${pkgs.taskwarrior}'
  '';

  build-system = [ setuptools ];

  buildInputs = [ pkgs.taskwarrior ];

  dependencies = [
    kitchen
    python-dateutil
    pytz
  ];

  nativeCheckInputs = [ pytest7CheckHook ];

  meta = with lib; {
    homepage = "https://github.com/ralphbean/taskw";
    description = "Python bindings for your taskwarrior database";
    license = licenses.gpl3Plus;
    maintainers = with maintainers; [ pierron ];
  };
}