2021-09-12 18:29:38 +01:00
|
|
|
{ lib, fetchFromGitHub, python3, installShellFiles }:
|
2017-12-31 13:13:21 +00:00
|
|
|
|
2021-07-09 13:41:03 +01:00
|
|
|
let
|
|
|
|
# Watson is currently not compatible with Click 8. See the following
|
|
|
|
# upstream issues / MRs:
|
|
|
|
#
|
|
|
|
# https://github.com/TailorDev/Watson/issues/430
|
|
|
|
# https://github.com/TailorDev/Watson/pull/432
|
|
|
|
#
|
|
|
|
# Workaround the issue by providing click 7 explicitly.
|
2021-09-12 18:29:38 +01:00
|
|
|
python = python3.override {
|
|
|
|
packageOverrides = self: super: {
|
2022-01-16 06:34:26 +00:00
|
|
|
# Use click 7
|
|
|
|
click = self.callPackage ../../../development/python2-modules/click/default.nix { };
|
2021-09-12 18:29:38 +01:00
|
|
|
};
|
2021-07-09 13:41:03 +01:00
|
|
|
};
|
2021-09-12 18:29:38 +01:00
|
|
|
in with python.pkgs; buildPythonApplication rec {
|
2019-07-01 04:18:56 +01:00
|
|
|
pname = "watson";
|
2021-07-09 13:41:03 +01:00
|
|
|
|
|
|
|
# When you update Watson, please check whether the Click 7
|
|
|
|
# workaround above can go away.
|
2021-05-11 19:54:50 +01:00
|
|
|
version = "2.0.1";
|
2017-05-04 17:11:36 +01:00
|
|
|
|
2020-06-07 20:08:38 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "TailorDev";
|
|
|
|
repo = "Watson";
|
|
|
|
rev = version;
|
2021-05-11 19:54:50 +01:00
|
|
|
sha256 = "0radf5afyphmzphfqb4kkixahds2559nr3yaqvni4xrisdaiaymz";
|
2017-05-04 17:11:36 +01:00
|
|
|
};
|
|
|
|
|
2020-04-28 07:46:48 +01:00
|
|
|
postInstall = ''
|
|
|
|
installShellCompletion --bash --name watson watson.completion
|
|
|
|
installShellCompletion --zsh --name _watson watson.zsh-completion
|
2021-09-24 18:24:54 +01:00
|
|
|
installShellCompletion --fish watson.fish
|
2020-04-28 07:46:48 +01:00
|
|
|
'';
|
|
|
|
|
2021-03-22 13:29:01 +00:00
|
|
|
checkInputs = [ pytestCheckHook pytest-mock mock pytest-datafiles ];
|
2021-09-12 18:29:38 +01:00
|
|
|
propagatedBuildInputs = [ arrow click click-didyoumean requests ];
|
2020-04-28 07:46:48 +01:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
2017-05-04 17:11:36 +01:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://tailordev.github.io/Watson/";
|
2017-05-04 17:11:36 +01:00
|
|
|
description = "A wonderful CLI to track your time!";
|
|
|
|
license = licenses.mit;
|
2020-08-15 14:25:59 +01:00
|
|
|
maintainers = with maintainers; [ mguentner nathyong oxzi ];
|
2017-05-04 17:11:36 +01:00
|
|
|
};
|
2017-12-31 13:13:21 +00:00
|
|
|
}
|