about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/office/watson/default.nix
blob: 5d4b915edfb5eba96324448683a3eb71bbdfb860 (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
{ stdenv, fetchFromGitHub, pythonPackages, fetchpatch, installShellFiles }:

with pythonPackages;

buildPythonApplication rec {
  pname = "watson";
  version = "1.9.0";

  src = fetchFromGitHub {
    owner = "TailorDev";
    repo = "Watson";
    rev = version;
    sha256 = "0f0ldwadjf0xncx3m4w4wwqddd4wjwcsrbhby8vgsnqsn48dnfcx";
  };

  patches = [
    # https://github.com/TailorDev/Watson/pull/380
    # The nixpkgs' arrow version is too new / not supported by Watson's latest release.
    (fetchpatch {
      url = "https://github.com/TailorDev/Watson/commit/69b9ad25551525d52060f7fb2eef3653e872a455.patch";
      sha256 = "0zrswgr0y219f92zi41m7cymfaspkhmlada4v9ijnsjjdb4bn2c9";
    })
  ];

  checkPhase = ''
    pytest -vs tests
  '';

  postInstall = ''
    installShellCompletion --bash --name watson watson.completion
    installShellCompletion --zsh --name _watson watson.zsh-completion
  '';

  checkInputs = [ py pytest pytest-datafiles pytest-mock pytestrunner ];
  propagatedBuildInputs = [ arrow click click-didyoumean requests ];
  nativeBuildInputs = [ installShellFiles ];

  meta = with stdenv.lib; {
    homepage = "https://tailordev.github.io/Watson/";
    description = "A wonderful CLI to track your time!";
    license = licenses.mit;
    maintainers = with maintainers; [ mguentner nathyong ];
  };
}