2020-06-07 20:08:38 +01:00
|
|
|
{ stdenv, fetchFromGitHub, pythonPackages, fetchpatch, installShellFiles }:
|
2017-05-04 17:11:36 +01:00
|
|
|
|
2017-12-31 13:13:21 +00:00
|
|
|
with pythonPackages;
|
|
|
|
|
|
|
|
buildPythonApplication rec {
|
2019-07-01 04:18:56 +01:00
|
|
|
pname = "watson";
|
2020-06-07 20:08:38 +01:00
|
|
|
version = "1.9.0";
|
2017-05-04 17:11:36 +01:00
|
|
|
|
2020-06-07 20:08:38 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "TailorDev";
|
|
|
|
repo = "Watson";
|
|
|
|
rev = version;
|
|
|
|
sha256 = "0f0ldwadjf0xncx3m4w4wwqddd4wjwcsrbhby8vgsnqsn48dnfcx";
|
2017-05-04 17:11:36 +01:00
|
|
|
};
|
|
|
|
|
2020-06-07 20:08:38 +01:00
|
|
|
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";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2017-05-04 17:11:36 +01:00
|
|
|
checkPhase = ''
|
2019-07-01 04:20:13 +01:00
|
|
|
pytest -vs tests
|
2020-04-28 07:40:36 +01:00
|
|
|
'';
|
2017-12-31 13:13:21 +00:00
|
|
|
|
2020-04-28 07:46:48 +01:00
|
|
|
postInstall = ''
|
|
|
|
installShellCompletion --bash --name watson watson.completion
|
|
|
|
installShellCompletion --zsh --name _watson watson.zsh-completion
|
|
|
|
'';
|
|
|
|
|
2020-06-07 20:08:38 +01:00
|
|
|
checkInputs = [ py pytest pytest-datafiles pytest-mock pytestrunner ];
|
|
|
|
propagatedBuildInputs = [ arrow click click-didyoumean requests ];
|
2020-04-28 07:46:48 +01:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
2017-05-04 17:11:36 +01:00
|
|
|
|
|
|
|
meta = with stdenv.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-04-28 07:40:36 +01:00
|
|
|
maintainers = with maintainers; [ mguentner nathyong ];
|
2017-05-04 17:11:36 +01:00
|
|
|
};
|
2017-12-31 13:13:21 +00:00
|
|
|
}
|