1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pythonOlder,
6 poetry-core,
7 aw-core,
8 requests,
9 persist-queue,
10 click,
11 tabulate,
12 typing-extensions,
13 pytestCheckHook,
14}:
15
16buildPythonPackage rec {
17 pname = "aw-client";
18 version = "0.5.15";
19 pyproject = true;
20
21 disabled = pythonOlder "3.8";
22
23 src = fetchFromGitHub {
24 owner = "ActivityWatch";
25 repo = "aw-client";
26 tag = "v${version}";
27 hash = "sha256-AS29DIfEQ6/vh8idcMMQoGmiRM8MMf3eVQzvNPsXgpA=";
28 };
29
30 build-system = [ poetry-core ];
31
32 dependencies = [
33 aw-core
34 requests
35 persist-queue
36 click
37 tabulate
38 typing-extensions
39 ];
40
41 nativeCheckInputs = [ pytestCheckHook ];
42
43 # Only run this test, the others are integration tests that require
44 # an instance of aw-server running in order to function.
45 enabledTestPaths = [ "tests/test_requestqueue.py" ];
46
47 preCheck = ''
48 # Fake home folder for tests that write to $HOME
49 export HOME="$TMPDIR"
50 '';
51
52 pythonImportsCheck = [ "aw_client" ];
53
54 meta = with lib; {
55 description = "Client library for ActivityWatch";
56 homepage = "https://github.com/ActivityWatch/aw-client";
57 changelog = "https://github.com/ActivityWatch/aw-client/releases/tag/v${version}";
58 license = licenses.mpl20;
59 maintainers = with maintainers; [ huantian ];
60 mainProgram = "aw-client";
61 };
62}