2021-02-05 17:12:51 +00:00
|
|
|
{ lib, fetchFromGitHub, pythonPackages, installShellFiles }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
with pythonPackages;
|
|
|
|
|
2021-07-14 22:03:04 +00: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.
|
|
|
|
click7 = pythonPackages.callPackage ../../../development/python-modules/click/7.nix {};
|
|
|
|
click7-didyoumean = click-didyoumean.override {
|
|
|
|
click = click7;
|
|
|
|
};
|
|
|
|
in buildPythonApplication rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "watson";
|
2021-07-14 22:03:04 +00:00
|
|
|
|
|
|
|
# When you update Watson, please check whether the Click 7
|
|
|
|
# workaround above can go away.
|
2021-05-20 23:08:51 +00:00
|
|
|
version = "2.0.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-06-18 07:06:33 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "TailorDev";
|
|
|
|
repo = "Watson";
|
|
|
|
rev = version;
|
2021-05-20 23:08:51 +00:00
|
|
|
sha256 = "0radf5afyphmzphfqb4kkixahds2559nr3yaqvni4xrisdaiaymz";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2020-05-03 17:38:23 +00:00
|
|
|
postInstall = ''
|
|
|
|
installShellCompletion --bash --name watson watson.completion
|
|
|
|
installShellCompletion --zsh --name _watson watson.zsh-completion
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-04-12 18:23:04 +00:00
|
|
|
checkInputs = [ pytestCheckHook pytest-mock mock pytest-datafiles ];
|
2021-07-14 22:03:04 +00:00
|
|
|
propagatedBuildInputs = [ arrow click7 click7-didyoumean requests ];
|
2020-05-03 17:38:23 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://tailordev.github.io/Watson/";
|
|
|
|
description = "A wonderful CLI to track your time!";
|
|
|
|
license = licenses.mit;
|
2020-08-20 17:08:02 +00:00
|
|
|
maintainers = with maintainers; [ mguentner nathyong oxzi ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|